batchserver-cvs Mailing List for Enterprise Batch Server (Page 19)
Brought to you by:
suresh_pragada
You can subscribe to this list here.
2006 |
Jan
|
Feb
(10) |
Mar
(159) |
Apr
(5) |
May
(52) |
Jun
(70) |
Jul
|
Aug
(28) |
Sep
(256) |
Oct
(38) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Suresh <sur...@us...> - 2006-04-05 22:22:54
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25437 Modified Files: JobManagementClient.java JobManager.java Added Files: JobNotification.java Log Message: no message Index: JobManagementClient.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagementClient.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobManagementClient.java 5 Apr 2006 20:54:45 -0000 1.1 --- JobManagementClient.java 5 Apr 2006 22:22:48 -0000 1.2 *************** *** 21,26 **** --- 21,28 ---- import javax.management.MBeanServerInvocationHandler; import javax.management.MalformedObjectNameException; + import javax.management.Notification; import javax.management.NotificationListener; import javax.management.ObjectName; + import javax.management.remote.JMXConnectionNotification; import javax.management.remote.JMXConnector; import org.apache.log4j.Logger; *************** *** 92,97 **** logger.info("New job has been found in the lookup = " + jobName); JMXConnector jmxConnector=this.jobConnectorHelper.createConnector(jobName); ! this.connectorMap.put(jobName, jmxConnector); ! logger.debug("Successfully added the job to connection map = " + jobName); } } --- 94,108 ---- logger.info("New job has been found in the lookup = " + jobName); JMXConnector jmxConnector=this.jobConnectorHelper.createConnector(jobName); ! if(jmxConnector==null) ! { ! logger.error("Unable to get the jmx connector for the job name = " + jobName); ! } ! else ! { ! JMXConnectionListener connectorListener=new JMXConnectionListener(jobName); ! jmxConnector.addConnectionNotificationListener(connectorListener, null, this); ! this.connectorMap.put(jobName, jmxConnector); ! logger.info("Successfully added the job to connection map = " + jobName); ! } } } *************** *** 338,340 **** --- 349,396 ---- return unregistered; } + + /** + * Notification listener listens for the jmx connector close notifications. + * This is to clear the entries from the connector map as soon as the connection + * has been closed. New listener will be created for each jmx conector. + * + * @author Suresh Pragada + * @version 1.0 + * @since 1.0 + */ + private class JMXConnectionListener implements NotificationListener + { + /** + * Name of the job this listener is associated with. + */ + private String jobName; + + /** + * Initializes with the job name. + */ + private JMXConnectionListener(String jobName) + { + if(jobName==null) + throw new IllegalArgumentException("job name cannot be null to create jmx connection listener."); + this.jobName=jobName; + } + + /** + * Listens for the connector closed notifications and removes the job name + * entry from the connector map. + */ + public void handleNotification(Notification notification, Object obj) + { + if(JMXConnectionNotification.CLOSED.equalsIgnoreCase(notification.getType())) + { + logger.info("jmx connector has been closed for the job name = " + jobName); + connectorMap.remove(jobName); + } + else + { + logger.trace("Received notification from jmx connector. But, no " + + "action has been taken. = " + jobName + " Notification info = " + notification); + } + } + } } Index: JobManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobManager.java 28 Mar 2006 04:55:18 -0000 1.1 --- JobManager.java 5 Apr 2006 22:22:48 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- package org.jmonks.batchserver.framework.management; + import javax.management.NotificationBroadcasterSupport; import org.apache.log4j.Level; import org.jmonks.batchserver.framework.controller.JobController; *************** *** 22,26 **** * @since 1.0 */ ! public class JobManager implements JobManagerMBean { private JobManagerMBean jobManager=null; --- 23,28 ---- * @since 1.0 */ ! public class JobManager extends NotificationBroadcasterSupport ! implements JobManagerMBean { private JobManagerMBean jobManager=null; --- NEW FILE: JobNotification.java --- /* * JobNotification.java * * Created on April 5, 2006, 5:08 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; import java.util.Calendar; import javax.management.Notification; /** * Notification to send the specified job information and define the various * notification types. * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JobNotification extends Notification { /** * Name of the job this notification belongs to. */ private String jobName=null; /** * Used to generate the sequence number. */ private static int sequence=1; /** * Notification type specifies that the job got finished. */ public static final String JOB_FINISHED = "job.status.finished"; /** * Creates a new instance of JobNotification */ public JobNotification(String jobName,String type,Object source,String message) { super(type,source,JobNotification.sequence++,Calendar.getInstance().getTimeInMillis(),message); if(jobName==null) throw new IllegalArgumentException("job name cannot be null to create the job notification."); this.jobName=jobName; } /** * Gets the job name; */ public String getJobName() { return this.jobName; } /** * <p> * Returns the string representation of JobNotification class in the format * <br> {JobNotification [jobName = value] [rest = value] } * </p> * * @return Returns the string representation of JobNotification. */ public String toString() { StringBuffer stringValue=new StringBuffer("{JobNotification "); stringValue.append("[jobName = " + this.jobName + "]"); stringValue.append("[rest = " + super.toString() + "]"); stringValue.append("}"); return stringValue.toString(); } } |
From: Suresh <sur...@us...> - 2006-04-05 20:54:52
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27676 Added Files: JobManagementClient.java Log Message: no message --- NEW FILE: JobManagementClient.java --- /* * JobManagementClient.java * * Created on April 5, 2006, 12:05 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.management.InstanceNotFoundException; import javax.management.ListenerNotFoundException; import javax.management.MBeanServerConnection; import javax.management.MBeanServerInvocationHandler; import javax.management.MalformedObjectNameException; import javax.management.NotificationListener; import javax.management.ObjectName; import javax.management.remote.JMXConnector; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; /** * * Provides the high level services to all management clients abstracting the * JMX connector details. * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JobManagementClient { /** * Singleton management client instance. */ private final static JobManagementClient jobManagementClient=new JobManagementClient(); /** * Variable holds the Job connector helper class. */ private JobConnectorHelper jobConnectorHelper=null; /** * Map holds all the jobs currently running. Job names will be keys and JMX Connector * objects will be values in this map. */ private Map connectorMap=new HashMap(); private static Logger logger=Logger.getLogger(JobManagementClient.class); /** * Creates a new instance of JobManagementClient * * @throws ConfigurationException If unable to get the JobConnectorHelper reference. */ private JobManagementClient() { this.jobConnectorHelper=JobConnectorHelper.getJobConnectorHelper(); if(jobConnectorHelper==null) throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "could not get the reference to job connector helper class."); } /** * Returns the singleton management client instance. */ public static JobManagementClient getJobManagementClient() { return jobManagementClient; } /** * Returns the list of running jobs as an array. * * @return Returns the list of running jobs as an array. In case of 0 jobs it returns * array of the size 0. */ public List getRunningJobs() { logger.trace("Entering getRunningJobs"); List runningJobList=null; List jobList=this.jobConnectorHelper.getRegisteredJobList(); for(Iterator iterator=jobList.iterator();iterator.hasNext();) { String jobName=(String)iterator.next(); if(!this.connectorMap.containsKey(jobName)) { logger.info("New job has been found in the lookup = " + jobName); JMXConnector jmxConnector=this.jobConnectorHelper.createConnector(jobName); this.connectorMap.put(jobName, jmxConnector); logger.debug("Successfully added the job to connection map = " + jobName); } } runningJobList=(List)this.connectorMap.keySet(); logger.trace("Exiting getRunningJobs"); return runningJobList; } /** * Gets the management bean of the requested job. If the requested jobname * cannot be found in the lookup, it returns null. * * @param jobName Name of the job. * * @return Returns the manager bean to control the job. * * @throws IllegalArgumentException If jobName is null. */ public JobManagerMBean getManagementBean(String jobName) { logger.trace("Entering getManagementBean " + jobName); if(jobName==null || "".equals(jobName)) throw new IllegalArgumentException("Job name cannot be null to get the manager bean reference."); JobManagerMBean managerBean=null; if(this.connectorMap.containsKey(jobName)) { JMXConnector jmxConnector=(JMXConnector)this.connectorMap.get(jobName); if(jmxConnector==null) { this.connectorMap.remove(jobName); } else { try { MBeanServerConnection mbeanServerConnection=jmxConnector.getMBeanServerConnection(); ObjectName managerBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MANAGER_MBEAN_NAME); managerBean=(JobManagerMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServerConnection, managerBeanObjectName, JobManagerMBean.class, false); } catch(MalformedObjectNameException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } } } else managerBean=null; logger.trace("Exiting getManagementBean"); return managerBean; } /** * Gets the monitor bean of the requested job. If the requested jobname * cannot be found in the lookup, it returns null. * * @param jobName Name of the job. * * @return Returns the monitor bean to control the job. * * @throws IllegalArgumentException If jobName is null. */ public JobMonitorMBean getMonitorMBean(String jobName) { logger.trace("Entering getMonitorMBean " + jobName); if(jobName==null || "".equals(jobName)) throw new IllegalArgumentException("Job name cannot be null to get the monitor bean reference."); JobMonitorMBean monitorBean=null; if(this.connectorMap.containsKey(jobName)) { JMXConnector jmxConnector=(JMXConnector)this.connectorMap.get(jobName); if(jmxConnector==null) { this.connectorMap.remove(jobName); } else { try { MBeanServerConnection mbeanServerConnection=jmxConnector.getMBeanServerConnection(); ObjectName monitorBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MONITOR_MBEAN_NAME); monitorBean=(JobMonitorMBean)MBeanServerInvocationHandler.newProxyInstance(mbeanServerConnection, monitorBeanObjectName, JobMonitorMBean.class, false); } catch(MalformedObjectNameException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } } } else monitorBean=null; logger.trace("Exiting getMonitorMBean"); return monitorBean; } /** * Registers the given listener to all the mbeans of given job. * * @param jobName Name of the job that listener needs to be attached. * @param notificationListener Listener object that is interested in the notifications. * * @return Returns true, if it could register the listener, false, otherwise. */ public boolean registerListener(String jobName,NotificationListener notificationListener) { logger.trace("Entering registerListener " + jobName); if(jobName==null || "".equals(jobName)) throw new IllegalArgumentException("job name cannot be null to register the listener."); if(notificationListener==null) throw new IllegalArgumentException("notification listener cannot be null to register the listener."); boolean registered=false; if(this.connectorMap.containsKey(jobName)) { JMXConnector jmxConnector=(JMXConnector)this.connectorMap.get(jobName); if(jmxConnector==null) { this.connectorMap.remove(jobName); } else { try { MBeanServerConnection mbeanServerConnection=jmxConnector.getMBeanServerConnection(); ObjectName monitorBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MONITOR_MBEAN_NAME); ObjectName managerBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MANAGER_MBEAN_NAME); mbeanServerConnection.addNotificationListener(monitorBeanObjectName,notificationListener, null, null); mbeanServerConnection.addNotificationListener(managerBeanObjectName,notificationListener, null, null); registered=true; } catch(InstanceNotFoundException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(MalformedObjectNameException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } } } else registered=false; logger.trace("Exiting registerListener = " + registered); return registered; } /** * Unregisters the given listener from all the mbeans of given job. * * @param jobName Name of the job that listener needs to be detached. * @param notificationListener Listener object that needs to be detached from all the mbeans. * * @return Returns true, if it could unregister the listener, false, otherwise. */ public boolean unregisterListener(String jobName,NotificationListener notificationListener) { logger.trace("Entering unregisterListener " + jobName); if(jobName==null || "".equals(jobName)) throw new IllegalArgumentException("job name cannot be null to unregister the listener."); if(notificationListener==null) throw new IllegalArgumentException("notification listener cannot be null to unregister the listener."); boolean unregistered=false; if(this.connectorMap.containsKey(jobName)) { JMXConnector jmxConnector=(JMXConnector)this.connectorMap.get(jobName); if(jmxConnector==null) { this.connectorMap.remove(jobName); } else { try { MBeanServerConnection mbeanServerConnection=jmxConnector.getMBeanServerConnection(); ObjectName monitorBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MONITOR_MBEAN_NAME); ObjectName managerBeanObjectName= new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MANAGER_MBEAN_NAME); mbeanServerConnection.removeNotificationListener(monitorBeanObjectName,notificationListener); mbeanServerConnection.removeNotificationListener(managerBeanObjectName,notificationListener); unregistered=true; } catch(ListenerNotFoundException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(InstanceNotFoundException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(MalformedObjectNameException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } } } else unregistered=false; logger.trace("Exiting unregisterListener"); return unregistered; } } |
From: Suresh <sur...@us...> - 2006-03-28 04:58:06
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3231 Modified Files: Db4oJobControllerHolder.java Db4oJobControllerHolderPredicate.java Db4oJobDataTransferHolder.java Db4oJobMgmtMntrInfoHolder.java Db4oJobMgmtMntrInfoHolderPredicate.java Db4oJobStatisticsPredicate.java Db4oRepository.java Log Message: no message Index: Db4oJobControllerHolder.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobControllerHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobControllerHolder.java 16 Mar 2006 14:16:40 -0000 1.1 --- Db4oJobControllerHolder.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 21,25 **** * @since 1.0 */ ! class Db4oJobControllerHolder { /** --- 21,25 ---- * @since 1.0 */ ! public class Db4oJobControllerHolder { /** Index: Db4oJobControllerHolderPredicate.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobControllerHolderPredicate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobControllerHolderPredicate.java 17 Mar 2006 05:13:25 -0000 1.1 --- Db4oJobControllerHolderPredicate.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 21,25 **** * @since 1.0 */ ! class Db4oJobControllerHolderPredicate extends Predicate { /** --- 21,25 ---- * @since 1.0 */ ! public class Db4oJobControllerHolderPredicate extends Predicate { /** Index: Db4oRepository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oRepository.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Db4oRepository.java 22 Mar 2006 14:20:45 -0000 1.4 --- Db4oRepository.java 28 Mar 2006 04:57:57 -0000 1.5 *************** *** 353,356 **** --- 353,381 ---- /** + * @see org.jmonks.batchserver.framework.repository.Repository#getAllRegisteredMgmtMntrInfo() + */ + public Map getAllRegisteredMgmtMntrInfo() + { + logger.trace("Entering getAllRegisteredMgmtMntrInfo"); + + Map registeredJobs=new HashMap(); + if(container==null) + { + // ObjectContainer is not initialized properly. Return the empty map. + } + else + { + ObjectSet mgmtMntrInfoHolderResultSet=container.query(Db4oJobMgmtMntrInfoHolder.class); + while(mgmtMntrInfoHolderResultSet.hasNext()) + { + Db4oJobMgmtMntrInfoHolder mgmtMntrInfoHolder=((Db4oJobMgmtMntrInfoHolder)mgmtMntrInfoHolderResultSet.next()); + registeredJobs.put(mgmtMntrInfoHolder.getJobName(), mgmtMntrInfoHolder.getMgmtMntrInfo()); + } + } + logger.trace("Exiting getAllRegisteredMgmtMntrInfo"); + return registeredJobs; + } + + /** * * @see org.jmonks.batchserver.framework.repository.Repository#logStatistics(org.jmonks.batchserver.framework.JobStatistics) *************** *** 494,498 **** logger.trace("Exiting releaseController"); return released; ! } ! } --- 519,522 ---- logger.trace("Exiting releaseController"); return released; ! } } Index: Db4oJobMgmtMntrInfoHolder.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobMgmtMntrInfoHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobMgmtMntrInfoHolder.java 17 Mar 2006 05:13:25 -0000 1.1 --- Db4oJobMgmtMntrInfoHolder.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 19,23 **** * @since 1.0 */ ! class Db4oJobMgmtMntrInfoHolder { /** --- 19,23 ---- * @since 1.0 */ ! public class Db4oJobMgmtMntrInfoHolder { /** Index: Db4oJobMgmtMntrInfoHolderPredicate.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobMgmtMntrInfoHolderPredicate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobMgmtMntrInfoHolderPredicate.java 17 Mar 2006 05:13:25 -0000 1.1 --- Db4oJobMgmtMntrInfoHolderPredicate.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 21,25 **** * @since 1.0 */ ! class Db4oJobMgmtMntrInfoHolderPredicate extends Predicate { /** --- 21,25 ---- * @since 1.0 */ ! public class Db4oJobMgmtMntrInfoHolderPredicate extends Predicate { /** Index: Db4oJobStatisticsPredicate.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobStatisticsPredicate.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobStatisticsPredicate.java 17 Mar 2006 05:13:25 -0000 1.1 --- Db4oJobStatisticsPredicate.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 22,26 **** * @since 1.0 */ ! class Db4oJobStatisticsPredicate extends Predicate { /** --- 22,26 ---- * @since 1.0 */ ! public class Db4oJobStatisticsPredicate extends Predicate { /** Index: Db4oJobDataTransferHolder.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/db4o/Db4oJobDataTransferHolder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Db4oJobDataTransferHolder.java 17 Mar 2006 05:13:25 -0000 1.1 --- Db4oJobDataTransferHolder.java 28 Mar 2006 04:57:57 -0000 1.2 *************** *** 21,25 **** * @since 1.0 */ ! class Db4oJobDataTransferHolder { /** --- 21,25 ---- * @since 1.0 */ ! public class Db4oJobDataTransferHolder { /** |
From: Suresh <sur...@us...> - 2006-03-28 04:56:27
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2591 Modified Files: Repository.java Log Message: no message Index: Repository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository/Repository.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Repository.java 22 Mar 2006 14:20:45 -0000 1.3 --- Repository.java 28 Mar 2006 04:56:24 -0000 1.4 *************** *** 201,204 **** --- 201,213 ---- */ public abstract boolean unregisterJobMgmtMntrInfo(String jobName); + + /** + * Gets all the management and monitoring information registered in the repository + * as a map, where jobname represents the key and management and monitoring information as value. + * + * @return Returns the map contains the job names as keys and management and + * monitoring information as values. + */ + public abstract Map getAllRegisteredMgmtMntrInfo(); /** |
From: Suresh <sur...@us...> - 2006-03-28 04:56:06
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2222 Added Files: JMXMPConnectorHelper.java RepositoryJMXMPConnectorHelper.java Removed Files: JMXMPJobConnectorServerHelper.java RepositoryJMXMPJobConnectorServerHelper.java Log Message: no message --- NEW FILE: RepositoryJMXMPConnectorHelper.java --- package org.jmonks.batchserver.framework.management.jmxmp; import java.io.IOException; import java.net.MalformedURLException; import java.util.HashMap; import java.util.List; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.JobContext; /** * <p> * This connector is based on JMX Messaging protocol and uses the framework * reposiotry as the lookup location to register and unregister the JMX Service URL. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class RepositoryJMXMPConnectorHelper extends JMXMPConnectorHelper { private static Logger logger=Logger.getLogger(RepositoryJMXMPConnectorHelper.class); /** * @see org.jmonks.batchserver.framework.management.JobConnectorHelper@init(java.util.Map) */ public void init(java.util.Map configProps) { logger.trace("Entering init") ; /** * Because this uses the repository defined for this framework as the * lookup location, this implementation does not require any properties * in configuration file to initialize the lookup location. */ logger.trace("Exiting init") ; } /** * Registers the jmx connector server with the given job name in the repository * defined for this framework. * * @param jobName Name of the job to be used in the registration. * @param jmxConnectorServer JMX connector server identifies where all the manager and montiro mbeans are configured. * * @return Returns true, if it successfully registred in repository, false, otherwise. * * @throws IllegalArgumentException If job name paramter or jmxConnectorServer parameter is null. */ public boolean registerConnectorServer(String jobName,JMXConnectorServer jmxConnectorServer) { logger.trace("Entering registerConnectorServer") ; if(jobName==null) throw new IllegalArgumentException("job name cannot be null to registerd jmx service url."); if(jmxConnectorServer==null) throw new IllegalArgumentException("jmx connector server cannot be null to registerd jmx connector server."); JMXServiceURL jmxServiceURL=jmxConnectorServer.getAddress(); boolean registered=JobContext.getReposiotry().registerJobMgmtMntrInfo(jobName, jmxServiceURL.toString()); logger.debug(jobName + " with the service url " + jmxServiceURL.toString() + " registered in repository = " + registered); logger.trace("Exiting registerConnectorServer") ; return registered; } /** * Unregisters the jmx connector server registered in repository with the given * job name. * * @param jobName Name of the job the connector server registered with. * * @return Returns true, if it successfully unregistered, false otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public boolean unregisterConnectorServer(String jobName) { logger.trace("Entering unregisterConnectorServer"); if(jobName==null) throw new IllegalArgumentException("job name cannot be null to unregister the service url."); boolean unregistered=JobContext.getReposiotry().unregisterJobMgmtMntrInfo(jobName); logger.debug(jobName + " mgmt and mntr information unregistered = " + unregistered); logger.trace("Exiting unregisterConnectorServer") ; return unregistered; } /** * Gets all the job names registered in the repository as a list. * * @return Returns the list of all the job names registered in repository. */ public List getRegisteredJobList() { return (List)JobContext.getReposiotry().getAllRegisteredMgmtMntrInfo().keySet(); } /** * Returns the JMX connector client for the given job name. * * @return Returns the JXM connector client for the given job name, * null, if it doesnt find or could not create the JMX connector client. * * @throws IllegalArgumentException If job name argument is null. */ public JMXConnector createConnector(String jobName) { if(jobName==null) throw new IllegalArgumentException("job name cannot be null to create the connector."); String serviceURL=(String)JobContext.getReposiotry().lookupJobMgmtMntrInfo(jobName); JMXConnector jmxConnector=null; if(serviceURL==null) jmxConnector=null; else { try { JMXServiceURL jmxServiceURL=new JMXServiceURL(serviceURL); jmxConnector=JMXConnectorFactory.newJMXConnector(jmxServiceURL, new HashMap()); } catch(MalformedURLException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } } return jmxConnector; } } --- RepositoryJMXMPJobConnectorServerHelper.java DELETED --- --- NEW FILE: JMXMPConnectorHelper.java --- /* * JMXMPConnectorHelper.java * * Created on March 22, 2006, 9:27 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management.jmxmp; import java.io.IOException; import java.net.MalformedURLException; import java.util.HashMap; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServerFactory; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.management.JobConnectorHelper; /** * <p> * JMXMPConnectorHelper creates the JMX connector server based on the JMX Messaging * protocol and leaves the lookup location details to the class going to implement this * abstract class. The machine the job being run will be used as the host name and * the port will be selected automatically by the JMX connector server factory. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public abstract class JMXMPConnectorHelper extends JobConnectorHelper { private static Logger logger=Logger.getLogger(JMXMPConnectorHelper.class); /** * JMX Messaging Protocol URL to be used to create the connector server. */ private static final String JMXMP_SERVICE_URL = "service:jmx:jmxmp://"; /** * Creates the JMX connector server based on JMX Messaging protocol. This does * not defined the host name and port name in the URL. So, the machine job * being run will be used as the host and port will be automatically choosen. * * @return Returns the JMX connector server, null, if it cannot create the connector server. */ public JMXConnectorServer createConnectorServer() { JMXServiceURL jmxServiceURL=null; JMXConnectorServer jmxConnectorServer=null; try { jmxServiceURL=new JMXServiceURL(JMXMPConnectorHelper.JMXMP_SERVICE_URL); jmxConnectorServer=JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, new HashMap(), null); } catch(MalformedURLException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } return jmxConnectorServer; } } --- JMXMPJobConnectorServerHelper.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-28 04:55:22
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2031 Modified Files: JobManagementAgent.java JobManagerMBean.java JobMonitor.java Added Files: JobConnectorHelper.java JobManager.java Removed Files: JobConnectorServerHelper.java Log Message: no message --- JobConnectorServerHelper.java DELETED --- --- NEW FILE: JobConnectorHelper.java --- /* * JobConnectorHelper.java * * Created on March 24, 2006, 8:04 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; import java.util.List; import java.util.Map; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorServer; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.config.FrameworkConfig; /** * <p> * JobConnectorHelper defines the helper methods will be used in creating the * JMX connector server, registering and unregistering the JMX connector server * in lookup location and querying the registerd jobs in look up location and * creating the JMX connector clients. * Because of many possible implementations available in creating * the JMX connector server and lookup locations, this class defines the methods * to choose their own implementations. Mainly, Agent and client looks for the following * information and activities from the concrete implementations of the connector * helper class. * <br> * <ul> * <li>Create the JMX connector server. * <li>Register the given the JMX connector server in the lookup location with the given jobname. * <li>Unregister the JMX connector server available in lookup location with the given jobname. * <li>Get all the registered jobs in look up location as list. * <li>Get the JMX connector from the look up location for the requested job name. * </ul> * <br> * This class provides the factory method to return the configured JobConnectorHelper * instance by looking at the framework configuration and make sure only one * instance will be created for the job(jvm). * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public abstract class JobConnectorHelper { private static Logger logger=Logger.getLogger(JobConnectorHelper.class); /** * Singleton job connector helper instance. */ private static JobConnectorHelper jobConnectorHelper=null; /** * This factory method creates the correct implementation of JobConnectorHelper * based on the configuration defined in framework-config.xml file. * This looks for the following configuration and uses the class name provided * at the job-connector-helper-class-name attribute to create the helper * instance. * <br> * <pre> * <job-connector-config job-connector-helper-class-name="org.jmonks.batchserver.framework.management.jmxmp.repository.RepositoryJMXMPConnectorHelper"> * <property key="mgmt-mntr-config-key">mgmt-mntr-config-value</property> * </job-connector-config> * </pre> * * @return Returns the JobConnectorHelper implemenation. * * @throws ConfigurationException If configuration could not be found or * implementation class cannot be accessed or instantiated. */ public static synchronized JobConnectorHelper getJobConnectorHelper() { logger.trace("Entering getJobConnectorHelper"); if(jobConnectorHelper!=null) { FrameworkConfig.JobConnectorConfig jobConnectorConfig=FrameworkConfig.getInstance().getJobConnectorConfig(); if(jobConnectorConfig==null) throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "job connector configuration is not configured in framework configuration"); String jobConnectorHelperClassName=jobConnectorConfig.getJobConnectorHelperClassName(); logger.trace("Job connector helper class name = " + jobConnectorHelperClassName); try { jobConnectorHelper=(JobConnectorHelper)Class.forName(jobConnectorHelperClassName).newInstance(); jobConnectorHelper.init(jobConnectorConfig.getJobConnectorConfigProperties()); } catch(ClassNotFoundException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } catch(InstantiationException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } catch(IllegalAccessException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } } logger.trace("Exiting getJobConnectorHelper"); return jobConnectorHelper; } /** * This method will be called after instantiating the JobConnectorHelper to * initialize JobConnectorHelper with the properties needed to create JMX connector server * and initialize the lookup location needed to register and unregister the JMX connector servers. * * @param configProps Properties defined for this connector server as a map. * * @throws ConfigurationException If required properties for this connector server are missing. */ protected abstract void init(Map configProps); /** * Creates the JMX connector server based on the desired connector protocol. * * @return Returns the JMX connector server, null, if helper cannot create the connector server. */ public abstract JMXConnectorServer createConnectorServer(); /** * Registers the jmx connector server with the given job name in the desired lookup location. * * @param jobName Name of the job to be used in the registration. * @param jmxConnectorServer JMX connector server where all the manager and monnitor mbeans are configured. * * @return Returns true, if it successfully registred in lookup location, false, otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public abstract boolean registerConnectorServer(String jobName,JMXConnectorServer connectorServer); /** * Unregisters the jmx connector server registered in desired lookup location with the given * job name. * * @param Name of the job by which jmx connector server has been registered with. * * @return Returns true, if it successfully unregistered, false otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public abstract boolean unregisterConnectorServer(String jobName); /** * Gets all the job names registered in the lookup location. * * @return Returns the list of all the job names registered in lookup location. */ public abstract List getRegisteredJobList(); /** * Returns the JMX connector client for the given job name. * * @return Returns the JXM connector client for the given job name, * null, if it doesnt find or could not create the JMX connector client. */ public abstract JMXConnector createConnector(String jobName); } Index: JobManagerMBean.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagerMBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobManagerMBean.java 25 Mar 2006 19:29:57 -0000 1.1 --- JobManagerMBean.java 28 Mar 2006 04:55:18 -0000 1.2 *************** *** 1,8 **** package org.jmonks.batchserver.framework.management; /** * <p> ! * This standard MBean, enables the controller to implementat management methods. * </p> * @author : Suresh Pragada --- 1,11 ---- package org.jmonks.batchserver.framework.management; + import org.apache.log4j.Level; + /** * <p> ! * This standard MBean interface provodes the methods to instrument the ! * job controller. * </p> * @author : Suresh Pragada *************** *** 16,20 **** * @return Returns the job status. */ ! public org.jmonks.batchserver.framework.management.JobStatus getJobStatus(); /** --- 19,23 ---- * @return Returns the job status. */ ! public JobStatus getJobStatus(); /** *************** *** 40,42 **** --- 43,64 ---- */ public boolean resume(); + + /** + * Gets the log level of the given logger name. + * + * @param loggerName Name of the logger wants to find the log level. + * + * @return Returns the log level, null, if the given logger could not be found. + */ + public Level getLogLevel(String loggerName); + + /** + * Changes the log level for the requested logger name with the given log level. + * + * @param loggerName Logger name needs to be modified. + * @param newLogLevel new logging level. + * + * @return Returns true, if log level could be changed, false, otherwise. + */ + public boolean changeLogLevel(String loggerName,Level newLogLevel); } Index: JobManagementAgent.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobManagementAgent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobManagementAgent.java 25 Mar 2006 19:29:57 -0000 1.1 --- JobManagementAgent.java 28 Mar 2006 04:55:18 -0000 1.2 *************** *** 1,12 **** package org.jmonks.batchserver.framework.management; import java.io.IOException; ! import java.util.HashMap; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.remote.JMXConnectorServer; - import javax.management.remote.JMXConnectorServerFactory; - import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.common.StatusCode; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.controller.JobController; --- 1,14 ---- package org.jmonks.batchserver.framework.management; import java.io.IOException; ! import javax.management.InstanceAlreadyExistsException; ! import javax.management.MBeanRegistrationException; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; + import javax.management.MalformedObjectNameException; + import javax.management.NotCompliantMBeanException; + import javax.management.ObjectName; import javax.management.remote.JMXConnectorServer; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.common.ErrorCode; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.controller.JobController; *************** *** 16,25 **** * <p> * JobManagementAgent defines the methods to start and stop the JMX Agent for this job. ! * Only one agent for the job will be created and this agent will be initialized * when you request to get the job management agent instance. Agent service can be * started and stopped only once during the life cycle of the job. This uses ! * the JobConnectorServerHelper to take the help in creating different JMX * connector servers and different lookup locations to ! * register and unregister jmx service urls. * </p> * @author Suresh Pragada --- 18,27 ---- * <p> * JobManagementAgent defines the methods to start and stop the JMX Agent for this job. ! * Only one agent will be created for a job and this agent will be initialized * when you request to get the job management agent instance. Agent service can be * started and stopped only once during the life cycle of the job. This uses ! * the JobConnectorHelper to take the help in creating different JMX * connector servers and different lookup locations to ! * register and unregister jmx connector servers. * </p> * @author Suresh Pragada *************** *** 50,57 **** private JMXConnectorServer jmxConnectorServer=null; /** ! * Job connector server helper instance. This defines the implementation * and lookup location of the JMX connector server. */ ! private JobConnectorServerHelper jobConnectorServerHelper=null; /** * Name of the job this agent configured for. --- 52,59 ---- private JMXConnectorServer jmxConnectorServer=null; /** ! * Job connector helper instance. This defines the implementation * and lookup location of the JMX connector server. */ ! private JobConnectorHelper jobConnectorHelper=null; /** * Name of the job this agent configured for. *************** *** 77,83 **** private JobManagementAgent() { ! this.jobConnectorServerHelper=JobConnectorServerHelper.getJobConnectorServerHelper(); ! if(jobConnectorServerHelper==null) ! throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "could not get the reference to job connector server helper class."); } --- 79,85 ---- private JobManagementAgent() { ! this.jobConnectorHelper=JobConnectorHelper.getJobConnectorHelper(); ! if(jobConnectorHelper==null) ! throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "could not get the reference to job connector helper class."); } *************** *** 98,103 **** * <li>Creates the job manager and job monitor mbeans by passing the controller reference. * <li>Creates the MBeanServer and registers these two MBeans. ! * <li>Create the JMX Connector server based on the service url got from the connector server helper implementation. ! * <ii>Registers JMX Connector server service url in the lookup location defined by connector server helper implementation. * <li>Marks the started flag as true to indicate that agent has been started. * </ul> --- 100,105 ---- * <li>Creates the job manager and job monitor mbeans by passing the controller reference. * <li>Creates the MBeanServer and registers these two MBeans. ! * <li>Create the JMX Connector server based connector helper implementation. ! * <ii>Registers JMX Connector server in the lookup location defined by connector helper implementation. * <li>Marks the started flag as true to indicate that agent has been started. * </ul> *************** *** 132,143 **** { MBeanServer mbeanServer=MBeanServerFactory.createMBeanServer(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME); ! JMXServiceURL jmxServiceURL=this.jobConnectorServerHelper.getServiceURL(); ! jmxConnectorServer=JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, new HashMap(), mbeanServer); ! logger.debug("Got the jmx connector server from the implementation"); /** * Create the mbeans and register them with this mbean server. */ ! boolean registered=this.jobConnectorServerHelper.registerServiceURL(jobName,jmxServiceURL); if(registered) { --- 134,166 ---- { MBeanServer mbeanServer=MBeanServerFactory.createMBeanServer(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME); ! this.jmxConnectorServer=this.jobConnectorHelper.createConnectorServer(); ! if(this.jmxConnectorServer==null) ! { ! logger.error("Unable to get the jmx connector server from job connector helper implementation."); ! throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "Unable to get the jmx connector server from job connector helper implementation."); ! } ! else ! { ! logger.debug("Got the jmx connector server from the implementation"); ! } ! JobMonitorMBean monitorBean=new JobMonitor(jobController); ! JobManagerMBean managerBean=new JobManager(jobController); ! ! ObjectName connectorServerObjectName= ! new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType=JMXConnectorServer"); ! ObjectName monitorBeanObjectName= ! new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MONITOR_MBEAN_NAME); ! ObjectName managerBeanObjectName= ! new ObjectName(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME+":jobName="+jobName+",objectType="+JobManagementAgent.JOB_MANAGER_MBEAN_NAME); ! ! mbeanServer.registerMBean(this.jmxConnectorServer, connectorServerObjectName); ! mbeanServer.registerMBean(monitorBean, monitorBeanObjectName); ! mbeanServer.registerMBean(managerBean, managerBeanObjectName); ! /** * Create the mbeans and register them with this mbean server. */ ! boolean registered=this.jobConnectorHelper.registerConnectorServer(jobName,this.jmxConnectorServer); if(registered) { *************** *** 146,153 **** else { this.started=false; } } ! catch(IOException exception) { exception.printStackTrace(); --- 169,192 ---- else { + logger.error("Unable to register the jmx connector server using job connector helper"); this.started=false; } } ! catch(MalformedObjectNameException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! } ! catch(InstanceAlreadyExistsException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! } ! catch(MBeanRegistrationException exception) ! { ! exception.printStackTrace(); ! logger.error(exception.getMessage(),exception); ! } ! catch(NotCompliantMBeanException exception) { exception.printStackTrace(); *************** *** 155,158 **** --- 194,198 ---- } + logger.trace("Exiting start"); return this.started; *************** *** 166,170 **** * * ! * @param existStatus errorCode returned by controller to the Main class. * * @return Returns true, if agent could be stopped properly, false otherwise. --- 206,210 ---- * * ! * @param exitCode errorCode returned by controller to the Main class. * * @return Returns true, if agent could be stopped properly, false otherwise. *************** *** 173,177 **** * @throws IllegalStateException If agent is already stopped or it not yet started. */ ! public boolean stop(StatusCode controllerExitStatus) { logger.trace("Entering stop"); --- 213,217 ---- * @throws IllegalStateException If agent is already stopped or it not yet started. */ ! public boolean stop(ErrorCode exitCode) { logger.trace("Entering stop"); *************** *** 182,193 **** throw new IllegalStateException("Job management agent has been stopped already."); ! if(controllerExitStatus==null) ! throw new IllegalArgumentException("controller exit status cannot be null to stop the server."); try { this.jmxConnectorServer.stop(); ! this.jobConnectorServerHelper.unregisterServiceURL(this.jobName); this.stopped=true; ! logger.debug("unregistered the jmx service url from lookup location"); } catch(IOException exception) --- 222,233 ---- throw new IllegalStateException("Job management agent has been stopped already."); ! if(exitCode==null) ! throw new IllegalArgumentException("controller exit code cannot be null to stop the server."); try { this.jmxConnectorServer.stop(); ! this.jobConnectorHelper.unregisterConnectorServer(this.jobName); this.stopped=true; ! logger.debug("unregistered the jmx connector server from lookup location"); } catch(IOException exception) Index: JobMonitor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/JobMonitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JobMonitor.java 25 Mar 2006 19:29:57 -0000 1.1 --- JobMonitor.java 28 Mar 2006 04:55:18 -0000 1.2 *************** *** 11,14 **** --- 11,16 ---- package org.jmonks.batchserver.framework.management; + import org.jmonks.batchserver.framework.controller.JobController; + /** * <p> *************** *** 23,32 **** /** ! * Creates a new instance of JobMonitorMBean b * * @param jobController Job controller implements this interface. */ public JobMonitor(JobController jobController) { this.jobMonitor=(JobMonitorMBean)jobController; } --- 25,38 ---- /** ! * Creates a new instance of JobMonitorMBean and initializes with job controller. * * @param jobController Job controller implements this interface. + * + * @throws IllegalArgumentException if input argument job controller is null. */ public JobMonitor(JobController jobController) { + if(jobController==null) + throw new IllegalArgumentException("job controller cannot be null to create the job monitor mbean."); this.jobMonitor=(JobMonitorMBean)jobController; } *************** *** 37,41 **** public int getExpectedRecordsCount() { ! return 0; } /** --- 43,47 ---- public int getExpectedRecordsCount() { ! return this.jobMonitor.getExpectedRecordsCount(); } /** *************** *** 44,48 **** public int getProcessedRecordsCount() { ! return 0; } /** --- 50,54 ---- public int getProcessedRecordsCount() { ! return this.jobMonitor.getProcessedRecordsCount(); } /** *************** *** 51,55 **** public String[] getThreadIDList() { ! return null; } /** --- 57,61 ---- public String[] getThreadIDList() { ! return this.jobMonitor.getThreadIDList(); } /** *************** *** 58,62 **** public ThreadState getThreadState(String threadID) { ! return null; } } --- 64,68 ---- public ThreadState getThreadState(String threadID) { ! return this.jobMonitor.getThreadState(threadID); } } --- NEW FILE: JobManager.java --- /* * JobManager.java * * Created on March 25, 2006, 11:14 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; import org.apache.log4j.Level; import org.jmonks.batchserver.framework.controller.JobController; /** * <p> * JobManager instruments the job controller for management purposes. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JobManager implements JobManagerMBean { private JobManagerMBean jobManager=null; /** * Creates a new instance of JobManagerMBean and initializes with job controller. * * @param jobController Job controller implements this interface. * * @throws IllegalArgumentException if input argument job controller is null. */ public JobManager(JobController jobController) { 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. 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) { return this.jobManager.stop(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() { 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(); } /** * Gets the log level of the given logger name. * * @param loggerName Name of the logger wants to find the log level. * * @return Returns the log level, null, if the given logger could not be found. */ public Level getLogLevel(String loggerName) { return this.jobManager.getLogLevel(loggerName); } /** * Changes the log level for the requested logger name with the given log level. * * @param loggerName Logger name needs to be modified. * @param newLogLevel new logging level. * * @return Returns true, if log level could be changed, false, otherwise. */ public boolean changeLogLevel(String loggerName, Level newLogLevel) { return this.jobManager.changeLogLevel(loggerName, newLogLevel); } } |
From: Suresh <sur...@us...> - 2006-03-28 04:54:25
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1540 Modified Files: PoolJobController.java Log Message: no message Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PoolJobController.java 25 Mar 2006 19:31:20 -0000 1.3 --- PoolJobController.java 28 Mar 2006 04:54:21 -0000 1.4 *************** *** 1,3 **** --- 1,4 ---- package org.jmonks.batchserver.framework.controller.pool; + import org.jmonks.batchserver.framework.common.ErrorCode; import org.jmonks.batchserver.framework.config.JobControllerConfig; import org.jmonks.batchserver.framework.controller.JobController; *************** *** 53,57 **** } ! public org.jmonks.batchserver.framework.common.StatusCode process() { --- 54,58 ---- } ! public ErrorCode process() { *************** *** 181,184 **** --- 182,190 ---- } + public boolean isRestartable() + { + return true; + } + } |
From: Suresh <sur...@us...> - 2006-03-28 04:54:15
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1494 Modified Files: BasicJobController.java BasicJobProcessor.java Log Message: no message Index: BasicJobProcessor.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobProcessor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicJobProcessor.java 4 Mar 2006 04:41:42 -0000 1.2 --- BasicJobProcessor.java 28 Mar 2006 04:54:11 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- package org.jmonks.batchserver.framework.controller.basic; import java.util.Map; + import org.jmonks.batchserver.framework.common.ErrorCode; /** *************** *** 20,24 **** public void initialize(Map configProps); ! public org.jmonks.batchserver.framework.common.StatusCode process(); public void cleanup(); --- 21,25 ---- public void initialize(Map configProps); ! public ErrorCode process(); public void cleanup(); *************** *** 29,31 **** --- 30,34 ---- public int getProcessedCount(); + + public boolean isRestartable(); } Index: BasicJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobController.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BasicJobController.java 25 Mar 2006 19:31:20 -0000 1.3 --- BasicJobController.java 28 Mar 2006 04:54:11 -0000 1.4 *************** *** 1,6 **** package org.jmonks.batchserver.framework.controller.basic; ! import org.jmonks.batchserver.framework.controller.*; ! import org.jmonks.batchserver.framework.mgmtmntr.*; ! import org.jmonks.batchserver.framework.common.*; /** --- 1,5 ---- package org.jmonks.batchserver.framework.controller.basic; ! import org.jmonks.batchserver.framework.common.ErrorCode; ! import org.jmonks.batchserver.framework.controller.JobController; /** *************** *** 9,27 **** * </p> * ! * @author : Suresh Pragada * @version 1.0 */ public class BasicJobController extends JobController { ! private BasicJobProcessor mBasicJobProcessor; public BasicJobController() { } ! public org.jmonks.batchserver.framework.common.StatusCode process() ! { return null; - } --- 8,26 ---- * </p> * ! * @author Suresh Pragada * @version 1.0 + * @since 1.0 */ public class BasicJobController extends JobController { ! private BasicJobProcessor basicJobProcessor; ! public BasicJobController() { } ! public ErrorCode process() { return null; } *************** *** 32,43 **** */ public int getExpectedRecordsCount() - - - { return 0; - - - } --- 31,36 ---- *************** *** 46,55 **** */ public int getProcessedRecordsCount() - - { return 0; - - } --- 39,44 ---- *************** *** 57,66 **** * Returns the thread count. */ ! public java.lang.String[] getThreadIDList() ! { return null; - - } --- 46,52 ---- * Returns the thread count. */ ! public java.lang.String[] getThreadIDList() { return null; } *************** *** 69,78 **** */ public org.jmonks.batchserver.framework.management.ThreadState getThreadState(String threadID) - - { return null; - - } --- 55,60 ---- *************** *** 81,90 **** */ public org.jmonks.batchserver.framework.management.JobStatus getJobStatus() - - { return null; - - } --- 63,68 ---- *************** *** 92,100 **** * Stops the job and persist the state of this job, if restart flag is true. */ ! public boolean stop(boolean restart) ! { return true; - } --- 70,76 ---- * Stops the job and persist the state of this job, if restart flag is true. */ ! public boolean stop(boolean restart) { return true; } *************** *** 103,110 **** */ public boolean suspend() - { return true; - } --- 79,84 ---- *************** *** 113,120 **** */ public boolean resume() - { return true; - } --- 87,92 ---- *************** *** 132,134 **** --- 104,117 ---- { } + + /** + * Tells whether the job writting using this controller can be restarted or not. + * This requests the restartable information from the basic job processor implementation. + * + * @return Returns true, if job processor can be restartable, false, otherwise. + */ + public boolean isRestartable() + { + return this.basicJobProcessor.isRestartable(); + } } |
From: Suresh <sur...@us...> - 2006-03-28 04:54:07
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1098 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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JobController.java 25 Mar 2006 19:31:20 -0000 1.4 --- JobController.java 28 Mar 2006 04:53:58 -0000 1.5 *************** *** 1,14 **** package org.jmonks.batchserver.framework.controller; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.*; import org.jmonks.batchserver.framework.management.JobMonitorMBean; - import org.jmonks.batchserver.framework.mgmtmntr.*; - import org.jmonks.batchserver.framework.common.*; import org.jmonks.batchserver.framework.management.JobManagerMBean; /** * <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> * --- 1,25 ---- package org.jmonks.batchserver.framework.controller; + import java.io.ObjectInputStream; + import java.io.ObjectOutputStream; + import org.apache.log4j.Level; + import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.*; + import org.jmonks.batchserver.framework.common.ErrorCode; import org.jmonks.batchserver.framework.management.JobMonitorMBean; import org.jmonks.batchserver.framework.management.JobManagerMBean; /** * <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. ! * </p> ! * <p> ! * 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> * *************** *** 18,108 **** */ public abstract class JobController implements JobMonitorMBean, JobManagerMBean ! { ! ! private Main mMain; ! protected 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.JobControllerConfig config) { ! return null; ! } /** ! * Returns the controller configuration object. ! * ! * @return Returns the controller configuration object. */ ! public JobControllerConfig getControllerConfig() { ! return null; } ! ! /** ! * 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.management.ThreadState getThreadState(String threadID); ! ! /** ! * @see org.jmonks.batchserver.framework.JobManagerMBean#getJobStatus() ! */ ! public abstract org.jmonks.batchserver.framework.management.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(); /** --- 29,162 ---- */ 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. ! */ ! private static JobController jobController=null; ! ! private static Logger logger=Logger.getLogger(JobController.class); /** * <p> ! * This factory method loads the required implementation of the controller ! * based on the controller configuration received. First it tries to look for the ! * existence of controller with this jobName in repository (If job is stopped ! * in middle through job management agent 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. ! * </p> * @param jobName Name of the job to be started. * @param controllerConfig configuration object represents controller configuration. * * @return Returns the correct implementation of the controller. */ ! public static synchronized JobController getJobController(String jobName, JobControllerConfig jobControllerConfig) { ! 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"); + logger.debug("job controller class name = " + jobControllerClassName); + + try + { + jobController=(JobController)Class.forName(jobControllerClassName).newInstance(); + jobController.jobName=jobName; + jobController.jobControllerConfig=jobControllerConfig; + logger.debug("created the job controller implemenation class"); + } + catch(ClassNotFoundException exception) + { + exception.printStackTrace(); + logger.error(exception.getMessage(),exception); + throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, exception.getMessage()); + } + catch(InstantiationException exception) + { + exception.printStackTrace(); + logger.error(exception.getMessage(),exception); + throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, exception.getMessage()); + } + catch(IllegalAccessException exception) + { + exception.printStackTrace(); + logger.error(exception.getMessage(),exception); + throw new ConfigurationException(ConfigurationException.JOB_CONTROLLER_CONFIG, exception.getMessage()); + } + } + 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. ! * ! * @param loggerName Name of the logger wants to find the log level. ! * ! * @return Returns the log level, null, if the given logger could not be found. ! */ ! public Level getLogLevel(String loggerName) ! { ! return LoggingManager.getLogLevel(loggerName); ! } /** ! * Changes the log level for the requested logger name with the given log level. ! * ! * @param loggerName Logger name needs to be modified. ! * @param newLogLevel new logging level. ! * ! * @return Returns true, if log level could be changed, false, otherwise. ! */ ! public boolean changeLogLevel(String loggerName, Level level) ! { ! return LoggingManager.changeLogLevel(loggerName, level); ! } ! /** ! * 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 ErrorCode process(); /** *************** *** 111,115 **** * @param inputStream Stream from which the controller needs to be recovered. */ ! public abstract void readObject(java.io.ObjectInputStream inputStream); /** --- 165,169 ---- * @param inputStream Stream from which the controller needs to be recovered. */ ! public abstract void readObject(ObjectInputStream inputStream); /** *************** *** 118,121 **** * @param outputStream Persist/Serialize the state of the controller. */ ! public abstract void writeObject(java.io.ObjectOutputStream outputStream); } --- 172,184 ---- * @param outputStream Persist/Serialize the state of the controller. */ ! public abstract void writeObject(ObjectOutputStream outputStream); ! ! /** ! * Tells whether this controller can be restartable. Specialized controllers ! * collect this information from the specialized jobs. ! * ! * @return Returns true, if controller can be restarted, false, otherwise. ! */ ! public abstract boolean isRestartable(); ! } |
From: Suresh <sur...@us...> - 2006-03-28 04:53:48
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1029 Modified Files: ConfigurationException.java Log Message: no message Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ConfigurationException.java 28 Mar 2006 04:46:51 -0000 1.8 --- ConfigurationException.java 28 Mar 2006 04:53:45 -0000 1.9 *************** *** 1,4 **** package org.jmonks.batchserver.framework.config; ! import org.jmonks.batchserver.framework.common.ExitCode; /** --- 1,4 ---- package org.jmonks.batchserver.framework.config; ! import org.jmonks.batchserver.framework.common.ErrorCode; /** |
From: Suresh <sur...@us...> - 2006-03-28 04:53:37
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv985 Modified Files: Main.java Log Message: no message Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Main.java 28 Mar 2006 04:45:35 -0000 1.6 --- Main.java 28 Mar 2006 04:53:33 -0000 1.7 *************** *** 4,8 **** import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.common.ExitCode; import org.jmonks.batchserver.framework.management.JobManagementAgent; --- 4,8 ---- import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.common.ErrorCode; import org.jmonks.batchserver.framework.management.JobManagementAgent; *************** *** 42,46 **** * configMap.put("config-name2","config-value2"); * ! * ExitCode statusCode=Main.process(configMap); * System.out.println("Job exited with return code : " + errorCode.getErrorCode()); * </pre> --- 42,46 ---- * configMap.put("config-name2","config-value2"); * ! * ErrorCode statusCode=Main.process(configMap); * System.out.println("Job exited with return code : " + errorCode.getErrorCode()); * </pre> *************** *** 52,56 **** * @return Returns zero for success and non-zero for failure. */ ! public static ExitCode process(Map configMap) { logger.trace("Entering process"); --- 52,56 ---- * @return Returns zero for success and non-zero for failure. */ ! public static ErrorCode process(Map configMap) { logger.trace("Entering process"); *************** *** 84,88 **** **/ Main main=new Main(); ! ExitCode errorCode=main.process(configMap); System.exit(errorCode.getCode()); } --- 84,88 ---- **/ Main main=new Main(); ! ErrorCode errorCode=main.process(configMap); System.exit(errorCode.getCode()); } |
From: Suresh <sur...@us...> - 2006-03-28 04:53:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv927 Added Files: ErrorCode.java Removed Files: ExitCode.java Log Message: no message --- NEW FILE: ErrorCode.java --- package org.jmonks.batchserver.framework.common; /** * <p> * The ErrorCode represents the error condition can generate in the system * and holds error code and message. This is like a enum class to make sure * the exit codes being passed around the application are valid (defined). * No instances of this class can be created from outside and cannot be instantiated. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public final class ErrorCode { /** * Code represents the error. */ private int code; /** * Message illustrates the code. */ private String message=null; /** * <p> * Private constructor make sure no instances will be created of this class * from outside of this class. * </p> * * @param code Code represents the error. * @param errorMsg Message illustrates the exit code. */ private ErrorCode(int code, String errorMsg) { this.code=code; this.message=errorMsg; } /** * Returns the error code represents the error. * * @return Returns the error code represents the error. */ public int getCode() { return this.code; } /** * Returns the error message illustrates the exit code. * * @return Returns the error message. */ public String getMessage() { return this.message; } /** * <p> * Returns the string representation of ErrorCode class in the format * <br> {ErrorCode [code = value] [message = value]} * </p> * * @return Returns the string representation of ErrorCode. */ public String toString() { StringBuffer stringValue=new StringBuffer("{ErrorCode "); stringValue.append("[code = " + this.code + "]"); stringValue.append("[message = " + this.message + "]"); stringValue.append("}"); return stringValue.toString(); } /** * Configuration Error Codes. */ public static final ErrorCode JOB_COMPLETED_SUCCESSFULLY = new ErrorCode(0,"Job successfully completed."); public static final ErrorCode FRAMEWORK_CONFIGURATION_ERROR = new ErrorCode(1001,"Error while accessing or parsing the framework configuration file."); public static final ErrorCode JOB_CONFIG_FACTORY_CONFIGURATION_ERROR = new ErrorCode(1002,"Job configuration factory cannot be created by the given factory configuration."); public static final ErrorCode JOB_CONFIGURATION_ERROR = new ErrorCode(1003,"Error while loading the job configuration from the defined factory."); public static final ErrorCode JOB_IS_NOT_CONFIGURED = new ErrorCode(1004,"Job is not configured"); public static final ErrorCode JOB_CONTROLLER_CONFIGURATION_ERROR = new ErrorCode(1005,"Job controller configuration is not defined properly."); } --- ExitCode.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-28 04:46:56
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29830 Modified Files: ConfigurationException.java framework-config.xml framework-config.xsd FrameworkConfig.java Log Message: no message Index: framework-config.xsd =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/framework-config.xsd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** framework-config.xsd 14 Mar 2006 23:02:19 -0000 1.2 --- framework-config.xsd 28 Mar 2006 04:46:51 -0000 1.3 *************** *** 8,12 **** <xsd:element name="framework-logging-config" type="FrameworkLoggingConfigType"/> <xsd:element name="repository-config" type="RepositoryConfigType"/> ! <xsd:element name="mgmt-mntr-config" type="MgmtMntrConfigType"/> <xsd:element name="job-controller-config" type="JobControllerConfigType"/> </xsd:complexType> --- 8,12 ---- <xsd:element name="framework-logging-config" type="FrameworkLoggingConfigType"/> <xsd:element name="repository-config" type="RepositoryConfigType"/> ! <xsd:element name="job-connector-config" type="JobConnectorConfigType"/> <xsd:element name="job-controller-config" type="JobControllerConfigType"/> </xsd:complexType> *************** *** 30,35 **** </xsd:complexType> ! <xsd:complexType name="MgmtMntrConfigType"> ! <xsd:attribute name="mgmt-mntr-class-name" type="xsd:string" use="required"/> <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/> </xsd:complexType> --- 30,35 ---- </xsd:complexType> ! <xsd:complexType name="JobConnectorConfigType"> ! <xsd:attribute name="job-connector-helper-class-name" type="xsd:string" use="required"/> <xsd:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/> </xsd:complexType> Index: framework-config.xml =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/framework-config.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** framework-config.xml 21 Mar 2006 04:26:37 -0000 1.15 --- framework-config.xml 28 Mar 2006 04:46:51 -0000 1.16 *************** *** 19,25 **** <framework-logging-config framework-logging-level="DEBUG" job-logging-directory="/batchserver/logs" job-base-package-name="com.mycompany.batch" job-logging-level="INFO"/> ! <mgmt-mntr-config mgmt-mntr-class-name="org.jmonks.batchserver.framework.mgmtmntr.jmxmp.repository.DefaultMgmtMntrManager"> ! <property key="port-range">15000-20000</property> ! </mgmt-mntr-config> <job-controller-config> <job-controller controller-class-name="org.jmonks.batchserver.framework.controller.pool.PoolJobController" --- 19,24 ---- <framework-logging-config framework-logging-level="DEBUG" job-logging-directory="/batchserver/logs" job-base-package-name="com.mycompany.batch" job-logging-level="INFO"/> ! <job-connector-config job-connector-helper-class-name="org.jmonks.batchserver.framework.management.jmxmp.RepositoryJMXMPConnectorHelper"> ! </job-connector-config> <job-controller-config> <job-controller controller-class-name="org.jmonks.batchserver.framework.controller.pool.PoolJobController" Index: FrameworkConfig.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/FrameworkConfig.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FrameworkConfig.java 14 Mar 2006 23:02:19 -0000 1.9 --- FrameworkConfig.java 28 Mar 2006 04:46:51 -0000 1.10 *************** *** 65,71 **** private FrameworkLoggingConfig frameworkLoggingConfig=null; /** ! * MgmtMntrConfig variable to hold the MgmtMntrConfig object. */ ! private MgmtMntrConfig mgmtMntrConfig=null; /** * RepositoryConfig variable to hold the RepositoryConfig object. --- 65,71 ---- private FrameworkLoggingConfig frameworkLoggingConfig=null; /** ! * JobConnectorConfig variable to hold the JobConnectorConfig object. */ ! private JobConnectorConfig jobConnectorConfig=null; /** * RepositoryConfig variable to hold the RepositoryConfig object. *************** *** 81,85 **** * Private constructor to make sure FrameworkCongi cannot be instantiated. This will * read the framework configuration file and create the instances of of JobConfigFactoryConfig, ! * FrameworkLoggingConfig, MgmtMntrConfig and RepositoryConfig by passing the correct DOM elements to their * constructors. This does the validation of configuration file against the defined XML schema file. * In case of errors it throws the ConfigurationException with the correct error code. --- 81,85 ---- * Private constructor to make sure FrameworkCongi cannot be instantiated. This will * read the framework configuration file and create the instances of of JobConfigFactoryConfig, ! * FrameworkLoggingConfig, JobConnectorConfig and RepositoryConfig by passing the correct DOM elements to their * constructors. This does the validation of configuration file against the defined XML schema file. * In case of errors it throws the ConfigurationException with the correct error code. *************** *** 142,156 **** } logger.debug("Logging configuration has been loaded and the configuration is : " + this.frameworkLoggingConfig); ! NodeList mgmtMntrConfigNodeList=frameworkConfigElement.getElementsByTagName(MgmtMntrConfig.TAG_NAME); ! if(mgmtMntrConfigNodeList.getLength()==1) { ! this.mgmtMntrConfig=new MgmtMntrConfig(((Element)mgmtMntrConfigNodeList.item(0))); } else { ! throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, "Found " + mgmtMntrConfigNodeList.getLength() + " " + ! MgmtMntrConfig.TAG_NAME + " element(s) in the framework configuration, where only one such element is allowed."); } ! logger.debug("MgmtMntr configuration has been loaded and the configuration is : " + this.mgmtMntrConfig); NodeList repositoryConfigNodeList=frameworkConfigElement.getElementsByTagName(RepositoryConfig.TAG_NAME); if(repositoryConfigNodeList.getLength()==1) --- 142,156 ---- } logger.debug("Logging configuration has been loaded and the configuration is : " + this.frameworkLoggingConfig); ! NodeList jobConnectorConfigNodeList=frameworkConfigElement.getElementsByTagName(JobConnectorConfig.TAG_NAME); ! if(jobConnectorConfigNodeList.getLength()==1) { ! this.jobConnectorConfig=new JobConnectorConfig(((Element)jobConnectorConfigNodeList.item(0))); } else { ! throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, "Found " + jobConnectorConfigNodeList.getLength() + " " + ! JobConnectorConfig.TAG_NAME + " element(s) in the framework configuration, where only one such element is allowed."); } ! logger.debug("MgmtMntr configuration has been loaded and the configuration is : " + this.jobConnectorConfig); NodeList repositoryConfigNodeList=frameworkConfigElement.getElementsByTagName(RepositoryConfig.TAG_NAME); if(repositoryConfigNodeList.getLength()==1) *************** *** 229,238 **** /** ! * Returns the mgmt&mntr configuration defines in the framework configuration as MgmtMntrConfig object. ! * @return Returns the MgmtMntrConfig object. */ ! public MgmtMntrConfig getMgmtMntrConfig() { ! return this.mgmtMntrConfig; } --- 229,238 ---- /** ! * Returns the mgmt&mntr configuration defines in the framework configuration as JobConnectorConfig object. ! * @return Returns the JobConnectorConfig object. */ ! public JobConnectorConfig getJobConnectorConfig() { ! return this.jobConnectorConfig; } *************** *** 510,516 **** /** * <p> ! * MgmtMntrConfig class holds the configuration required to create the MgmtMntrManager for this ! * framework. This configuration defines the specialized manager name and properties required ! * by that manager. This class cannot be instantiated by any other classes outside this framework. * </p> * <p> --- 510,518 ---- /** * <p> ! * JobConnectorConfig class holds the configuration required to create the ! * JobConnectorHelper classes used in establishing the job management agent and clients. ! * This configuration defines the specialized job connector helper class name ! * and properties required by that helper class. ! * This class cannot be instantiated by any other classes outside this framework. * </p> * <p> *************** *** 518,601 **** * <br><br> * <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> * </p> */ ! public class MgmtMntrConfig { /** ! * Tag name represents the mgmt mntr config in framework configuration file. */ ! private static final String TAG_NAME = "mgmt-mntr-config"; /** ! * Attribute name defines the mgmt mntr class name. */ ! private static final String MGMT_MNTR_CLASS_ATTRIB_NAME = "mgmt-mntr-class-name"; /** ! * Mgmt mntr class name. */ ! private String mgmtMntrClassName=null; /** ! * Supporting properties for the defined manager. */ ! private Map mgmtMntrConfigProperties=new HashMap(); /** ! * This constructor loads the MgmtMntrConfig object with the given ! * DOM Element represents the <mgmt-mntr-config> in the framework configuration file. ! * ! * @param mgmtMntrConfigElement DOM Element represents the <mgmt-mntr-config> tag in framework configuration file. */ ! private MgmtMntrConfig(Element mgmtMntrConfigElement) { ! logger.trace("Entering MgmtMntrConfig Constructor"); ! this.mgmtMntrClassName=mgmtMntrConfigElement.getAttribute(MgmtMntrConfig.MGMT_MNTR_CLASS_ATTRIB_NAME); ! if(this.mgmtMntrClassName==null || "".equals(this.mgmtMntrClassName)) ! throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, MgmtMntrConfig.MGMT_MNTR_CLASS_ATTRIB_NAME + " attribute value cannot be null."); - ! FrameworkUtil.loadPropertiesFromElementToMap(mgmtMntrConfigElement, this.mgmtMntrConfigProperties); ! logger.trace("Exiting MgmtMntrConfig Constructor"); } /** ! * Returns the defined MgmtMntrManager class name for the framework. * ! * @return Returns the MgmtMntrManager class name. */ ! public String getMgmtMntrClassName() { ! return this.mgmtMntrClassName; } /** ! * Returns the map consist of the properties needed by the defined manager. * * @return Returns the properties in a map. */ ! public Map getMgmtMntrProperties() { ! return this.mgmtMntrConfigProperties; } /** * <p> ! * Returns the string representation of MgmtMntrConfig class in the format ! * <br> {MgmtMntrConfig [mgmtMntrClassName = value] [properties = value]} * </p> ! * ! * @return Returns the string representation of MgmtMntrConfig. */ public String toString() { ! StringBuffer stringValue=new StringBuffer("{MgmtMntrConfig "); ! stringValue.append("[mgmtMntrClassName = " + this.mgmtMntrClassName + "]"); ! stringValue.append("[properties = " + this.mgmtMntrConfigProperties + "]"); stringValue.append("}"); return stringValue.toString(); --- 520,602 ---- * <br><br> * <pre> ! * <job-connector-config job-connector-helper-class-name="org.jmonks.batchserver.framework.management.jmxmp.RepositoryJMXMPConnectorHelper"> * <property key="port-range">15000-20000</property> ! * </job-connector-config> * </pre> * </p> */ ! public class JobConnectorConfig { /** ! * Tag name represents the job connector config in framework configuration file. */ ! private static final String TAG_NAME = "job-connector-config"; /** ! * Attribute name defines the job connector server helper class name. */ ! private static final String JOB_CONNECTOR_HELPER_CLASS_ATTRIB_NAME = "job-connector-helper-class-name"; /** ! * Job connector helper class name. */ ! private String jobConnectorHelperClassName=null; /** ! * Supporting properties for the defined helper class. */ ! private Map jobConnectorConfigProperties=new HashMap(); /** ! * This constructor loads the JobConnectorConfig object with the given ! * DOM Element represents the <job-connector-config> in the framework configuration file. ! * ! * @param jobConnectorConfigElement DOM Element represents the <job-connector-config> tag in framework configuration file. */ ! private JobConnectorConfig(Element jobConnectorConfigElement) { ! logger.trace("Entering JobConnectorConfig Constructor"); ! this.jobConnectorHelperClassName=jobConnectorConfigElement.getAttribute(JobConnectorConfig.JOB_CONNECTOR_HELPER_CLASS_ATTRIB_NAME); ! if(this.jobConnectorHelperClassName==null || "".equals(this.jobConnectorHelperClassName)) ! throw new ConfigurationException(ConfigurationException.FRAMEWORK_CONFIG, JobConnectorConfig.JOB_CONNECTOR_HELPER_CLASS_ATTRIB_NAME + " attribute value cannot be null."); ! FrameworkUtil.loadPropertiesFromElementToMap(jobConnectorConfigElement, this.jobConnectorConfigProperties); ! logger.trace("Exiting JobConnectorConfig Constructor"); } /** ! * Returns the defined job connector helper class name for the framework. * ! * @return Returns the job connector helper class name. */ ! public String getJobConnectorHelperClassName() { ! return this.jobConnectorHelperClassName; } /** ! * Returns the map consist of the properties needed by the defined job connectors. * * @return Returns the properties in a map. */ ! public Map getJobConnectorConfigProperties() { ! return this.jobConnectorConfigProperties; } /** * <p> ! * Returns the string representation of JobConnectorConfig class in the format ! * <br> {JobConnectorConfig [jobConnectorHelperClassName = value] [properties = value]} * </p> ! * ! * @return Returns the string representation of JobConnectorConfig. */ public String toString() { ! StringBuffer stringValue=new StringBuffer("{JobConnectorConfig "); ! stringValue.append("[jobConnectorHelperClassName = " + this.jobConnectorHelperClassName + "]"); ! stringValue.append("[properties = " + this.jobConnectorConfigProperties + "]"); stringValue.append("}"); return stringValue.toString(); *************** *** 810,816 **** * Returns the string representation of FrameworkConfig class in the format * <br> {FrameworkConfig [jobConfigFactoryConfig = value] [frameworkLoggingConfig = value] ! * [mgmtMntrConfig = value] [repositoryConfig = value][controllerConfig = value]} * </p> ! * * @return Returns the string representation of FrameworkConfig. */ --- 811,817 ---- * Returns the string representation of FrameworkConfig class in the format * <br> {FrameworkConfig [jobConfigFactoryConfig = value] [frameworkLoggingConfig = value] ! * [jobConnectorConfig = value] [repositoryConfig = value][controllerConfig = value]} * </p> ! * * @return Returns the string representation of FrameworkConfig. */ *************** *** 820,824 **** stringValue.append("[jobConfigFactoryConfig = " + this.configFactoryConfig + "]"); stringValue.append("[frameworkLoggingConfig = " + this.frameworkLoggingConfig + "]"); ! stringValue.append("[mgmtMntrConfig = " + this.mgmtMntrConfig + "]"); stringValue.append("[repositoryConfig = " + this.repositoryConfig + "]"); stringValue.append("[controllerConfig = " + this.controllerConfig + "]"); --- 821,825 ---- stringValue.append("[jobConfigFactoryConfig = " + this.configFactoryConfig + "]"); stringValue.append("[frameworkLoggingConfig = " + this.frameworkLoggingConfig + "]"); ! stringValue.append("[mgmtMntrConfig = " + this.jobConnectorConfig + "]"); stringValue.append("[repositoryConfig = " + this.repositoryConfig + "]"); stringValue.append("[controllerConfig = " + this.controllerConfig + "]"); Index: ConfigurationException.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConfigurationException.java 21 Mar 2006 04:26:36 -0000 1.7 --- ConfigurationException.java 28 Mar 2006 04:46:51 -0000 1.8 *************** *** 1,4 **** package org.jmonks.batchserver.framework.config; ! import org.jmonks.batchserver.framework.common.ErrorCode; /** --- 1,4 ---- package org.jmonks.batchserver.framework.config; ! import org.jmonks.batchserver.framework.common.ExitCode; /** *************** *** 38,42 **** public static final String JOB_CONTROLLER_CONFIG = "job-controller-config"; /** ! * Constant defines the source of controller config component. */ public static final String LOGGING_CONFIG = "logging-config"; --- 38,42 ---- public static final String JOB_CONTROLLER_CONFIG = "job-controller-config"; /** ! * Constant defines the source of logging config component. */ public static final String LOGGING_CONFIG = "logging-config"; *************** *** 46,52 **** public static final String REPOSITORY_CONFIG = "repository-config"; /** ! * Constant defines the source of repository config component. */ ! public static final String MGMT_MNTR_CONFIG = "mgmt-mntr-config"; --- 46,52 ---- public static final String REPOSITORY_CONFIG = "repository-config"; /** ! * Constant defines the source of job connector config component. */ ! public static final String JOB_CONNECTOR_CONFIG = "job-connector-config"; |
From: Suresh <sur...@us...> - 2006-03-28 04:46:29
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29723 Added Files: ExitCode.java Removed Files: ErrorCode.java StatusCode.java Log Message: no message --- ErrorCode.java DELETED --- --- NEW FILE: ExitCode.java --- package org.jmonks.batchserver.framework.common; /** * <p> * The ExitCode represents the error condition can generate in the system * that causes the job to exit. This holds exit code and message. * This is like a enum class to make sure * the exit codes being passed around the application are valid (defined). * No instances of this class can be created from outside and cannot be instantiated. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public final class ExitCode { /** * Code represents the error. */ private int code; /** * Message illustrates the code. */ private String message=null; /** * <p> * Private constructor make sure no instances will be created of this class * from outside of this class. * </p> * * @param code Code represents the error. * @param exitMsg Message illustrates the exit code. */ private ExitCode(int code, String exitMsg) { this.code=code; this.message=exitMsg; } /** * Returns the exit code represents the error. * * @return Returns the exit code represents the error. */ public int getCode() { return this.code; } /** * Returns the exit message illustrates the exit code. * * @return Returns the error message. */ public String getMessage() { return this.message; } /** * <p> * Returns the string representation of ExitCode class in the format * <br> {ExitCode [code = value] [message = value]} * </p> * * @return Returns the string representation of ExitCode. */ public String toString() { StringBuffer stringValue=new StringBuffer("{ExitCode "); stringValue.append("[code = " + this.code + "]"); stringValue.append("[message = " + this.message + "]"); stringValue.append("}"); return stringValue.toString(); } /** * Configuration Error Codes. */ public static final ExitCode JOB_SUCCESS = new ExitCode(0,"Job successfully completed."); public static final ExitCode FRAMEWORK_CONFIGURATION_ERROR = new ExitCode(1001,"Error while accessing or parsing the framework configuration file."); public static final ExitCode JOB_CONFIG_FACTORY_CONFIGURATION_ERROR = new ExitCode(1002,"Job configuration factory cannot be created by the given factory configuration."); public static final ExitCode JOB_CONFIGURATION_ERROR = new ExitCode(1003,"Error while loading the job configuration from the defined factory."); public static final ExitCode JOB_IS_NOT_CONFIGURED = new ExitCode(1004,"Job is not configured"); public static final ExitCode JOB_CONTROLLER_CONFIGURATION_ERROR = new ExitCode(1005,"Job controller configuration is not defined properly."); } --- StatusCode.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-28 04:45:39
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29257 Modified Files: LoggingManager.java Main.java Log Message: no message Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.java 25 Mar 2006 19:30:37 -0000 1.5 --- Main.java 28 Mar 2006 04:45:35 -0000 1.6 *************** *** 4,9 **** import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.mgmtmntr.*; ! import org.jmonks.batchserver.framework.common.*; import org.jmonks.batchserver.framework.management.JobManagementAgent; --- 4,8 ---- import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.common.ExitCode; import org.jmonks.batchserver.framework.management.JobManagementAgent; *************** *** 42,47 **** * configMap.put("config-name1","config-value1"); * configMap.put("config-name2","config-value2"); ! * ! * ErrorCode statusCode=Main.process(configMap); * System.out.println("Job exited with return code : " + errorCode.getErrorCode()); * </pre> --- 41,46 ---- * configMap.put("config-name1","config-value1"); * configMap.put("config-name2","config-value2"); ! * ! * ExitCode statusCode=Main.process(configMap); * System.out.println("Job exited with return code : " + errorCode.getErrorCode()); * </pre> *************** *** 53,57 **** * @return Returns zero for success and non-zero for failure. */ ! public static ErrorCode process(Map configMap) { logger.trace("Entering process"); --- 52,56 ---- * @return Returns zero for success and non-zero for failure. */ ! public static ExitCode process(Map configMap) { logger.trace("Entering process"); *************** *** 85,89 **** **/ Main main=new Main(); ! ErrorCode errorCode=main.process(configMap); System.exit(errorCode.getCode()); } --- 84,88 ---- **/ Main main=new Main(); ! ExitCode errorCode=main.process(configMap); System.exit(errorCode.getCode()); } Index: LoggingManager.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/LoggingManager.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** LoggingManager.java 14 Mar 2006 23:00:57 -0000 1.5 --- LoggingManager.java 28 Mar 2006 04:45:35 -0000 1.6 *************** *** 173,175 **** --- 173,211 ---- } } + + /** + * Gets the log level of the given logger name. + * + * @param loggerName Name of the logger wants to find the log level. + * + * @return Returns the log level, null, if the given logger could not be found. + */ + public static Level getLogLevel(String loggerName) + { + Logger logger=Logger.getLogger(loggerName); + if(logger==null) + return null; + else + return logger.getLevel(); + } + + /** + * Changes the log level for the requested logger name with the given log level. + * + * @param loggerName Logger name needs to be modified. + * @param newLogLevel new logging level. + * + * @return Returns true, if log level could be changed, false, otherwise. + */ + public static boolean changeLogLevel(String loggerName,Level newLogLevel) + { + boolean logLevelChanged=false; + Logger logger=Logger.getLogger(loggerName); + if(logger!=null) + { + logger.setLevel(newLogLevel); + logLevelChanged=true; + } + return logLevelChanged; + } } |
From: Suresh <sur...@us...> - 2006-03-25 19:31:23
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27366/basic Modified Files: BasicJobController.java Log Message: no message Index: BasicJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/basic/BasicJobController.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BasicJobController.java 4 Mar 2006 04:41:42 -0000 1.2 --- BasicJobController.java 25 Mar 2006 19:31:20 -0000 1.3 *************** *** 68,72 **** * Returns the state of the thread as a ThreadState object. */ ! public org.jmonks.batchserver.framework.mgmtmntr.ThreadState getThreadState(String threadID) --- 68,72 ---- * Returns the state of the thread as a ThreadState object. */ ! public org.jmonks.batchserver.framework.management.ThreadState getThreadState(String threadID) *************** *** 80,84 **** * Returns the job status. */ ! public org.jmonks.batchserver.framework.mgmtmntr.JobStatus getJobStatus() --- 80,84 ---- * Returns the job status. */ ! public org.jmonks.batchserver.framework.management.JobStatus getJobStatus() |
From: Suresh <sur...@us...> - 2006-03-25 19:31:23
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27366/pool Modified Files: PoolJobController.java Log Message: no message Index: PoolJobController.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller/pool/PoolJobController.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PoolJobController.java 4 Mar 2006 04:42:01 -0000 1.2 --- PoolJobController.java 25 Mar 2006 19:31:20 -0000 1.3 *************** *** 110,114 **** * @return Retuns the current state of the thread. */ ! public org.jmonks.batchserver.framework.mgmtmntr.ThreadState getThreadState(String threadID) --- 110,114 ---- * @return Retuns the current state of the thread. */ ! public org.jmonks.batchserver.framework.management.ThreadState getThreadState(String threadID) *************** *** 124,128 **** * @return Returns the status of the job. */ ! public org.jmonks.batchserver.framework.mgmtmntr.JobStatus getJobStatus() --- 124,128 ---- * @return Returns the status of the job. */ ! public org.jmonks.batchserver.framework.management.JobStatus getJobStatus() |
From: Suresh <sur...@us...> - 2006-03-25 19:31:23
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/controller In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27366 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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JobController.java 17 Mar 2006 05:14:27 -0000 1.3 --- JobController.java 25 Mar 2006 19:31:20 -0000 1.4 *************** *** 2,8 **** 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.common.*; /** --- 2,9 ---- import org.jmonks.batchserver.framework.config.*; import org.jmonks.batchserver.framework.*; ! import org.jmonks.batchserver.framework.management.JobMonitorMBean; import org.jmonks.batchserver.framework.mgmtmntr.*; import org.jmonks.batchserver.framework.common.*; + import org.jmonks.batchserver.framework.management.JobManagerMBean; /** *************** *** 83,92 **** * @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(); /** --- 84,93 ---- * @see org.jmonks.batchserver.framework.JobMonitorMBean#getThreadState(int) */ ! public abstract org.jmonks.batchserver.framework.management.ThreadState getThreadState(String threadID); /** * @see org.jmonks.batchserver.framework.JobManagerMBean#getJobStatus() */ ! public abstract org.jmonks.batchserver.framework.management.JobStatus getJobStatus(); /** |
From: Suresh <sur...@us...> - 2006-03-25 19:30:57
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26819 Modified Files: Main.java Log Message: no message Index: Main.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Main.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Main.java 14 Mar 2006 05:46:33 -0000 1.4 --- Main.java 25 Mar 2006 19:30:37 -0000 1.5 *************** *** 6,9 **** --- 6,10 ---- import org.jmonks.batchserver.framework.mgmtmntr.*; import org.jmonks.batchserver.framework.common.*; + import org.jmonks.batchserver.framework.management.JobManagementAgent; *************** *** 25,29 **** private static Logger logger=Logger.getLogger(Main.class); ! private MgmtMntrManager mMgmtMntrManager; public Main() --- 26,30 ---- private static Logger logger=Logger.getLogger(Main.class); ! private JobManagementAgent mMgmtMntrManager; public Main() |
From: Suresh <sur...@us...> - 2006-03-25 19:30:03
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26476/jmxmp Added Files: JMXMPJobConnectorServerHelper.java RepositoryJMXMPJobConnectorServerHelper.java Log Message: no message --- NEW FILE: RepositoryJMXMPJobConnectorServerHelper.java --- package org.jmonks.batchserver.framework.management.jmxmp; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.JobContext; /** * <p> * This connector server is based on JMX Messaging protocol and uses the framework * reposiotry as the lookup location to register and unregister the JMX Service URL. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class RepositoryJMXMPJobConnectorServerHelper extends JMXMPJobConnectorServerHelper { private static Logger logger=Logger.getLogger(RepositoryJMXMPJobConnectorServerHelper.class); /** * @see org.jmonks.batchserver.framework.management.JobConnectorServerHelper@init(java.util.Map) */ protected void init(java.util.Map configProps) { logger.trace("Entering init") ; /** * Because this uses the repository defined for this framework as the * lookup location, this implementation does not require any properties * in configuration file to initialize the lookup location. */ logger.trace("Exiting init") ; } /** * Registers the jmx service url with the given job name in the repository * defined for this framework. * * @param jobName Name of the job to be used in the registration. * @param jmxServiceURL JMX service url identifies the connector server * where all the manager and montiro mbeans are configured. * * @return Returns true, if it successfully registred in repository, false, otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public boolean registerServiceURL(String jobName,JMXServiceURL jmxServiceURL) { logger.trace("Entering registerServiceURL") ; if(jobName==null) throw new IllegalArgumentException("job name cannot be null to registerd jmx service url."); boolean registered=JobContext.getReposiotry().registerJobMgmtMntrInfo(jobName, jmxServiceURL.toString()); logger.debug(jobName + " with the service url " + jmxServiceURL.toString() + " registered in repository = " + registered); logger.trace("Exiting registerServiceURL") ; return registered; } /** * Unregisters the jmx service url registered in repository with the given * job name. * * @param jobName Name of the job the service URL registered with. * * @return Returns true, if it successfully unregistered, false otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public boolean unregisterServiceURL(String jobName) { logger.trace("Entering unregisterServiceURL") ; if(jobName==null) throw new IllegalArgumentException("job name cannot be null to unregister the service url."); boolean unregistered=JobContext.getReposiotry().unregisterJobMgmtMntrInfo(jobName); logger.debug(jobName + " mgmt and mntr information unregistered = " + unregistered); logger.trace("Exiting unregisterServiceURL") ; return unregistered; } } --- NEW FILE: JMXMPJobConnectorServerHelper.java --- /* * JMXMPJobConnectorServerHelper.java * * Created on March 22, 2006, 9:27 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management.jmxmp; import java.net.MalformedURLException; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.management.JobConnectorServerHelper; /** * <p> * JMXMPJobConnectorServerHelper creates the JMX Service URL based on the JMX Messaging * protocol and leaves the lookup location details to the class going to implement this * abstract class. The machine the job being run will be used as the host name and * the port will be selected automatically by the JMX connector server factory. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public abstract class JMXMPJobConnectorServerHelper extends JobConnectorServerHelper { private static Logger logger=Logger.getLogger(JMXMPJobConnectorServerHelper.class); /** * JMX Messaging Protocol URL to be used to create the connector server. */ private static final String JMXMP_SERVICE_URL = "service:jmx:jmxmp://"; /** * Creates the JMX Service URL based on JMX Messaging protocol. This does * not defined the host name and port name in the URL. So, the machine job * being run will be used as the host and port will be automatically choosen. * * @return Returns the JMX Service URL, null, if it cannot create the URL. */ public JMXServiceURL getServiceURL() { JMXServiceURL serviceURL=null; try { serviceURL=new JMXServiceURL(JMXMPJobConnectorServerHelper.JMXMP_SERVICE_URL); } catch(MalformedURLException exception) { exception.printStackTrace(); logger.error(exception.getMessage(), exception); } return serviceURL; } } |
From: Suresh <sur...@us...> - 2006-03-25 19:30:03
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26476 Added Files: JobConnectorServerHelper.java JobManagementAgent.java JobManagerMBean.java JobMonitor.java JobMonitorMBean.java JobStatus.java ThreadState.java Log Message: no message --- NEW FILE: JobMonitorMBean.java --- package org.jmonks.batchserver.framework.management; /** * <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. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ 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 ThreadState getThreadState(String threadID); } --- NEW FILE: JobConnectorServerHelper.java --- /* * JobConnectorServerHelper.java * * Created on March 24, 2006, 8:04 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; import java.util.Map; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.config.FrameworkConfig; /** * <p> * JobConnectorServerHelper defines the helper methods used while creating the JMX * connector server and registering and unregistering the JMX Service URL in the * lookup location. Because of many possible implementations available in creating * the JMX connector server and lookup location, this class defines the methods * to choose their own implementations. Mainly, Agent looks for the following * information and activities from the concrete implementations of the connector * server helper class. * <br> * <ul> * <li>Return the JMX Service URL to create the JMX connector server. * <li>Register the given the JMX Service URL in the lookup location with the given jobname. * <li>Unregister the JMX Service URL available in lookup location with the given jobname. * </ul> * <br> * This class provides the factory method to return the configured JobConnectorServerHelper * instance by looking at the framework configuration and make sure only one * instance will be created for the job. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public abstract class JobConnectorServerHelper { private static Logger logger=Logger.getLogger(JobConnectorServerHelper.class); /** * Singleton job connector server helper instance. */ private static JobConnectorServerHelper jobConnectorServer=null; /** * This factory method creates the correct implementation of JobConnectorServerHelper * based on the configuration defined in framework-config.xml file. * This looks for the following configuration and uses the class name provided * at the job-connector-server-helper-class-name attribute to create the server helper * instance. * <br> * <pre> * <job-connector-config job-connector-server-helper-class-name="org.jmonks.batchserver.framework.management.jmxmp.repository.RepositoryJMXMPJobConnectorServer"> * <property key="mgmt-mntr-config-key">mgmt-mntr-config-value</property> * </job-connector-config> * </pre> * * @return Returns the JobConnectorServerHelper implemenation. * * @throws ConfigurationException If configuration could not be found or * implementation class cannot be accessed or instantiated. */ public static synchronized JobConnectorServerHelper getJobConnectorServerHelper() { logger.trace("Entering getJobConnectorServerHelper"); if(jobConnectorServer!=null) { FrameworkConfig.JobConnectorConfig jobConnectorConfig=FrameworkConfig.getInstance().getJobConnectorConfig(); if(jobConnectorConfig==null) throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "job connector configuration is not configured in framework configuration"); String jobConnectorServerHelperClassName=jobConnectorConfig.getJobConnectorServerHelperClassName(); logger.trace("Job connector server helper class name = " + jobConnectorServerHelperClassName); try { jobConnectorServer=(JobConnectorServerHelper)Class.forName(jobConnectorServerHelperClassName).newInstance(); jobConnectorServer.init(jobConnectorConfig.getJobConnectorConfigProperties()); } catch(ClassNotFoundException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } catch(InstantiationException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } catch(IllegalAccessException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, exception.getMessage()); } } logger.trace("Exiting getJobConnectorServerHelper"); return jobConnectorServer; } /** * This method will be called after instantiating the JobConnectorServerHelper to * initialize JobConnectorServerHelper with the properties needed to create JMX Service URL * and initialize the lookup location needed to register and unregister the JMX Service URL . * * @param configProps Properties defined for this connector server as a map. * * @throws ConfigurationException If required properties for this connector server are missing. */ protected abstract void init(Map configProps); /** * Creates the JMX Service URL based on the desired protocol. * * @return Returns the JMX Service URL, null, if helper cannot create the URL. */ public abstract JMXServiceURL getServiceURL(); /** * Registers the jmx service url with the given job name in the desired lookup location. * * @param jobName Name of the job to be used in the registration. * @param jmxServiceURL JMX service url identifies the connector server * where all the manager and monnitor mbeans are configured. * * @return Returns true, if it successfully registred in lookup location, false, otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public abstract boolean registerServiceURL(String jobName,JMXServiceURL jmxServiceURL); /** * Unregisters the jmx service url registered in desired lookup location with the given * job name. * * @param Name of the job mgmt and mntr information has been registered with. * * @return Returns true, if it successfully unregistered, false otherwise. * * @throws IllegalArgumentException If job name paramter is null. */ public abstract boolean unregisterServiceURL(String jobName); } --- NEW FILE: JobManagerMBean.java --- package org.jmonks.batchserver.framework.management; /** * <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.management.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: JobManagementAgent.java --- package org.jmonks.batchserver.framework.management; import java.io.IOException; import java.util.HashMap; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import javax.management.remote.JMXConnectorServer; import javax.management.remote.JMXConnectorServerFactory; import javax.management.remote.JMXServiceURL; import org.apache.log4j.Logger; import org.jmonks.batchserver.framework.common.StatusCode; import org.jmonks.batchserver.framework.config.ConfigurationException; import org.jmonks.batchserver.framework.controller.JobController; /** * <p> * JobManagementAgent defines the methods to start and stop the JMX Agent for this job. * Only one agent for the job will be created and this agent will be initialized * when you request to get the job management agent instance. Agent service can be * started and stopped only once during the life cycle of the job. This uses * the JobConnectorServerHelper to take the help in creating different JMX * connector servers and different lookup locations to * register and unregister jmx service urls. * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JobManagementAgent { /** * Mbean Server domain name. */ public static final String MBEAN_SERVER_DOMAIN_NAME = "EnterpriseBatchServer"; /** * Name of the bean that manages this job. */ public static final String JOB_MANAGER_MBEAN_NAME = "JobManagerMBean"; /** * Name of the bean monitors this job. */ public static final String JOB_MONITOR_MBEAN_NAME = "JobMonitorMBean"; /** * Singleton job management agent instance. */ private static final JobManagementAgent jobManagementAgent=new JobManagementAgent(); /** * JMX Connector server instance created for this agent. */ private JMXConnectorServer jmxConnectorServer=null; /** * Job connector server helper instance. This defines the implementation * and lookup location of the JMX connector server. */ private JobConnectorServerHelper jobConnectorServerHelper=null; /** * Name of the job this agent configured for. */ private String jobName=null; /** * Tells whether the agent has been started or not. */ private boolean started=false; /** * Tells whether the agent has been stopped or not. */ private boolean stopped=false; private static Logger logger=Logger.getLogger(JobManagementAgent.class); /** * Initializes the job management agent. It make sure it would be able to get * the reference to job connector server helper class. * * @throws ConfigurationException If it couldnt get the job connector server helper class. */ private JobManagementAgent() { this.jobConnectorServerHelper=JobConnectorServerHelper.getJobConnectorServerHelper(); if(jobConnectorServerHelper==null) throw new ConfigurationException(ConfigurationException.JOB_CONNECTOR_CONFIG, "could not get the reference to job connector server helper class."); } /** * Returns the job management agent instance. */ public static JobManagementAgent getJobManagementAgent() { return jobManagementAgent; } /** * <p> * This method start the job management agent with the given controller information. * Basicially, this does the following activities to start the management agent. * <br> * <ul> * <li>Creates the job manager and job monitor mbeans by passing the controller reference. * <li>Creates the MBeanServer and registers these two MBeans. * <li>Create the JMX Connector server based on the service url got from the connector server helper implementation. * <ii>Registers JMX Connector server service url in the lookup location defined by connector server helper implementation. * <li>Marks the started flag as true to indicate that agent has been started. * </ul> * <br> * Agent can be started only once in the job life cycle. If it receives a request to start * when it is already started, it throws IllegalStateException. * </p> * @param jobName Name of the job the controller belongs to. * @param jobController Controller reference to be passed to the mbeans. * * @return Returns true, if manager is started properly, false, otherwise. * * @throws IllegalArgumentException If input parameters job name or job controller is null. * @throws IllegalStateException If manager is already started or already stopped. */ public boolean start(String jobName,JobController jobController) { logger.trace("Entering start"); if(this.started) throw new IllegalStateException("job management agent has been already started."); if(this.stopped) throw new IllegalStateException("job management agent has been already stopped."); if(jobName==null || "".equals(jobName)) throw new IllegalArgumentException("job name cannot be null or empty to start the job management agent."); if(jobController==null) throw new IllegalArgumentException("controller object cannot be null to start the job management agent."); this.jobName=jobName; try { MBeanServer mbeanServer=MBeanServerFactory.createMBeanServer(JobManagementAgent.MBEAN_SERVER_DOMAIN_NAME); JMXServiceURL jmxServiceURL=this.jobConnectorServerHelper.getServiceURL(); jmxConnectorServer=JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, new HashMap(), mbeanServer); logger.debug("Got the jmx connector server from the implementation"); /** * Create the mbeans and register them with this mbean server. */ boolean registered=this.jobConnectorServerHelper.registerServiceURL(jobName,jmxServiceURL); if(registered) { this.started=true; } else { this.started=false; } } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); } logger.trace("Exiting start"); return this.started; } /** * Stops the JMX connector server, unregisters the MBeans and MBeanServer and * unregisters the jmx service url information from lookup location and marks * stopped flag as true to indicate that agent has been stopped. Given controller * exit status will be sent to all the JMX remote clients as a notification. * * * @param existStatus errorCode returned by controller to the Main class. * * @return Returns true, if agent could be stopped properly, false otherwise. * * @throws IllegalArgumentException If input parameter status code is null. * @throws IllegalStateException If agent is already stopped or it not yet started. */ public boolean stop(StatusCode controllerExitStatus) { logger.trace("Entering stop"); if(!this.started) throw new IllegalStateException("Job management agent has not been started."); if(this.stopped) throw new IllegalStateException("Job management agent has been stopped already."); if(controllerExitStatus==null) throw new IllegalArgumentException("controller exit status cannot be null to stop the server."); try { this.jmxConnectorServer.stop(); this.jobConnectorServerHelper.unregisterServiceURL(this.jobName); this.stopped=true; logger.debug("unregistered the jmx service url from lookup location"); } catch(IOException exception) { exception.printStackTrace(); logger.error(exception.getMessage(),exception); this.stopped=false; } logger.trace("Exiting stop"); return this.stopped; } } --- NEW FILE: JobMonitor.java --- /* * JobMonitor.java * * Created on March 25, 2006, 1:12 PM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package org.jmonks.batchserver.framework.management; /** * <p> * </p> * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public class JobMonitor implements JobMonitorMBean { private JobMonitorMBean jobMonitor=null; /** * Creates a new instance of JobMonitorMBean b * * @param jobController Job controller implements this interface. */ public JobMonitor(JobController jobController) { this.jobMonitor=(JobMonitorMBean)jobController; } /** * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getExpectedRecordsCount */ public int getExpectedRecordsCount() { return 0; } /** * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getProcessedRecordsCount */ public int getProcessedRecordsCount() { return 0; } /** * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getThreadIDList */ public String[] getThreadIDList() { return null; } /** * @see org.jmonks.batchserver.framework.management.JobMonitorMBean#getThreadState(java.lang.String) */ public ThreadState getThreadState(String threadID) { return null; } } --- NEW FILE: ThreadState.java --- package org.jmonks.batchserver.framework.management; /** * <p> * This represents the state of the thread. * This gives the information like thread ID, description and * processing information. * </p> * @author Suresh pragada * @version 1.0 * @since 1.0 */ public class ThreadState { /** * Holds the thread ID. */ private String threadID; /** * Holds the thread description. */ private String threadDescription; /** * 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 ThreadState(String threadID,String threadDescription,String processingInfo) { this.threadID=threadID; this.threadDescription=threadDescription; this.processingInfo=processingInfo; } /** * Returns the thread ID. */ public String getThreadID() { return this.threadID; } /** * Returns the thread description. */ public String getThreadDescription() { return this.threadDescription; } /** * Returns the thread processing information. */ public Object getProcessingInfo() { return this.processingInfo; } /** * <p> * Returns the string representation of ThreadState class in the format * <br> {ThreadState [ID = value] [desc = value] [processingInfo = value]} * </p> * * @return Returns the string representation of ThreadState. */ public String toString() { StringBuffer stringValue=new StringBuffer("{ThreadState "); stringValue.append("[ID = " + this.threadID + "]"); stringValue.append("[desc = " + this.threadDescription + "]"); stringValue.append("[processingInfo = " + this.processingInfo + "]"); stringValue.append("}"); return stringValue.toString(); } } --- NEW FILE: JobStatus.java --- package org.jmonks.batchserver.framework.management; /** * <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; } } |
From: Suresh <sur...@us...> - 2006-03-25 19:27:38
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25260/jmxmp Log Message: Directory /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management/jmxmp added to the repository |
From: Suresh <sur...@us...> - 2006-03-25 19:27:21
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25169/management Log Message: Directory /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/management added to the repository |
From: Suresh <sur...@us...> - 2006-03-25 19:25:47
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr/jmxmp/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24226/jmxmp/repository Removed Files: JMXMPRepositoryMgmtMntrManager.java Log Message: no message --- JMXMPRepositoryMgmtMntrManager.java DELETED --- |
From: Suresh <sur...@us...> - 2006-03-25 19:25:24
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/mgmtmntr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24012 Removed Files: MgmtMntrManager.java Log Message: no message --- MgmtMntrManager.java DELETED --- |