[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework ErrorCode.java, 1.5, 1.6 JobStat
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-09-14 05:02:53
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25721 Modified Files: ErrorCode.java JobStatistics.java Repository.java Log Message: no message Index: ErrorCode.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/ErrorCode.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ErrorCode.java 13 Sep 2006 05:01:34 -0000 1.5 --- ErrorCode.java 14 Sep 2006 05:02:47 -0000 1.6 *************** *** 3,12 **** /** * <p> ! * The ErrorCode represents the error condition can generate in the system. ! * It holds code which uniquely identifies the error and message which explains the error in the system. ! * This is also used to represent the status code * for any processor/controller/job. This provides the flexibility to create ! * new custom error codes and append the message to the existing error code. ! * Codes ranging from 0 to 100 are reserved for framework purpose. Use the codes * above 100 to create the custom error codes. * </p> --- 3,12 ---- /** * <p> ! * The ErrorCode represents the error condition that can generate in the system. ! * It consists of the code which uniquely identifies the ErrorCode and message ! * which explains the error in the system. This is also used to represent the status code * for any processor/controller/job. This provides the flexibility to create ! * new custom ErrorCodes and append the message to the existing ErrorCode. ! * Codes ranging from 0 to 100 are reserved for framework purposes. Use the codes * above 100 to create the custom error codes. * </p> *************** *** 30,39 **** /** * <p> ! * Protected constructor to make sure no instances will be created of this class ! * from outside of this class and it is extensible. * </p> * * @param code Code represents the error. ! * @param errorMsg Message illustrates the exit code. */ private ErrorCode(int code, String errorMsg) --- 30,39 ---- /** * <p> ! * Private constructor to make sure no instances of ErrorCode will be created ! * from outside of this class and it is not extensible. * </p> * * @param code Code represents the error. ! * @param errorMsg Message explains the failure or success reason. */ private ErrorCode(int code, String errorMsg) *************** *** 64,69 **** /** ! * Creates a new ErorCode object with the same error code and appends the given ! * message to the existing message and returns that new error code. * * @param messageToBeAppended Message that needs to be appended to the existing message. --- 64,69 ---- /** ! * Creates a new ErrorCode object with the same error code and appends the given ! * message to the existing message and returns new ErrorCode. * * @param messageToBeAppended Message that needs to be appended to the existing message. *************** *** 94,98 **** /** ! * Equality will be based on the code the two error codes contain. * * @see java.lang.Object#equals(java.lang.Object) --- 94,98 ---- /** ! * Equality will be based on the code the two ErrorCodes contains. * * @see java.lang.Object#equals(java.lang.Object) *************** *** 105,109 **** /** ! * Code represented by error code will be returned as a hash code. * * @see java.lang.Object#hashCode() --- 105,109 ---- /** ! * Code represented by ErrorCode will be returned as a hash code. * * @see java.lang.Object#hashCode() Index: JobStatistics.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobStatistics.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** JobStatistics.java 13 Sep 2006 05:01:34 -0000 1.7 --- JobStatistics.java 14 Sep 2006 05:02:47 -0000 1.8 *************** *** 5,11 **** /** * <p> ! * JobStatistics holds the statistics of the job. These statistics will be ! * start and end time of the job, records have been processed, memory has ! * been utilized and exit code of the job. * </p> * --- 5,12 ---- /** * <p> ! * JobStatistics holds the useful metrics and information of particular run of a job. ! * These statistics helpful in research of the periodic growth of the jobs. ! * Statistics it holds are start and end time of the run, records have been processed ! * in the run, memory has been utilized in the run and exit code of that run. * </p> * *************** *** 29,33 **** private long recordsProcessed; /** ! * Maximum memory usage of this job. */ private long maxMemoryUsage; --- 30,34 ---- private long recordsProcessed; /** ! * Maximum memory consumption in bytes. */ private long maxMemoryUsage; *************** *** 85,89 **** /** ! * Sets the maximum memory used for the job. * * @param memoryUsaeg Sets the memory usage by the job. --- 86,90 ---- /** ! * Sets the maximum memory used for the job in bytes. * * @param memoryUsaeg Sets the memory usage by the job. *************** *** 125,129 **** /** ! * Gets the maximum memory used by this job. * * @return Returns the max memory used by this job. --- 126,130 ---- /** ! * Gets the maximum memory used by this job in bytes. * * @return Returns the max memory used by this job. Index: Repository.java =================================================================== RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/Repository.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Repository.java 13 Sep 2006 23:29:25 -0000 1.6 --- Repository.java 14 Sep 2006 05:02:47 -0000 1.7 *************** *** 2,7 **** import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.config.*; ! --- 2,7 ---- import java.util.Map; import org.apache.log4j.Logger; ! import org.jmonks.batchserver.framework.config.ConfigurationException; ! import org.jmonks.batchserver.framework.config.FrameworkConfig.RepositoryConfig; *************** *** 9,27 **** /** * <p> ! * Repository provides utility methods to access and use the repository maintained ! * by the framework. There could be differnt implementations of the repository. ! * Framework configuration defines which implementation should be used for this framework. ! * This povides utility methods to logs the job statistics and ! * transfer data between the jobs and register management and monitoring ! * information between. Repository make sure only one instance ! * of the implementation class will be created and it will be associated with the ! * job being run and all the opertions performated will be taken that job as a source job. * </p> * <p> ! * <i>Implementation Note : </i><br> ! * This declares an abstract method init with the protected access for the repository ! * implementors to inititalize the repository implementation. Implementors should implement ! * this method and make sure constructor is exist and accessible to enable the initialization of ! * this implementation from the factory method. * </p> * --- 9,32 ---- /** * <p> ! * Repository class provides utility methods to access and use the repository maintained ! * by the framework. The repository could be any data store from files to databases, useful ! * to save and retrieve the data. So, there could be different implementations available of ! * this Repository class. Framework configuration defines which implementation should ! * be used for the framework. * </p> * <p> ! * This povides utility methods to log the job statistics and transfer data between the jobs ! * and register & unregister management and monitoring information. Framework creates the ! * repository at the startup and provides this reference through the JobContext to all the jobs. ! * When the repository get created, it will be associated with the job beign run and all the ! * operations will be performed with respect to that job only. The job being run will be taken ! * as source job in all the operations. ! * </p> ! * <p> ! * Default framework configuration uses Db4o database as repository for its simplicity. ! * There is a JdbcRepository implementation by using which we can use any database that ! * can be used JDBC can be configured to use as repository. If anyone wish to use tools ! * provided to manage and monitor the applications, consider of using the JdbcRepository ! * implementation. * </p> * *************** *** 46,51 **** /** ! * Method to initialize the repository implementation with the properties ! * defined in the framework configuration. * * @param configProps Configuration properties defined in <repository-config> element --- 51,59 ---- /** ! * <p> ! * Method to initialize the repository implementation by using the properties ! * defined in the framework configuration. This method will be called immediately ! * after instantiating the implementation class. ! * </p> * * @param configProps Configuration properties defined in <repository-config> element *************** *** 59,76 **** /** * <p> ! * Creates the repository instance based on the given configuration and associate ! * this repository instance with the given job. So all the repository opertions ! * performed from one job will be associated with that job only. This method ! * will be called by framework before kicking off the controller. Do not attempt ! * to call this method to create the repository from the client code. * </p> * ! * @throws IllegalStateException If there is an attempt is to create the repository ! * instance more than once. * @throws IllegalArgumentException If jobName is null to create the repository instance. ! * @throws ConfigurationException If required configuration properties are missing or the values ! * are invalid. */ ! public static Repository createRepository(String jobName, FrameworkConfig.RepositoryConfig repositoryConfig, Main repositoryCreator) { logger.trace("Entering createRepository"); --- 67,86 ---- /** * <p> ! * Factory method creates the repository instance based on the given repository configuration and associate ! * this repository instance with the given job. So, all the repository operations performed ! * using this repository instance will be associated with that job and taken that job as source ! * job in all operations. This method will be called by the framework to create the repository and ! * places the reference in JobContext object. * </p> * ! * @param jobName Name of the job this repository will be associated with. ! * @param repositoryConfig Repository configuration defined in framework configuration. ! * @param repositoryCreator Creator of the repository. This is is restrict only framework can instantiate the repository. ! * ! * @throws SecurityException If an attempt is made to create the repository by other than the Main class(framework). * @throws IllegalArgumentException If jobName is null to create the repository instance. ! * @throws ConfigurationException If required properties are missing in the repository configuration or the values are invalid. */ ! public static Repository createRepository(String jobName, RepositoryConfig repositoryConfig, Main repositoryCreator) { logger.trace("Entering createRepository"); *************** *** 93,98 **** { repository=(Repository)Class.forName(repositoryClassName).newInstance(); repository.init(repositoryConfig.getRepositoryConfigProperties()); - repository.jobName=jobName; logger.debug("created the repository implemenation class"); } --- 103,108 ---- { repository=(Repository)Class.forName(repositoryClassName).newInstance(); + repository.jobName=jobName; repository.init(repositoryConfig.getRepositoryConfigProperties()); logger.debug("created the repository implemenation class"); } *************** *** 121,137 **** /** * <p> ! * Data will be sent to the specified target job. This data ! * will be marked with the data identifier. Target job ! * should use the data identifier to read the data. If there is any ! * data with this identifier from this job, it will be overriden. * </p> * * @param dataIdentifier Identifier to be used to exchange the data between two jobs. ! * @param nextJobName Name of the job this data to be send. ! * @param data Data that needs to be sent as the object. * ! * @return Returns true, if it could save the data to be sent to the next job. * ! * @throws IllegalArgumentException If any one of the input values is null. */ public abstract boolean sendDataToNextJob(String dataIdentifier, String nextJobName, --- 131,148 ---- /** * <p> ! * Data will be send to the specified next job and will be identified with the ! * given identifier. By using different identifiers, multiple data objects ! * can be send to the same next job. Next job should use the data identifier ! * and this (source) job name to read the data. If there is any data with this ! * identifier from this job to the next job, it will be overriden. * </p> * * @param dataIdentifier Identifier to be used to exchange the data between two jobs. ! * @param nextJobName Name of the next job this data to be send. ! * @param data Data that needs to be send as the object. * ! * @return Returns true, if it could save the data to be send to the next job. * ! * @throws IllegalArgumentException If any one of the incoming values are null. */ public abstract boolean sendDataToNextJob(String dataIdentifier, String nextJobName, *************** *** 139,160 **** /** ! * Gets the data that has been sent to the target job from the source job ! * and identified by the given data identifier. * ! * @param dataIdentifier Identifier tied to the data wants to be read. ! * @param previousJobName Name of the job sent the data to this job. * ! * @return Returns the data, null, if it couldnt find any data. * ! * @throws IllegalArgumentException If any one of the input values is null. */ public abstract Object getDataFromPreviousJob(String dataIdentifier, String previousJobName); /** ! * <p> ! * This method will clear all the data that has been put up by ! * this job. Usually, this will be called by startp of framework, ! * before kicking off the controller. ! * </p> */ public abstract boolean clearDataTransferredFromThisJob(); --- 150,171 ---- /** ! * Gets the data that has been sent by the previous job with the given data identifier. * ! * @param dataIdentifier Identifier tied to the data that has been sent. ! * @param previousJobName Name of the previous job sent the data to this job. * ! * @return Returns the data, null, if it couldnt find any data from the previous job with that identifier. * ! * @throws IllegalArgumentException If any one of the input values are null. */ public abstract Object getDataFromPreviousJob(String dataIdentifier, String previousJobName); /** ! * <p> ! * This method will clear all the data that has been sent by this job to all the next jobs. ! * </p> ! * ! * @return Returns true if it could clear all the data, false, otherwise. ! * */ public abstract boolean clearDataTransferredFromThisJob(); *************** *** 162,166 **** /** * <p> ! * Registers the given job management and monitoring info with the job. * If there is any information already associated with this job, it * will be overriden. --- 173,177 ---- /** * <p> ! * Registers the given job management and monitoring information to this job. * If there is any information already associated with this job, it * will be overriden. *************** *** 177,181 **** /** ! * Unregisters the job management and monitoring info assosciated with the job. * * @return Return true, it it could unregister the information, false, otherwise. --- 188,192 ---- /** ! * Unregisters the job management and monitoring information assosciated with this job. * * @return Return true, it it could unregister the information, false, otherwise. *************** *** 184,190 **** /** * Logs the job statistics given in the form of JobStatistics object * in the repository for further use/references. ! * * @param statistics Job Statistics object which holds all the statistics related to that job. * --- 195,202 ---- /** + * <p> * Logs the job statistics given in the form of JobStatistics object * in the repository for further use/references. ! * </p> * @param statistics Job Statistics object which holds all the statistics related to that job. * |