Thread: [Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/controller JobController.java,
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-09-13 23:29:48
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25427/framework/controller Modified Files: JobController.java Log Message: no message Index: JobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/JobController.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** JobController.java 29 Aug 2006 02:01:33 -0000 1.11 --- JobController.java 13 Sep 2006 23:29:45 -0000 1.12 *************** *** 5,10 **** import org.jmonks.batchserver.framework.LoggingManager; import org.jmonks.batchserver.framework.ErrorCode; import org.jmonks.batchserver.framework.config.ConfigurationException; - import org.jmonks.batchserver.framework.config.JobControllerConfig; import org.jmonks.batchserver.framework.management.JobMonitorMBean; import org.jmonks.batchserver.framework.management.JobManagerMBean; --- 5,10 ---- import org.jmonks.batchserver.framework.LoggingManager; import org.jmonks.batchserver.framework.ErrorCode; + import org.jmonks.batchserver.framework.JobContext; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.management.JobMonitorMBean; import org.jmonks.batchserver.framework.management.JobManagerMBean; *************** *** 30,42 **** public abstract class JobController implements JobMonitorMBean, JobManagerMBean { - //protected static final String JOB_CONTROLLER_RESTART_PROPERTY_NAME = "job-controller-restart"; /** * Name of the job this controller belongs to. */ ! private String jobName=null; ! /** ! * Job controller configuration this controller is going to use. ! */ ! private JobControllerConfig jobControllerConfig=null; /** * Singletone instance of job controller. --- 30,37 ---- public abstract class JobController implements JobMonitorMBean, JobManagerMBean { /** * Name of the job this controller belongs to. */ ! protected JobContext jobContext=null; /** * Singletone instance of job controller. *************** *** 64,82 **** * @return Returns the correct implementation of the controller. */ ! public static synchronized JobController getJobController(String jobName, JobControllerConfig jobControllerConfig) { ! logger.trace("Entering getJobController = " + jobName); if(jobController==null) { ! if(jobName==null) ! throw new IllegalArgumentException("job name cannot be null to create the job controller."); ! if(jobControllerConfig==null) ! throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, "job controller configuration is not defined in framework configuration"); ! ! /** ! * TODO :: Check for the restart flag all over and take necessary actions before actually instantiating the ! * job controller. ! */ ! String jobControllerClassName=jobControllerConfig.getJobControllerClasName(); if(jobControllerClassName==null || "".equals(jobControllerClassName)) throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, "job controller class name is not defined in job controller configuration"); --- 59,68 ---- * @return Returns the correct implementation of the controller. */ ! public static synchronized JobController getJobController(JobContext jobContext) { ! logger.trace("Entering getJobController = " + jobContext.getJobName()); if(jobController==null) { ! String jobControllerClassName=jobContext.getJobConfig().getJobControllerConfig().getJobControllerClasName(); if(jobControllerClassName==null || "".equals(jobControllerClassName)) throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, "job controller class name is not defined in job controller configuration"); *************** *** 86,91 **** { jobController=(JobController)Class.forName(jobControllerClassName).newInstance(); ! jobController.jobName=jobName; ! jobController.jobControllerConfig=jobControllerConfig; logger.debug("created the job controller implemenation class"); } --- 72,76 ---- { jobController=(JobController)Class.forName(jobControllerClassName).newInstance(); ! jobController.jobContext=jobContext; logger.debug("created the job controller implemenation class"); } *************** *** 109,134 **** } } ! logger.trace("Exiting getJobController = " + jobName); return jobController; } - /** ! * Returns the job name. */ ! public String getJobName() { ! return this.jobName; } /** - * Returns the job controller configuration defined in job configuration. - */ - public JobControllerConfig getJobControllerConfig() - { - return this.jobControllerConfig; - } - - /** * Gets the log level of the given logger name. * --- 94,110 ---- } } ! logger.trace("Exiting getJobController = " + jobContext.getJobName()); return jobController; } /** ! * Gets the job context. */ ! public JobContext getJobContext() { ! return this.jobContext; } /** * Gets the log level of the given logger name. * |