|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.controller.pool.CollectionJobPool
Provides the implementation of job pool using java utility collections.
This job pool implementation can be configured for any given job using the
following configuration in job configuration.
<job-pool job-pool-class-name="org.jmonks.batch.framework.controller.pool.CollectionJobPool"> <property key="job-pool-size">50000</property> </job-pool>
Field Summary | |
protected java.util.Map |
configProps
Map holds the configuration defined for the job pool. |
static int |
DEFAULT_COLLECTION_POOL_SIZE
Default collection pool size. |
protected long |
loadedJobsCount
Holds the number of job data objects have been loaded by job loader. |
protected EDU.oswego.cs.dl.util.concurrent.BoundedBuffer |
pool
Java utility collection holds the job data objects. |
protected static java.lang.String |
POOL_SIZE_PROPERTY_NAME
Property name by which pool size will be associated with. |
Constructor Summary | |
CollectionJobPool()
Default constructor for the instantiation purposes. |
Method Summary | |
void |
cleanup()
Removes all the entries from collection. |
long |
getLoadedJobDataCount()
Returns the number of job data objects being loaded into the pool. |
java.lang.Object |
getNextJobData()
Gets the next available job data(piece of information) to be processed. |
void |
initialize(JobContext jobContext)
Initializes the collection job pool using the configuration defined in the job configuration. |
boolean |
loadJobData(java.lang.Object jobData)
Job Loader will use this API to load the job data into the pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_COLLECTION_POOL_SIZE
protected static final java.lang.String POOL_SIZE_PROPERTY_NAME
protected java.util.Map configProps
protected EDU.oswego.cs.dl.util.concurrent.BoundedBuffer pool
protected long loadedJobsCount
Constructor Detail |
public CollectionJobPool()
Method Detail |
public boolean loadJobData(java.lang.Object jobData)
JobPool
loadJobData
in interface JobPool
jobData
- Job data needs to be processed.JobPool.loadJobData(Object)
public java.lang.Object getNextJobData()
JobPool
getNextJobData
in interface JobPool
JobPool.getNextJobData()
public void initialize(JobContext jobContext)
initialize
in interface JobPool
jobContext
- Context of the job being run.public void cleanup()
cleanup
in interface JobPool
public long getLoadedJobDataCount()
JobPool
getLoadedJobDataCount
in interface JobPool
JobPool.getLoadedJobDataCount()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |