[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/controller JobController.java,NON
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/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30411/controller Added Files: JobController.java Log Message: Submitting the class skeltons --- NEW FILE: JobController.java --- package org.jmonks.batchserver.framework.controller; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.mgmtmntr.JobMonitorMBean; import org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.mgmtmntr; import org.jmonks.batchserver.framework.mgmtmntr.*; import org.jmonks.batchserver.framework.common.*; /** * <p> * Job Controller is the important component, which actually creates and starts the proper components to process the job. Controller can defines its own logic (architecture) to process the jobs. This creates and manages the complete architecture it defines to process the job. * This provides a factory method which returns the appropriate controller component based on the provided controller config object. This implements the management and monitoring interfaces to make sure all the controller implementations are manageable and monitorable. * </p> * * @author : Suresh Pragada * @version 1.0 */ public abstract class JobController implements JobMonitorMBean, JobManagerMBean { private Main mMain; private JobController() { } /** * <p> * This factory method loads the required implementation of the controller based on the controllerConfig received. First it tries to look for the existence of controller with this jobName in repository (If job is stopped in middle through MgmtMntrManager using restart=true flag, this controller will be stopped and persisted in the repository). By default, if job is stopped in the middle it will be restarted. To override this behaviour special property needs to be sent as "job-controller-restart=false" in the additional configuration. If it is false, it calls the releaseController method on repository to clear its current state and create a new controller using the configuration defined in controllerConfig. * * @param jobName Name of the job to be started. * @param controllerConfig configuration object represents controller configuration. * * @return Returns the correct implementation of the controller. * </p> */ public static org.jmonks.batchserver.framework.controller.JobController getJobController(String jobName, org.jmonks.batchserver.framework.config.ControllerConfig config) { return null; } /** * Returns the controller configuration object. * * @return Returns the controller configuration object. */ public ControllerConfig getControllerConfig() { return mControllerConfig; } /** * This method will be called by Main to process the job. This returns the exit status of the job, which will be communicate to everyone. * * @return Returns the exit status of the job. */ public abstract org.jmonks.batchserver.framework.common.StatusCode process(); /** * Returns the job name. * * @return Returns the job name. */ public String getJobname() { return null; } public abstract int getExpectedRecordsCount(); /** * @see org.jmonks.batchserver.framework.JobMonitorMBean#getProcessedRecords() */ public abstract int getProcessedRecordsCount(); /** * @see org.jmonks.batchserver.framework.JobMonitorMBean#getThreadCount() */ public abstract String[] getThreadIDList(); /** * @see org.jmonks.batchserver.framework.JobMonitorMBean#getThreadState(int) */ public abstract org.jmonks.batchserver.framework.mgmtmntr.ThreadState getThreadState(String threadID); /** * @see org.jmonks.batchserver.framework.JobManagerMBean#getJobStatus() */ public abstract org.jmonks.batchserver.framework.mgmtmntr.JobStatus getJobStatus(); /** * @see org.jmonks.batchserver.framework.JobManagerMBean#stop(boolean) */ public abstract boolean stop(boolean restart); /** * @see org.jmonks.batchserver.framework.JobManagerMBean#suspend */ public abstract boolean suspend(); /** * @see org.jmonks.batchserver.framework.JobManagerMBean#resume */ public abstract boolean resume(); /** * This method would enable the controller to deserialize its state from the repository. * * @param inputStream Stream from which the controller needs to be recovered. */ public abstract void readObject(java.io.ObjectInputStream inputStream); /** * This method enables the controller to persist/serializes on its own. * * @param outputStream Persist/Serialize the state of the controller. */ public abstract void writeObject(java.io.ObjectOutputStream outputStream); } |