[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/management ProcessorState.java,NO
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-05-14 01:34:52
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3094 Modified Files: JobManager.java JobManagerMBean.java JobMonitor.java JobMonitorMBean.java Added Files: ProcessorState.java ProcessorStatus.java Removed Files: JobStatus.java ThreadState.java Log Message: no message Index: JobMonitorMBean.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobMonitorMBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobMonitorMBean.java 25 Mar 2006 19:29:57 -0000 1.1 --- JobMonitorMBean.java 14 May 2006 01:34:49 -0000 1.2 *************** *** 4,8 **** * <p> * JobMonitorMBean interface defines the methods to instrument the job being run ! * to find out the statistics of the job and to find out all the thread states * running in the controller. This follows the JMX standard MBean paradigm to define * name of the MBean and methods instrument the job. --- 4,8 ---- * <p> * JobMonitorMBean interface defines the methods to instrument the job being run ! * to find out the statistics of the job and to find out all the processor states * running in the controller. This follows the JMX standard MBean paradigm to define * name of the MBean and methods instrument the job. *************** *** 29,43 **** /** ! * 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 ThreadState getThreadState(String threadID); } --- 29,44 ---- /** ! * Returns the array of IDs assigned to be processors running under this controller. * ! * @return Returns the array of IDs being assigned by each processor. */ ! public String[] getProcessorIDList(); /** ! * Gets the state of the processor identified by the given processor ID. ! * This returns the state in a ProcessorState object. * ! * @return Returns the state of the requested processor. */ ! public ProcessorState getProcessorState(String processorID); } --- NEW FILE: ProcessorStatus.java --- package org.jmonks.batchserver.framework.management; /** * <p> * ProcessorStatus defines the statuses that processors can be in the system. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class ProcessorStatus { /** * Status indicates that processor is instantiated. */ public static ProcessorStatus INSTANTIATED = new ProcessorStatus("INSTANTIATED"); /** * Status indicates that processor is being initialized. */ public static ProcessorStatus INITIALIZING = new ProcessorStatus("INITIALIZING"); /** * Status indicates that processor is initailized. */ public static ProcessorStatus INITIALIZED = new ProcessorStatus("INITIALIZED"); /** * Status indicates that processor is running. */ public static ProcessorStatus RUNNING = new ProcessorStatus("RUNNING"); /** * Status indictes that processor is suspended. */ public static ProcessorStatus SUSPENDED = new ProcessorStatus("SUSPENDED"); /** * Status indicates the processor is stopped. */ public static ProcessorStatus STOPPED = new ProcessorStatus("STOPPED"); /** * Status indicates the processor is resumed. */ public static ProcessorStatus RESUMED = new ProcessorStatus("RESUMED"); /** * Status indicates the processor is being cleaned up. */ public static ProcessorStatus CLEANUP = new ProcessorStatus("CLEANUP"); /** * Status indicates the processor is finished. */ public static ProcessorStatus FINISHED = new ProcessorStatus("FINISHED"); /** * 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 ProcessorStatus(String statusID) { this.statusID=statusID; } /** * Returns the job status in string format. */ public String toString() { return this.statusID; } } Index: JobManagerMBean.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagerMBean.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JobManagerMBean.java 3 May 2006 22:11:18 -0000 1.3 --- JobManagerMBean.java 14 May 2006 01:34:49 -0000 1.4 *************** *** 6,44 **** /** * <p> ! * This standard MBean interface provodes the methods to instrument the ! * job controller. * </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 JobStatus getJobStatus(); /** ! * Controller should stop its processing as soon this method call has been received. * ! * @return Returns whether job has been stopped or not. */ ! public boolean stop(); /** ! * 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(); /** --- 6,56 ---- /** * <p> ! * This standard MBean interface provides the methods to instrument the ! * job controller and processors running under the job controller. * </p> ! * @author Suresh Pragada ! * @version 1.0 ! * @since 1.0 */ public interface JobManagerMBean { /** ! * Returns the status of the processor identified by the given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns the processor status. */ ! public ProcessorStatus getProcessorStatus(String processorID); /** ! * Controller should stop processing of the processor identified by the ! * given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor has been stopped, false otherwise. */ ! public boolean stop(String processorID); /** ! * Controller should suspend processing of the processor identified by the ! * give processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor has been suspended, false otherwise. */ ! public boolean suspend(String processorID); /** ! * Controller should resume processing of the processor identified by the ! * given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor can be resumed, false, otherwise. */ ! public boolean resume(String processorID); /** Index: JobMonitor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobMonitor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JobMonitor.java 28 Mar 2006 04:55:18 -0000 1.2 --- JobMonitor.java 14 May 2006 01:34:49 -0000 1.3 *************** *** 15,18 **** --- 15,19 ---- /** * <p> + * Implementation of job monitor mbean to instrument the job controller. * </p> * @author Suresh Pragada *************** *** 53,68 **** } /** ! * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getThreadIDList */ ! public String[] getThreadIDList() { ! return this.jobMonitor.getThreadIDList(); } /** ! * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getThreadState(java.lang.String) */ ! public ThreadState getThreadState(String threadID) { ! return this.jobMonitor.getThreadState(threadID); } } --- 54,69 ---- } /** ! * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getProcessorIDList */ ! public String[] getProcessorIDList() { ! return this.jobMonitor.getProcessorIDList(); } /** ! * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getProcessorState(java.lang.String) */ ! public ProcessorState getProcessorState(String processorID) { ! return this.jobMonitor.getProcessorState(processorID); } } --- ThreadState.java DELETED --- Index: JobManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JobManager.java 3 May 2006 22:11:18 -0000 1.3 --- JobManager.java 14 May 2006 01:34:49 -0000 1.4 *************** *** 38,83 **** { if(jobController==null) ! throw new IllegalArgumentException("job controller cannot be null to create the job monitor mbean."); this.jobManager=(JobManagerMBean)jobController; } /** ! * Controller should stop its processing as soon this method call has been received. * ! * @return Returns whether job has been stopped or not. */ ! public boolean stop() { ! return this.jobManager.stop() ; } /** ! * 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() { ! return this.jobManager.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() { ! return this.jobManager.resume(); } /** ! * Returns the status of the job. These statuses are defined as constants in JobManagerMBean. * ! * @return Returns the job status. */ ! public JobStatus getJobStatus() { ! return this.jobManager.getJobStatus(); } --- 38,94 ---- { if(jobController==null) ! throw new IllegalArgumentException("job controller cannot be null to create the job manager mbean."); this.jobManager=(JobManagerMBean)jobController; } /** ! * Controller should stop processing of the processor identified by the ! * given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor has been stopped, false otherwise. */ ! public boolean stop(String processorID) { ! return this.jobManager.stop(processorID) ; } /** ! * Controller should suspend processing of the processor identified by the ! * give processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor has been suspended, false otherwise. */ ! public boolean suspend(String processorID) { ! return this.jobManager.suspend(processorID); } /** ! * Controller should resume processing of the processor identified by the ! * given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns true, if processor can be resumed, false, otherwise. */ ! public boolean resume(String processorID) { ! return this.jobManager.resume(processorID); } /** ! * Returns the status of the processor identified by the given processor ID. * ! * @param processorID ID assigned to each processor. ! * ! * @return Returns the processor status. */ ! public ProcessorStatus getProcessorStatus(String processorID) { ! return this.jobManager.getProcessorStatus(processorID); } --- NEW FILE: ProcessorState.java --- package org.jmonks.batchserver.framework.management; /** * <p> * This represents the state of the processor(thread) running under the controller. * This gives the information like processor ID, description and * processing information. * </p> * @author Suresh pragada * @version 1.0 * @since 1.0 */ public class ProcessorState { /** * Holds the processor ID. */ private String processorID; /** * Holds the processor description. */ private String processorDescription; /** * Holds the processing information. This can be anything that client and server * can understand. */ private Object processingInfo; /** * Constructor to initialize the whole object at a time and make sure it is immutable. */ public ProcessorState(String processorID,String processorDescription,Object processingInfo) { this.processorID=processorID; this.processorDescription=processorDescription; this.processingInfo=processingInfo; } /** * Returns the processor ID. */ public String getProcessorID() { return this.processorID; } /** * Returns the processor description. */ public String getProcessorDescription() { return this.processorDescription; } /** * Returns the processor processing information. */ public Object getProcessingInfo() { return this.processingInfo; } /** * <p> * Returns the string representation of ProcessorState class in the format * <br> {ProcessorState [ID = value] [desc = value] [processingInfo = value]} * </p> * * @return Returns the string representation of ProcessorState. */ public String toString() { StringBuffer stringValue=new StringBuffer("{ProcessorState "); stringValue.append("[ID = " + this.processorID + "]"); stringValue.append("[desc = " + this.processorDescription + "]"); stringValue.append("[processingInfo = " + this.processingInfo + "]"); stringValue.append("}"); return stringValue.toString(); } } --- JobStatus.java DELETED --- |