public class LockFreeAcquireJobsRunnable extends Object implements AcquireJobsRunnable
AcquireJobsRunnable implementation with sole purpose
of 'acquiring' jobs, which means setting the current job executor
name into the lock owner colum to 'acquire' it.
Later on, these jobs will be fetched and put on the work queue.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isInterrupted
Flag to indicate the runnable was interrupted
|
protected boolean |
isJobAdded
Flag to indicate a job was added (used when the runnable was sleeping, but a job was created by the engine)
|
protected AtomicBoolean |
isWaiting
Flag to indicate whether the runnable is currently waiting.
|
protected LockFreeJobExecutor |
jobExecutor
The job executor.
|
protected Object |
MONITOR
Monitor object to synchronize on.
|
| Constructor and Description |
|---|
LockFreeAcquireJobsRunnable(LockFreeJobExecutor jobExecutor) |
| Modifier and Type | Method and Description |
|---|---|
protected List<JobEntity> |
fetchJobs(int start) |
void |
jobWasAdded()
Called by the job executor when a new job was added by the
process engine to which this job executor belongs.
|
protected void |
putAcquiredJobsOnQueue() |
void |
run() |
protected void |
sleep() |
void |
stop()
Called when the job executor is shutting down and the job
acquiring needs to be shut down too.
|
protected final LockFreeJobExecutor jobExecutor
LockFreeJobExecutor implementationprotected volatile boolean isInterrupted
protected volatile boolean isJobAdded
protected final Object MONITOR
protected final AtomicBoolean isWaiting
public LockFreeAcquireJobsRunnable(LockFreeJobExecutor jobExecutor)
protected void sleep()
protected void putAcquiredJobsOnQueue()
public void stop()
AcquireJobsRunnablestop in interface AcquireJobsRunnablepublic void jobWasAdded()
AcquireJobsRunnablejobWasAdded in interface AcquireJobsRunnableCopyright © 2016 Alfresco. All rights reserved.