Class JobExecutor

    • Field Detail

      • name

        protected java.lang.String name
      • jobAcquisitionThread

        protected java.lang.Thread jobAcquisitionThread
      • isAutoActivate

        protected boolean isAutoActivate
      • isActive

        protected boolean isActive
      • maxJobsPerAcquisition

        protected int maxJobsPerAcquisition
      • waitTimeInMillis

        protected int waitTimeInMillis
      • waitIncreaseFactor

        protected float waitIncreaseFactor
      • maxWait

        protected long maxWait
      • backoffTimeInMillis

        protected int backoffTimeInMillis
      • maxBackoff

        protected long maxBackoff
      • backoffDecreaseThreshold

        protected int backoffDecreaseThreshold
        The number of job acquisition cycles without locking failures until the backoff level is reduced.
      • lockOwner

        protected java.lang.String lockOwner
      • lockTimeInMillis

        protected int lockTimeInMillis
    • Constructor Detail

      • JobExecutor

        public JobExecutor()
    • Method Detail

      • start

        public void start()
      • shutdown

        public void shutdown()
      • ensureInitialization

        protected void ensureInitialization()
      • ensureCleanup

        protected void ensureCleanup()
      • jobWasAdded

        public void jobWasAdded()
      • registerProcessEngine

        public void registerProcessEngine​(ProcessEngineImpl processEngine)
      • unregisterProcessEngine

        public void unregisterProcessEngine​(ProcessEngineImpl processEngine)
      • startExecutingJobs

        protected abstract void startExecutingJobs()
      • stopExecutingJobs

        protected abstract void stopExecutingJobs()
      • executeJobs

        public abstract void executeJobs​(java.util.List<java.lang.String> jobIds,
                                         ProcessEngineImpl processEngine)
      • executeJobs

        @Deprecated
        public void executeJobs​(java.util.List<java.lang.String> jobIds)
        Deprecated.
        Deprecated: use executeJobs(List, ProcessEngineImpl) instead
        Parameters:
        jobIds -
      • logAcquisitionAttempt

        public void logAcquisitionAttempt​(ProcessEngineImpl engine)
      • logAcquiredJobs

        public void logAcquiredJobs​(ProcessEngineImpl engine,
                                    int numJobs)
      • logAcquisitionFailureJobs

        public void logAcquisitionFailureJobs​(ProcessEngineImpl engine,
                                              int numJobs)
      • logRejectedExecution

        public void logRejectedExecution​(ProcessEngineImpl engine,
                                         int numJobs)
      • engineIterator

        public java.util.Iterator<ProcessEngineImpl> engineIterator()
        Must return an iterator of registered process engines that is independent of concurrent modifications to the underlying data structure of engines.
      • hasRegisteredEngine

        public boolean hasRegisteredEngine​(ProcessEngineImpl engine)
      • getWaitTimeInMillis

        public int getWaitTimeInMillis()
      • setWaitTimeInMillis

        public void setWaitTimeInMillis​(int waitTimeInMillis)
      • getBackoffTimeInMillis

        public int getBackoffTimeInMillis()
      • setBackoffTimeInMillis

        public void setBackoffTimeInMillis​(int backoffTimeInMillis)
      • getLockTimeInMillis

        public int getLockTimeInMillis()
      • setLockTimeInMillis

        public void setLockTimeInMillis​(int lockTimeInMillis)
      • getLockOwner

        public java.lang.String getLockOwner()
      • setLockOwner

        public void setLockOwner​(java.lang.String lockOwner)
      • isAutoActivate

        public boolean isAutoActivate()
      • setProcessEngines

        public void setProcessEngines​(java.util.List<ProcessEngineImpl> processEngines)
      • setAutoActivate

        public void setAutoActivate​(boolean isAutoActivate)
      • getMaxJobsPerAcquisition

        public int getMaxJobsPerAcquisition()
      • setMaxJobsPerAcquisition

        public void setMaxJobsPerAcquisition​(int maxJobsPerAcquisition)
      • getWaitIncreaseFactor

        public float getWaitIncreaseFactor()
      • setWaitIncreaseFactor

        public void setWaitIncreaseFactor​(float waitIncreaseFactor)
      • getMaxWait

        public long getMaxWait()
      • setMaxWait

        public void setMaxWait​(long maxWait)
      • getMaxBackoff

        public long getMaxBackoff()
      • setMaxBackoff

        public void setMaxBackoff​(long maxBackoff)
      • getBackoffDecreaseThreshold

        public int getBackoffDecreaseThreshold()
      • setBackoffDecreaseThreshold

        public void setBackoffDecreaseThreshold​(int backoffDecreaseThreshold)
      • getName

        public java.lang.String getName()
      • isActive

        public boolean isActive()
      • setRejectedJobsHandler

        public void setRejectedJobsHandler​(RejectedJobsHandler rejectedJobsHandler)
      • startJobAcquisitionThread

        protected void startJobAcquisitionThread()
      • stopJobAcquisitionThread

        protected void stopJobAcquisitionThread()
      • getExecuteJobsRunnable

        public java.lang.Runnable getExecuteJobsRunnable​(java.util.List<java.lang.String> jobIds,
                                                         ProcessEngineImpl processEngine)