|
|||||||||||
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.jdbc.JdbcRepository
JdbcRepository implementation of repository uses any database that can be accessed by using
the JDBC technology. This looks for the properties "jdbc-driver-class-name","jdbc-url",
"username" and "password" in repository config in framework configuration contains the
values to establish the connection to implement the Repository.
Following is the example of repository configuration.
<repository-config repository-class-name="org.jmonks.batch.framework.repository.jdbc.JdbcRepository"> <property key="jdbc-driver-class-name">oracle.jdbc.driver.OracleDriver</property> <property key="jdbc-url">jdbc:oracle:thin:@hostname:1521:instancename</property> <property key="username">scott</property> <property key="password">tiger</property> </repository-config>
JOB_DATA_TRANSFER |
JOB_STATISTICS |
JOB_MGMT_MNTR_INFO |
Field Summary | |
protected java.util.Map |
jdbcConfigMap
Map holds the jdbc configuration. |
Fields inherited from class org.jmonks.batch.framework.Repository |
jobName |
Constructor Summary | |
JdbcRepository()
|
Method Summary | |
boolean |
clearDataTransferredFromThisJob()
This method will clear all the data that has been sent by this job to all the next jobs. |
protected java.lang.Object |
deserializeObjectFromInputStream(java.io.InputStream inputStream)
Deserializes the given inputstream and return the object. |
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)
Receives the jdbc configuration in a map from the factory method and validates the given configuration is valid by making a connection to the database. |
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. |
protected byte[] |
serializeObjectIntoByteArray(java.lang.Object object)
Serializes the given object and return that serialized data as byte array. |
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 |
protected java.util.Map jdbcConfigMap
Constructor Detail |
public JdbcRepository()
Method Detail |
protected void init(java.util.Map configProps)
Receives the jdbc configuration in a map from the factory method and validates the given configuration is valid by making a connection to the database.
init
in class Repository
configProps
- Map contains the jdbc configuration.
ConfigurationException
- If not able to get the connection by using the properties
given in the map.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 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 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)
public boolean unregisterJobMgmtMntrInfo()
Repository
unregisterJobMgmtMntrInfo
in class Repository
org.jmonks.batch.framework.repository.Repository#unregisterJobMgmtMntrInfo()
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)
protected byte[] serializeObjectIntoByteArray(java.lang.Object object)
object
- Object to be serialized.
protected java.lang.Object deserializeObjectFromInputStream(java.io.InputStream inputStream)
inputStream
- InputStream to be deserialized.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |