[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/mgmtmntr DefaultMgmtMntrManager.j
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-03-03 04:20:05
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30411/mgmtmntr Added Files: DefaultMgmtMntrManager.java JobManagerMBean.java JobMonitorMBean.java JobStatus.java MgmtMntrManager.java ThreadState.java Log Message: Submitting the class skeltons --- NEW FILE: JobMonitorMBean.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.*; public interface JobMonitorMBean { /** * Gets the total number of records this job might try to process. * * @return Returns the total number of records this job might try to process. */ public int getExpectedRecordsCount(); /** * Gets the records processed by this job so far. * * @return Returns the number of records processed by this job so far. */ public int getProcessedRecordsCount(); /** * Returns the number of threads being run by this job. * * @return Returns the number of threads being run by this job. */ public String[] getThreadIDList(); /** * Gets the state of this thread. This returns the state in a ThreadState object. * * @return Returns the state of this thread. */ public org.jmonks.batchserver.framework.mgmtmntr.ThreadState getThreadState(String threadID); } --- NEW FILE: DefaultMgmtMntrManager.java --- package org.jmonks.batchserver.framework.mgmtmntr; /** * <p> * This is the concrete implementation of the MgmtMntrManager, which uses repository as the common place to save the connector server information, which will be looked up by the server. So, thiis will access the repository to save connector server information. * </p> * * @author : Suresh Pragada * @version 1.0 */ public class DefaultMgmtMntrManager extends MgmtMntrManager { public DefaultMgmtMntrManager(FrameworkConfig$MgmtMntrConfig config) { } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@registerController(org.jmonks.batchserver.framework.controller.JobController) */ public void registerController(org.jmonks.batchserver.framework.controller.JobController controller) { } /** * @see org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager@unregisterController(int) */ public void unregisterController(org.jmonks.batchserver.framework.common.StatusCode controllerExitStatus) { } } --- NEW FILE: JobManagerMBean.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.controller.*; /** * <p> * This standard MBean, enables the controller to implementat management methods. * </p> * @author : Suresh Pragada * @versio 1.0 */ public interface JobManagerMBean { /** * Returns the status of the job. These statuses are defined as constants in JobManagerMBean. * * @return Returns the job status. */ public org.jmonks.batchserver.framework.mgmtmntr.JobStatus getJobStatus(); /** * Controller should stop its processing as soon this method call has been received. If the restart flag is true, it persist the controller to the repository. * * @param restart Tells whether job needs to be restarted or not. * * @return Returns whether job can be stopped or not. */ public boolean stop(boolean restart); /** * Controller should suspend its processing as soon as its receive this method call. * * @return Returns true, if controller can suspend the process, false otherwise. */ public boolean suspend(); /** * Controller should resume its processing as soon as it receive this method call. * * @return Returns true, if controller can resume the processing, false, otherwise. */ public boolean resume(); } --- NEW FILE: ThreadState.java --- package org.jmonks.batchserver.framework.mgmtmntr; /** * This represents the state of the thread. This gives the information like thread number, description and processing information. */ public class ThreadState { private String threadID; private String threadDescription; private Object processingInfo; public ThreadState() { } } --- NEW FILE: MgmtMntrManager.java --- package org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.controller.JobController; import org.jmonks.batchserver.framework.controller.*; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.common.*; /** * <p> * This class will define the methods needs to be implemented by the concrete classes of this manager. This provides the factory method to create the appropriate implementation based on the configuration in MgmtMntrConfig object. * </p> * @author : Suresh Pragada * @version 1.0 */ public abstract class MgmtMntrManager { private JobMonitorMBean mJobMonitor; private JobManagerMBean mJobManager; private MgmtMntrManager() { } /** * This factory method creates the correct implementation of MgmtMntrManager based on the configuration defines in framework-config.xml file. * This looks for the following configuration. * * <pre> * <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.DefaultMgmtMntrManager"> * <property key="port-range">15000-20000</property> * </mgmt-mntr-config> * * </pre> * * @param jobName Name of the job. * @param mgmtMntrConfig MgmtMntrConfig object represents the above show config block from the framework-config.xml file. * * @return Returns the MgmtMntrManager implemenation. */ public static org.jmonks.batchserver.framework.mgmtmntr.MgmtMntrManager getMgmtMntrManager(String jobName, org.jmonks.batchserver.framework.config.MgmtMntrConfig config) { return null; } /** * 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. */ public abstract void registerController(org.jmonks.batchserver.framework.controller.JobController controller); /** * Unregisters the controller from mbeans and shuts down the connector server and shuts down the mbean server and unregister information from common place. * * @param existStatus errorCode returned by controller to the Main class. */ public abstract void unregisterController(org.jmonks.batchserver.framework.common.StatusCode controllerExitStatus); /** * Returns the job name. * @return Returns the job name. */ public String getJobName() { return null; } } --- NEW FILE: JobStatus.java --- 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; } } |