[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/repository Repository.java,1.1,1.
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-03-17 05:13:51
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/repository In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18608 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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Repository.java 16 Mar 2006 14:13:26 -0000 1.1 --- Repository.java 17 Mar 2006 05:13:48 -0000 1.2 *************** *** 19,22 **** --- 19,29 ---- * information between framework and server. * </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 default constructor exist to enable the initialization of + * this implementation from the factory method. + * </p> * @author Suresh Pragada * @version 1.0 *************** *** 28,42 **** private static Logger logger=Logger.getLogger(Repository.class); /** ! * Protected constructor to make sure Repository cannot be instantiated ! * other than extending this class. */ ! protected Repository() ! { ! } /** * Factory method returns the specific implementation of repository based on the ! * repository configuration. * * @param repositoryConfig Repository configuration object. --- 35,54 ---- private static Logger logger=Logger.getLogger(Repository.class); + /** ! * Method to initialize the repository implementation with the properties ! * defined in the framework configuration. ! * ! * @param configProps Configuration properties defined in <repository-config> element ! * in framework configuration file. ! * ! * @throws ConfigurationException If required configuration properties are missing or the values ! * are invalid. */ ! protected abstract void init(Map configProps); /** * Factory method returns the specific implementation of repository based on the ! * repository configuration in framework configuration file. * * @param repositoryConfig Repository configuration object. *************** *** 62,70 **** try ! { ! Class repositoryClass=Class.forName(repositoryClassName); ! Constructor repositoryConstructor=repositoryClass.getConstructor(new Class[]{Map.class}); ! repository=(Repository)repositoryConstructor.newInstance(new Object[]{repositoryConfig.getRepositoryConfigProperties()}); logger.debug("created the repository implemenation class"); } catch(ClassNotFoundException exception) --- 74,82 ---- try ! { ! repository=(Repository)Class.forName(repositoryClassName).newInstance(); ! repository.init(repositoryConfig.getRepositoryConfigProperties()); logger.debug("created the repository implemenation class"); + } catch(ClassNotFoundException exception) *************** *** 74,83 **** throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); } - catch(NoSuchMethodException exception) - { - exception.printStackTrace(); - logger.error(exception.getMessage(),exception); - throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); - } catch(InstantiationException exception) { --- 86,89 ---- *************** *** 92,101 **** throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); } - catch(InvocationTargetException exception) - { - exception.printStackTrace(); - logger.error(exception.getMessage(),exception); - throw new ConfigurationException(ConfigurationException.REPOSITORY_CONFIG, exception.getMessage()); - } logger.trace("Exiting getRepository"); --- 98,101 ---- *************** *** 104,110 **** /** * 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. * * @param dataIdentifier Identifier to be used to exchange the data between two jobs.. --- 104,113 ---- /** + * <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.. *************** *** 114,120 **** * * @return Returns true, if it could save the data to be sent to the next job. */ ! public abstract boolean sendDatatoNextJob(String dataIdentifier, String sourceJobName, ! String targetJobName, Object data); /** --- 117,125 ---- * * @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 sourceJobName, ! String targetJobName, final Object data); /** *************** *** 127,130 **** --- 132,137 ---- * * @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 dataIdentifer, String sourceJobName, *************** *** 140,158 **** * * @param jobName Name of job that put up the data. */ public abstract boolean clearDataTransferredToNextJob(String jobName); /** * Registers the job management and monitoring info with the given job name. ! * If there is an association with this job name existing, that information * will be overriden. This could happen, if job forgot to unregister the * management and monitoring information. ! * * @param jobName Name of the job. * @param registrationInfo Information to be associated with this job name. * * @return Return true, if it could assosciate this information, false, otherwise. */ ! public abstract boolean registerJobMgmtMntrInfo(String jobName, Object registrationInfo); /** --- 147,172 ---- * * @param jobName Name of job that put up the data. + * + * @throws IllegalArgumentException If input job name is null. */ public abstract boolean clearDataTransferredToNextJob(String jobName); /** + * <p> * Registers the job management and monitoring info with the given job name. ! * If there is an info association with this job name, that information * will be overriden. This could happen, if job forgot to unregister the * management and monitoring information. ! * </p> ! * * @param jobName Name of the job. * @param registrationInfo Information to be associated with this job name. * * @return Return true, if it could assosciate this information, false, otherwise. + * + * @throws IllegalArgumentException If input arguments jobname or registration information + * values are null. */ ! public abstract boolean registerJobMgmtMntrInfo(String jobName, final Object registrationInfo); /** *************** *** 162,165 **** --- 176,181 ---- * * @return Returns the registered information, null, if it doesnt find any information. + * + * @throws IllegalArgumentException If input argument job name is null. */ public abstract Object lookupJobMgmtMntrInfo(String jobName); *************** *** 171,174 **** --- 187,192 ---- * * @return Return true, it it could unregister the information, false, otherwise. + * + * @throws IllegalArgumentException If input argument job name is null. */ public abstract boolean unregisterJobMgmtMntrInfo(String jobName); *************** *** 181,186 **** * * @return Returns true if statistics can be logged into repository, false, otherwise. */ ! public abstract boolean logStatistics(JobStatistics statistics); /** --- 199,206 ---- * * @return Returns true if statistics can be logged into repository, false, otherwise. + * + * @throws IllegalArgumentException If input argument job statistics is null. */ ! public abstract boolean logStatistics(final JobStatistics statistics); /** *************** *** 188,199 **** * * @param jobName Name of the job for which statistics are required. ! * @return Returns the array of JobStatistics object, null, if it couldnt find any job with that name. */ public abstract JobStatistics[] getStatistics(String jobName); /** ! * Persist the controller in repository. This will be useful, when job wants to be restarted. * When controller receives stop signal from servier with restart flag, it persist itself into * the repository. * * @param jobName Name of the job --- 208,226 ---- * * @param jobName Name of the job for which statistics are required. ! * ! * @return Returns the array of JobStatistics object. zero length statistics array, if it doestnt find any. ! * ! * @throws IllegalArgumentException If input argument job name is null. */ public abstract JobStatistics[] getStatistics(String jobName); /** ! * <p> ! * Persist the controller in repository with the given job name. ! * If there are any controller entries with this job name, it removes them ! * first and then saves this controller. This will be useful, when job wants to be restarted. * When controller receives stop signal from servier with restart flag, it persist itself into * the repository. + * </p> * * @param jobName Name of the job *************** *** 201,214 **** * * @return Returns true, if it could persist the controller, false, otherwise. */ ! public abstract boolean saveController(String jobName, JobController controller); /** * Loads the controller assosicated with this job name in the repsoitory. When controller starts * execution, always, it looks into the reposiotry for restart. This can be overriden by passing addition * configuration property. ! * * @param jobName Name of the job. * @return Returns the controller object, null, if it couldnt find any. */ public abstract JobController loadController(String jobName); --- 228,248 ---- * * @return Returns true, if it could persist the controller, false, otherwise. + * + * @throws IllegalArgumentException If input arguments job name or controller is null. */ ! public abstract boolean saveController(String jobName, final JobController controller); /** + * <p> * Loads the controller assosicated with this job name in the repsoitory. When controller starts * execution, always, it looks into the reposiotry for restart. This can be overriden by passing addition * configuration property. ! * </p> ! * * @param jobName Name of the job. + * * @return Returns the controller object, null, if it couldnt find any. + * + * @throws IllegalArgumentException If input arguments job name is null. */ public abstract JobController loadController(String jobName); *************** *** 218,222 **** --- 252,259 ---- * * @param jobName Name of the job. + * * @return Returns true, if it could release the controller from repository, null, otherwise. + * + * @throws IllegalArgumentException If input arguments job name is null. */ public abstract boolean releaseController(String jobName); |