|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.config.JobConfigFactory org.jmonks.batch.framework.config.db.DBJobConfigFactory
DBJobConfigFactory reads the job configuration from defined database to create the configuration objects needed by the job. This factory looks for few properties in the factory config properties map to identify the database it needs to connect to. This factory looks for the job configuration in the job-config table in the database. Controller configuration will be defined in a seperate tables, and DBJobControllerConfig is responsible to read the job controller configuration from the database.
This factory looks for the properties "jdbc-driver-class-name","jdbc-url",
"username" and "password" in job config factory config in framework configuration to
establish the connection to read the job configuration. If any one of the properties
are missing, it throws ConfigurationException. Following example shows, how it can
be configured for Oracle database.
<job-config-factory-config job-config-factory-class-name="org.jmonks.batch.framework.config.db.DBJobConfigFactory"> <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> </job-config-factory-config>
JOB_CONFIG |
JOB_LOGGING_CONFIG |
BASIC_JOB_CONTROLLER_CONFIG |
POOL_JOB_CONTROLLER_CONFIG |
Constructor Summary | |
DBJobConfigFactory()
Do not use this constructor to instantiate DBJobConfigFactory directly. |
Method Summary | |
JobConfig |
getJobConfig(java.lang.String jobName)
Returns the requested job configuration as JobConfig object. |
protected void |
init(java.util.Map configFactoryProps)
This method initializes the factory by accepting the required properties as a map. |
Methods inherited from class org.jmonks.batch.framework.config.JobConfigFactory |
getJobConfigFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DBJobConfigFactory()
Do not use this constructor to instantiate DBJobConfigFactory directly. Use the factory method getJobConfigFactory in JobConfigFactory class to get the config factory instance. This constructor has been provided to make sure this should be instantiable and accessible to the JobConfigFactory class.
Method Detail |
protected void init(java.util.Map configFactoryProps)
init
in class JobConfigFactory
configFactoryProps
- Map consists of all the properties defined for this factory.
ConfigurationException
- If required properties are missing.public JobConfig getJobConfig(java.lang.String jobName)
getJobConfig
in class JobConfigFactory
jobName
- Name of the job.
java.lang.IllegalArgumentException
- If jobName passed as parameter is null.
java.lang.IllegalStateException
- If factory is not initialized properly.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |