|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.Repository org.jmonks.batch.framework.repository.db4o.Db4oRepository
This implementation of repository uses the DB4O database as the repository.
It expects the property repository-location present in the repository configuration
in framework-cofig.xml file. The value of this property should be a valid directory name.
If directory doesnt exist, it will try to create directory with that path.
<repository-config repository-class-name="org.jmonks.batch.framework.repository.db4o.Db4oRepository"> <property key="db4o-directory">/batchserver/repository</property> </repository-config>
Field Summary | |
static java.lang.String |
DB4O_REPOSITORY_FILENAME
Name of the DB4O repository file name which is batchserver_repository.db . |
static java.lang.String |
PROPERTY_DB4O_DIRECTORY
Property identifies the db4o directory name which is db4o-directory . |
protected java.util.Map |
repositoryConfigProperties
Map holds the configuration properties of repository. |
Fields inherited from class org.jmonks.batch.framework.Repository |
jobName |
Constructor Summary | |
Db4oRepository()
Do not use this constructor to instantiate Db4oRepository directly. |
Method Summary | |
boolean |
clearDataTransferredFromThisJob()
This method will clear all the data that has been sent by this job to all the next jobs. |
protected com.db4o.ObjectContainer |
createContainer(java.util.Map configProps)
Creates the container by looking at the configuration from given Map. |
java.lang.Object |
getDataFromPreviousJob(java.lang.String dataIdentifier,
java.lang.String previousJobName)
Gets the data that has been sent by the previous job with the given data identifier. |
protected void |
init(java.util.Map configProps)
Initializes the Db4oRepository by accepting the map consist of properties needed to setup the repository. |
boolean |
logStatistics(JobStatistics statistics)
Logs the job statistics given in the form of JobStatistics object in the repository for further use/references. |
boolean |
registerJobMgmtMntrInfo(java.lang.Object registrationInfo)
Registers the given job management and monitoring information to this job. |
boolean |
sendDataToNextJob(java.lang.String dataIdentifier,
java.lang.String nextJobName,
java.lang.Object data)
Data will be send to the specified next job and will be identified with the given identifier. |
boolean |
unregisterJobMgmtMntrInfo()
Unregisters the job management and monitoring information assosciated with this job. |
Methods inherited from class org.jmonks.batch.framework.Repository |
createRepository |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY_DB4O_DIRECTORY
db4o-directory
.
public static final java.lang.String DB4O_REPOSITORY_FILENAME
batchserver_repository.db
.
protected java.util.Map repositoryConfigProperties
Constructor Detail |
public Db4oRepository()
Do not use this constructor to instantiate Db4oRepository directly. Access the repository only through the JobContext reference. This constructor has been provided to make sure this should be instantiable and accessible to the Repository class.
Method Detail |
protected void init(java.util.Map configProps)
Initializes the Db4oRepository by accepting the map consist of properties needed to setup the repository. This validates for db4o-directory property has been defined and the value defined for this property is valid. If the configured directory name is not exists, it tries to create that directory.
init
in class Repository
configProps
- Map contains the configuration properties.
ConfigurationException
- If db4o-directory property is not defined and
the value specified is a file and not existing directory could not be created.
java.lang.IllegalArgumentException
- If given configProps is null.protected com.db4o.ObjectContainer createContainer(java.util.Map configProps)
public boolean sendDataToNextJob(java.lang.String dataIdentifier, java.lang.String nextJobName, java.lang.Object data)
Repository
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.
sendDataToNextJob
in class Repository
dataIdentifier
- Identifier to be used to exchange the data between two jobs.nextJobName
- Name of the next job this data to be send.data
- Data that needs to be send as the object.
Repository#sendDataToNextJob(String,String,Object)
public java.lang.Object getDataFromPreviousJob(java.lang.String dataIdentifier, java.lang.String previousJobName)
Repository
getDataFromPreviousJob
in class Repository
dataIdentifier
- Identifier tied to the data that has been sent.previousJobName
- Name of the previous job sent the data to this job.
org.jmonks.batch.framework.repository.Repository#getDataFromPreviousJob(String,String)
public boolean clearDataTransferredFromThisJob()
Repository
This method will clear all the data that has been sent by this job to all the next jobs.
clearDataTransferredFromThisJob
in class Repository
org.jmonks.batch.framework.repository.Repository#clearDataTransferredToNextJob()
public boolean registerJobMgmtMntrInfo(java.lang.Object registrationInfo)
Repository
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.
registerJobMgmtMntrInfo
in class Repository
registrationInfo
- Information to be associated with the job.
org.jmonks.batch.framework.repository.Repository#registerJobMgmtMntrInfo(Object)
public boolean unregisterJobMgmtMntrInfo()
Repository
unregisterJobMgmtMntrInfo
in class Repository
org.jmonks.batch.framework.repository.Repository#unregisterJobMgmtMntrInfo()
public boolean logStatistics(JobStatistics statistics)
Repository
Logs the job statistics given in the form of JobStatistics object in the repository for further use/references.
logStatistics
in class Repository
statistics
- Job Statistics object which holds all the statistics related to that job.
org.jmonks.batch.framework.repository.Repository#logStatistics(org.jmonks.batch.framework.JobStatistics)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |