Package com.sos.JSHelper.Exceptions

Examples of com.sos.JSHelper.Exceptions.JobSchedulerException


    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setObjectFieldsFrom";
    Field[] fields;
    Class<?> origClass = origObj.getClass();
    if (!origClass.isAssignableFrom(this.getClass())) {
      throw new JobSchedulerException(String.format("%1$s must be a subclass of %2$s", this.getClass().getName(), origClass.getName()));
    }
    fields = origClass.getDeclaredFields();
    for (Field field : fields) {
      try {
        // to see private and protected fields too
        field.setAccessible(true);
        if (field.isAccessible()) {
          //final fields couldn't set and throws IllegalAccessException
          //but that's ok because we don't want set final fields
          field.set(this, field.get(origObj));
        }
      }
      catch (IllegalArgumentException e) {
        logger.error("", new JobSchedulerException("IllegalArgumentException", e));
      }
      catch (IllegalAccessException e) {
        // this catch block is reached for final fields (that's ok)
      }
    }
View Full Code Here


    @SuppressWarnings("unused")
    final String conMethodName = conClassName + "::setObjectFieldsFrom";
    Field[] fields;
    Class<?> origClass = origObj.getClass();
    if (!origClass.isAssignableFrom(this.getClass())) {
      throw new JobSchedulerException(String.format("%1$s must be a subclass of %2$s", this.getClass().getName(), origClass.getName()));
    }
    fields = origClass.getDeclaredFields();
    for (Field field : fields) {
      try {
        // to see private and protected fields too
        field.setAccessible(true);
        if (field.isAccessible()) {
          //final fields couldn't set and throws IllegalAccessException
          //but that's ok because we don't want set final fields
          field.set(this, field.get(origObj));
        }
      }
      catch (IllegalArgumentException e) {
        logger.error("", new JobSchedulerException("IllegalArgumentException", e));
      }
      catch (IllegalAccessException e) {
        // this catch block is reached for final fields (that's ok)
      }
    }
View Full Code Here

      e.printStackTrace(System.err);
      throw e;
    }
    catch (final Exception e) {
      e.printStackTrace(System.err);
      throw new JobSchedulerException("toString failed", e);
    }
    return strT;
  }
View Full Code Here

          strT += fleF.toString();
        }
      } // try
      catch (final Exception objException) {
        strT = String.format("%2$s: File '%1$s'. Exception thrown. Check permissions.", pstrFileName, pstrMethodName);
        final JobSchedulerException objJSEx = new JobSchedulerException(strT, objException);
        this.SignalError(objJSEx, strT);
      }
      finally {
        //
      } // finally
View Full Code Here

    // (hoffentlich) �berschrieben von der erbenden Klasse
    try {
      setAllOptions(objSettings);
    }
    catch (Exception e) {
      throw new JobSchedulerException("setAllOptions returns an error:", e);
    }
    setAllCommonOptions(objSettings);
  } // private void LoadProperties
View Full Code Here

  // - </newcode>
  // - </remark> <!-- id=<MehrereExportSQL> -->
  public StringBuffer IterateAllDataElementsByAnnotation(final Class<?> objC, final Object objP, final IterationTypes enuIterate4What, StringBuffer pstrBuffer) {
    final String conMethodName = conClassName + "::IterateAllDataElementsByAnnotation";
    if (objC == null) {
      throw new JobSchedulerException(conMethodName + ": objSegment is null, but must be not null");
    }
    Field objField = null;
    SOSOptionElement.gflgProcessHashMap = true;
    try {
      final Field objFields[] = objC.getFields();
View Full Code Here

      String encoded = getObjectAsString();
      objFile.Write(encoded);
      objFile.close();
    }
    catch (Exception e) {
      throw new JobSchedulerException("Error occured writing object to file: " + e);
    }
  }
View Full Code Here

        encoded = new String(bos.toByteArray());
      }
      return encoded;
    }
    catch (Exception e) {
      throw new JobSchedulerException("Error occured getting object as String: " + e);
    }
  } // private String getObjectAsString
View Full Code Here

      schedulerObject = (JSOptionsClass) ois.readObject();
      ois.close();
      return schedulerObject;
    }
    catch (Exception e) {
      throw new JobSchedulerException("Error occured reading object from file: " + e);
    }
  }
View Full Code Here

      // The parser will validate the document only if a grammar is specified.
      // parser.setFeature("http://xml.org/sax/features/validation/dynamic", true);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new JobSchedulerException(String.format("SAXException ", pobjXMLFile.getAbsolutePath()));
    }
    try {
      // parser.parse(new ByteArrayInputStream(pstrXMLAsString.getBytes()));
      parser.parse(pobjXMLFile.getAbsolutePath());
      Document document = parser.getDocument();
      if (isEmpty(pstrXPathExpr) == true) {
        traverse(document, objProp);
      }
      else {
        SOSXMLXPath xPath = new SOSXMLXPath(pobjXMLFile.getAbsolutePath());
        Node objTempNode = xPath.selectSingleNode(document, pstrXPathExpr);
        if (objTempNode == null) {
          throw new JobSchedulerException(String.format("No Node using xPath '%1$2' found", pstrXPathExpr));
        }
        traverse(objTempNode, objProp);
      }
      LoadProperties(objProp);
    }
    catch (Exception e) {
      e.printStackTrace();
      throw new JobSchedulerException(String.format("Exception ", pobjXMLFile.getAbsolutePath()));
    }
    return objProp;
  } // private void LoadXML
View Full Code Here

TOP

Related Classes of com.sos.JSHelper.Exceptions.JobSchedulerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.