Class DefaultAsyncJobExecutor

    • Field Detail

      • corePoolSize

        protected int corePoolSize
        The minimal number of threads that are kept alive in the threadpool for job execution
      • maxPoolSize

        protected int maxPoolSize
        The maximum number of threads that are kept alive in the threadpool for job execution
      • keepAliveTime

        protected long keepAliveTime
        The time (in milliseconds) a thread used for job execution must be kept alive before it is destroyed. Default setting is 0. Having a non-default setting of 0 takes resources, but in the case of many job executions it avoids creating new threads all the time.
      • queueSize

        protected int queueSize
        The size of the queue on which jobs to be executed are placed
      • threadPoolQueue

        protected java.util.concurrent.BlockingQueue<java.lang.Runnable> threadPoolQueue
        The queue used for job execution work
      • executorService

        protected java.util.concurrent.ExecutorService executorService
        The executor service used for job execution
      • secondsToWaitOnShutdown

        protected long secondsToWaitOnShutdown
        The time (in seconds) that is waited to gracefully shut down the threadpool used for job execution
      • timerJobAcquisitionThread

        protected java.lang.Thread timerJobAcquisitionThread
      • asyncJobAcquisitionThread

        protected java.lang.Thread asyncJobAcquisitionThread
      • resetExpiredJobThread

        protected java.lang.Thread resetExpiredJobThread
      • isAutoActivate

        protected boolean isAutoActivate
      • isActive

        protected boolean isActive
      • isMessageQueueMode

        protected boolean isMessageQueueMode
      • maxTimerJobsPerAcquisition

        protected int maxTimerJobsPerAcquisition
      • maxAsyncJobsDuePerAcquisition

        protected int maxAsyncJobsDuePerAcquisition
      • defaultTimerJobAcquireWaitTimeInMillis

        protected int defaultTimerJobAcquireWaitTimeInMillis
      • defaultAsyncJobAcquireWaitTimeInMillis

        protected int defaultAsyncJobAcquireWaitTimeInMillis
      • defaultQueueSizeFullWaitTime

        protected int defaultQueueSizeFullWaitTime
      • lockOwner

        protected java.lang.String lockOwner
      • timerLockTimeInMillis

        protected int timerLockTimeInMillis
      • asyncJobLockTimeInMillis

        protected int asyncJobLockTimeInMillis
      • retryWaitTimeInMillis

        protected int retryWaitTimeInMillis
      • resetExpiredJobsInterval

        protected int resetExpiredJobsInterval
      • resetExpiredJobsPageSize

        protected int resetExpiredJobsPageSize
      • temporaryJobQueue

        protected java.util.LinkedList<Job> temporaryJobQueue
    • Constructor Detail

      • DefaultAsyncJobExecutor

        public DefaultAsyncJobExecutor()
    • Method Detail

      • createRunnableForJob

        protected java.lang.Runnable createRunnableForJob​(Job job)
      • start

        public void start()
        Starts the async executor
        Specified by:
        start in interface AsyncExecutor
      • executeTemporaryJobs

        protected void executeTemporaryJobs()
      • shutdown

        public void shutdown()
        Shuts down the whole job executor
        Specified by:
        shutdown in interface AsyncExecutor
      • initAsyncJobExecutionThreadPool

        protected void initAsyncJobExecutionThreadPool()
      • stopExecutingAsyncJobs

        protected void stopExecutingAsyncJobs()
      • startJobAcquisitionThread

        protected void startJobAcquisitionThread()
        Starts the acquisition thread
      • startTimerAcquisitionThread

        protected void startTimerAcquisitionThread()
      • stopJobAcquisitionThread

        protected void stopJobAcquisitionThread()
        Stops the acquisition thread
      • stopTimerAcquisitionThread

        protected void stopTimerAcquisitionThread()
      • startResetExpiredJobsThread

        protected void startResetExpiredJobsThread()
        Starts the reset expired jobs thread
      • stopResetExpiredJobsThread

        protected void stopResetExpiredJobsThread()
        Stops the reset expired jobs thread
      • getTimerJobAcquisitionThread

        public java.lang.Thread getTimerJobAcquisitionThread()
      • setTimerJobAcquisitionThread

        public void setTimerJobAcquisitionThread​(java.lang.Thread timerJobAcquisitionThread)
      • getAsyncJobAcquisitionThread

        public java.lang.Thread getAsyncJobAcquisitionThread()
      • setAsyncJobAcquisitionThread

        public void setAsyncJobAcquisitionThread​(java.lang.Thread asyncJobAcquisitionThread)
      • getResetExpiredJobThread

        public java.lang.Thread getResetExpiredJobThread()
      • setResetExpiredJobThread

        public void setResetExpiredJobThread​(java.lang.Thread resetExpiredJobThread)
      • isMessageQueueMode

        public boolean isMessageQueueMode()
      • setMessageQueueMode

        public void setMessageQueueMode​(boolean isMessageQueueMode)
      • getQueueSize

        public int getQueueSize()
      • setQueueSize

        public void setQueueSize​(int queueSize)
      • getCorePoolSize

        public int getCorePoolSize()
      • setCorePoolSize

        public void setCorePoolSize​(int corePoolSize)
      • getMaxPoolSize

        public int getMaxPoolSize()
      • setMaxPoolSize

        public void setMaxPoolSize​(int maxPoolSize)
      • getKeepAliveTime

        public long getKeepAliveTime()
      • setKeepAliveTime

        public void setKeepAliveTime​(long keepAliveTime)
      • getSecondsToWaitOnShutdown

        public long getSecondsToWaitOnShutdown()
      • setSecondsToWaitOnShutdown

        public void setSecondsToWaitOnShutdown​(long secondsToWaitOnShutdown)
      • getThreadPoolQueue

        public java.util.concurrent.BlockingQueue<java.lang.Runnable> getThreadPoolQueue()
      • setThreadPoolQueue

        public void setThreadPoolQueue​(java.util.concurrent.BlockingQueue<java.lang.Runnable> threadPoolQueue)
      • getExecutorService

        public java.util.concurrent.ExecutorService getExecutorService()
      • setExecutorService

        public void setExecutorService​(java.util.concurrent.ExecutorService executorService)
      • setLockOwner

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

        public void setResetExpiredJobsRunnable​(ResetExpiredJobsRunnable resetExpiredJobsRunnable)
      • setExecuteAsyncRunnableFactory

        public void setExecuteAsyncRunnableFactory​(ExecuteAsyncRunnableFactory executeAsyncRunnableFactory)