Thread: [Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/mgmtmntr JobStatus.java,1.1,1.2 M
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-03-22 14:21:10
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24394/mgmtmntr Modified Files: JobStatus.java MgmtMntrManager.java Log Message: no message Index: MgmtMntrManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/MgmtMntrManager.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MgmtMntrManager.java 21 Mar 2006 04:27:48 -0000 1.4 --- MgmtMntrManager.java 22 Mar 2006 14:20:45 -0000 1.5 *************** *** 26,35 **** public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; - /** - * Name of the job this manager is configured to. - */ - private String jobName; private static Logger logger=Logger.getLogger(MgmtMntrManager.class); /** * This factory method creates the correct implementation of MgmtMntrManager --- 26,34 ---- public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; private static Logger logger=Logger.getLogger(MgmtMntrManager.class); + + private static MgmtMntrManager mgmtMntrManager=null; + /** * This factory method creates the correct implementation of MgmtMntrManager *************** *** 48,57 **** * @return Returns the MgmtMntrManager implemenation. */ ! public static MgmtMntrManager getMgmtMntrManager(String jobName, FrameworkConfig.MgmtMntrConfig mgmtMntrconfig) { ! logger.trace("Entering getMgmtMntrManager " + jobName); ! if(jobName==null) ! throw new IllegalArgumentException("job name cannot be null to get the mgmt and mntr manager"); if(mgmtMntrconfig==null) --- 47,56 ---- * @return Returns the MgmtMntrManager implemenation. */ ! public static MgmtMntrManager getMgmtMntrManager(FrameworkConfig.MgmtMntrConfig mgmtMntrconfig) { ! logger.trace("Entering getMgmtMntrManager "); ! // if(jobName==null) ! // throw new IllegalArgumentException("job name cannot be null to get the mgmt and mntr manager"); if(mgmtMntrconfig==null) *************** *** 64,68 **** mmManager=(MgmtMntrManager)Class.forName(mgmtMntrManagerClassName).newInstance(); mmManager.init(mgmtMntrconfig.getMgmtMntrProperties()); ! mmManager.jobName=jobName; } catch(ClassNotFoundException exception) --- 63,67 ---- mmManager=(MgmtMntrManager)Class.forName(mgmtMntrManagerClassName).newInstance(); mmManager.init(mgmtMntrconfig.getMgmtMntrProperties()); ! //mmManager.jobName=jobName; } catch(ClassNotFoundException exception) *************** *** 103,108 **** * This method creates the MBeanServer with JobManagerMBean and JobMonitorMBean beans * and passes this controller references to the these mbeans and creates the connector server ! * and saves this connector information in the common place to be looked up by server. * * @param controller Controller reference to be passed to the mbeans. * --- 102,109 ---- * This method creates the MBeanServer with JobManagerMBean and JobMonitorMBean beans * and passes this controller references to the these mbeans and creates the connector server ! * and saves this connector information in the common place to be looked up by server ! * with the jobName. * + * @param jobName Name of the job the controller belongs to. * @param controller Controller reference to be passed to the mbeans. * *************** *** 111,115 **** * @throws IllegalArgumentException If input parameter controller is null. */ ! public abstract boolean registerController(JobController controller); /** --- 112,116 ---- * @throws IllegalArgumentException If input parameter controller is null. */ ! public abstract boolean registerController(String jobName,JobController controller); /** *************** *** 125,136 **** public abstract boolean unregisterController(StatusCode controllerExitStatus); - /** - * Returns the job name. - * @return Returns the job name. - */ - public String getJobName() - { - return this.jobName; - } - } --- 126,128 ---- Index: JobStatus.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/JobStatus.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobStatus.java 3 Mar 2006 04:19:56 -0000 1.1 --- JobStatus.java 22 Mar 2006 14:20:45 -0000 1.2 *************** *** 1,17 **** package org.jmonks.batchserver.framework.mgmtmntr; public class JobStatus { ! ! public static JobStatus RUNNING = new JobStatus(1); ! ! public static JobStatus SUSPENDED = new JobStatus(2); ! private JobStatus(int statusID) { } ! ! public int getStatusID() { ! return 0; } } --- 1,53 ---- package org.jmonks.batchserver.framework.mgmtmntr; + /** + * <p> + * JobStatus class defines the available statuses of the jobs in the system as + * enums. + * </p> + * + * @author Suresh Pragada + * @version 1.0 + * @since 1.0 + */ public class JobStatus { ! /** ! * Status indicates that job is running. ! */ ! public static JobStatus RUNNING = new JobStatus("RUNNING"); ! /** ! * Status indictes that job is suspended. ! */ ! public static JobStatus SUSPENDED = new JobStatus("SUSPENDED"); ! /** ! * Status indicates the job is stopped. ! */ ! public static JobStatus STOPPED = new JobStatus("STOPPED"); ! /** ! * Status indicates the job is resumed. ! */ ! public static JobStatus RESUMED = new JobStatus("RESUMED"); ! ! /** ! * Varaible holds the status ID. ! */ ! private String statusID; ! ! /** ! * Constructor make sure all the constants have been defined inside this ! * class and takes the status ID. ! */ ! private JobStatus(String statusID) { + this.statusID=statusID; } ! ! /** ! * Returns the job status in string format. ! */ ! public String toString() { ! return this.statusID; } } |