Class StandardThreadExecutor

    • Field Detail

      • threadPriority

        protected int threadPriority
        Default thread priority
      • daemon

        protected boolean daemon
        Run threads in daemon or non-daemon state
      • namePrefix

        protected java.lang.String namePrefix
        Default name prefix for the thread name
      • maxThreads

        protected int maxThreads
        max number of threads
      • minSpareThreads

        protected int minSpareThreads
        min number of threads
      • maxIdleTime

        protected int maxIdleTime
        idle time in milliseconds
      • name

        protected java.lang.String name
        the name of this thread pool
      • maxQueueSize

        protected int maxQueueSize
        The maximum number of elements that can queue up before we reject them
      • threadRenewalDelay

        protected long threadRenewalDelay
        After a context is stopped, threads in the pool are renewed. To avoid renewing all threads at the same time, this delay is observed between 2 threads being renewed.
    • Constructor Detail

      • StandardThreadExecutor

        public StandardThreadExecutor()
    • Method Detail

      • execute

        public void execute​(java.lang.Runnable command,
                            long timeout,
                            java.util.concurrent.TimeUnit unit)
        Description copied from interface: Executor
        Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation. If no threads are available, it will be added to the work queue. If the work queue is full, the system will wait for the specified time until it throws a RejectedExecutionException
        Specified by:
        execute in interface Executor
        command - the runnable task
        timeout - the length of time to wait for the task to complete
        unit - the units in which timeout is expressed
      • execute

        public void execute​(java.lang.Runnable command)
        Specified by:
        execute in interface java.util.concurrent.Executor
      • contextStopping

        public void contextStopping()
      • getThreadPriority

        public int getThreadPriority()
      • isDaemon

        public boolean isDaemon()
      • getNamePrefix

        public java.lang.String getNamePrefix()
      • getMaxIdleTime

        public int getMaxIdleTime()
      • getMinSpareThreads

        public int getMinSpareThreads()
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Executor
      • setThreadPriority

        public void setThreadPriority​(int threadPriority)
      • setDaemon

        public void setDaemon​(boolean daemon)
      • setNamePrefix

        public void setNamePrefix​(java.lang.String namePrefix)
      • setMaxIdleTime

        public void setMaxIdleTime​(int maxIdleTime)
      • setMaxThreads

        public void setMaxThreads​(int maxThreads)
      • setMinSpareThreads

        public void setMinSpareThreads​(int minSpareThreads)
      • setName

        public void setName​(java.lang.String name)
      • setMaxQueueSize

        public void setMaxQueueSize​(int size)
      • getMaxQueueSize

        public int getMaxQueueSize()
      • getThreadRenewalDelay

        public long getThreadRenewalDelay()
      • setThreadRenewalDelay

        public void setThreadRenewalDelay​(long threadRenewalDelay)
      • getActiveCount

        public int getActiveCount()
        Description copied from interface: ResizableExecutor
        Returns the approximate number of threads that are actively executing tasks.
        Specified by:
        getActiveCount in interface ResizableExecutor
        the number of threads
      • getCompletedTaskCount

        public long getCompletedTaskCount()
      • getCorePoolSize

        public int getCorePoolSize()
      • getLargestPoolSize

        public int getLargestPoolSize()
      • getPoolSize

        public int getPoolSize()
        Description copied from interface: ResizableExecutor
        Returns the current number of threads in the pool.
        Specified by:
        getPoolSize in interface ResizableExecutor
        the number of threads
      • getQueueSize

        public int getQueueSize()
      • resizePool

        public boolean resizePool​(int corePoolSize,
                                  int maximumPoolSize)
        Specified by:
        resizePool in interface ResizableExecutor
      • getDomainInternal

        protected java.lang.String getDomainInternal()
        Description copied from class: LifecycleMBeanBase
        Method implemented by sub-classes to identify the domain in which MBeans should be registered.
        Specified by:
        getDomainInternal in class LifecycleMBeanBase
        The name of the domain to use to register MBeans.
      • getObjectNameKeyProperties

        protected java.lang.String getObjectNameKeyProperties()
        Description copied from class: LifecycleMBeanBase
        Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.
        Specified by:
        getObjectNameKeyProperties in class LifecycleMBeanBase
        The string representation of the key properties component of the desired ObjectName