[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework ErrorCode.java, 1.1, 1.2 Main.ja
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-09-06 22:07:24
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13517 Modified Files: ErrorCode.java Main.java Log Message: no message Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Main.java 6 Sep 2006 13:32:58 -0000 1.16 --- Main.java 6 Sep 2006 22:07:22 -0000 1.17 *************** *** 96,100 **** logger.error("Received configuration map = " + configMap); jobName=(String)configMap.get(Main.JOB_NAME_KEY_NAME); ! logger.debug("Job to be invoked = " + jobName); if(jobName!=null && !"".equals(jobName.trim())) { --- 96,100 ---- logger.error("Received configuration map = " + configMap); jobName=(String)configMap.get(Main.JOB_NAME_KEY_NAME); ! logger.info("Job to be invoked = " + jobName); if(jobName!=null && !"".equals(jobName.trim())) { *************** *** 128,132 **** */ JobStatistics jobStatistics=jobController.getJobStatistics(); ! logger.info(jobStatistics); Repository.getRepository().logStatistics(jobStatistics); } --- 128,132 ---- */ JobStatistics jobStatistics=jobController.getJobStatistics(); ! logger.error(jobStatistics); Repository.getRepository().logStatistics(jobStatistics); } *************** *** 140,144 **** else { ! logger.fatal("job-name parameter cannot be found in the configuration to kick of the job = " + jobName); returnCode=ErrorCode.JOB_INVOKATION_CONFIGURAION_ERROR; } --- 140,145 ---- else { ! logger.fatal("job-name parameter cannot be found in the configuration to kick " + ! "off the job . Received configuration = " + configMap); returnCode=ErrorCode.JOB_INVOKATION_CONFIGURAION_ERROR; } *************** *** 160,165 **** { logger.debug("Unregistering the controller with the management agent"); ! if(jobManagementAgent!=null) ! jobManagementAgent.stop(returnCode); } logger.error("Exiting process = " + returnCode); --- 161,166 ---- { logger.debug("Unregistering the controller with the management agent"); ! if(jobManagementAgent!=null && jobManagementAgent.isRunning()) ! jobManagementAgent.stop(returnCode); } logger.error("Exiting process = " + returnCode); *************** *** 185,220 **** * * @param args Configuration details in command line params as name=value format - * */ public static void main(String args[]) { - /** - * Get the framework configuration and initialize the framework logging. - */ - logger.debug("Retrieving the framework configuration"); - FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); - logger.debug("Initializing the framework logging"); - LoggingManager.initializeFrameworkLogging(frameworkConfig.getFrameworkLoggingConfig()); - - logger.info("Job processing has been started"); ErrorCode exitCode=ErrorCode.JOB_COMPLETED_SUCCESSFULLY; - Map configMap=new HashMap(); - /** - * Translate the command line parameters into the configuration map. - */ try { ! StringBuffer commandLineConfiguration=new StringBuffer(); for(int i=0;i<args.length;i++) ! commandLineConfiguration.append(args[i]+":"); ! FrameworkUtil.loadPropertiesFromStringToMap(commandLineConfiguration.toString(),configMap); exitCode=Main.process(configMap); } ! catch(IllegalArgumentException exception) { exception.printStackTrace(); ! logger.fatal("Exception while parsing the command line parameters = " + args ! + " Message = " + exception.getMessage(),exception); ! exitCode=ErrorCode.JOB_INVOKATION_CONFIGURAION_ERROR; } logger.error("Job finishing with the exit code = " + exitCode.toString()); --- 186,237 ---- * * @param args Configuration details in command line params as name=value format */ public static void main(String args[]) { ErrorCode exitCode=ErrorCode.JOB_COMPLETED_SUCCESSFULLY; try { ! /** ! * Get the framework configuration and initialize the framework logging. ! */ ! logger.debug("Retrieving the framework configuration"); ! FrameworkConfig frameworkConfig=FrameworkConfig.getInstance(); ! logger.debug("Initializing the framework logging"); ! LoggingManager.initializeFrameworkLogging(frameworkConfig.getFrameworkLoggingConfig()); ! ! /** ! * Translate the command line parameters into the configuration map. ! */ ! logger.info("Job processing has been started"); ! Map configMap=new HashMap(); for(int i=0;i<args.length;i++) ! { ! int index=args[i].indexOf("="); ! if(index>1) ! { ! configMap.put(args[i].substring(0, index), args[i].substring(index+1)); ! logger.info("Loaded the argument = " + args[i] + " into configuration map."); ! } ! else ! logger.info("Not loading the argument = " + args[i] + " into configuration map. " + ! "It is not following the name=value format."); ! } ! /** ! * Kick off the process by passing configuration map. ! */ exitCode=Main.process(configMap); } ! catch(ConfigurationException exception) { exception.printStackTrace(); ! logger.fatal("Configuration Exception in the component " + exception.getExceptionComponent() + ! " while processing the job. Message = " + exception.getMessage(),exception); ! exitCode=exception.getErrorCode(); ! } ! catch(Throwable exception) ! { ! exception.printStackTrace(); ! logger.fatal("Exception while processing the job. Message = "+ exception.getMessage(),exception); ! exitCode=ErrorCode.JOB_COMPLETED_WITH_ERRORS.appendMessage(exception.getMessage()); } logger.error("Job finishing with the exit code = " + exitCode.toString()); Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/ErrorCode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ErrorCode.java 29 Aug 2006 02:01:33 -0000 1.1 --- ErrorCode.java 6 Sep 2006 22:07:22 -0000 1.2 *************** *** 142,146 **** * Represents the configuration error used to invoke the job. */ ! public static final ErrorCode JOB_INVOKATION_CONFIGURAION_ERROR = new ErrorCode(1000,"Error while parsing the configuraion passed to invoke job."); /** * Represents the framework configuration error. --- 142,146 ---- * Represents the configuration error used to invoke the job. */ ! public static final ErrorCode JOB_INVOKATION_CONFIGURAION_ERROR = new ErrorCode(1000,"Error in configuraion passed to invoke job."); /** * Represents the framework configuration error. |