org.apache.servicemix.executors.impl
Class ExecutorConfig

java.lang.Object
  extended by org.apache.servicemix.executors.impl.ExecutorConfig

public class ExecutorConfig
extends java.lang.Object

This bean holds configuration attributes for a given Executor.

Author:
Guillaume Nodet

Field Summary
static java.lang.Boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT
           
static java.lang.Boolean DEFAULT_BYPASS_IF_SYNCHRONOUS
           
static java.lang.Integer DEFAULT_CORE_POOL_SIZE
           
static java.lang.Long DEFAULT_KEEP_ALIVE_TIME
           
static java.lang.Integer DEFAULT_MAXIMUM_POOL_SIZE
           
static java.lang.Integer DEFAULT_QUEUE_SIZE
           
static java.lang.Long DEFAULT_SHUTDOWN_DELAY
           
static java.lang.Boolean DEFAULT_THREAD_DAEMON
           
static java.lang.Integer DEFAULT_THREAD_PRIORITY
           
 
Constructor Summary
ExecutorConfig()
          default constructor needed by spring beans
ExecutorConfig(boolean isDefaultConfig, ExecutorConfig parent)
          creates a new executor config using the given parent
 
Method Summary
static ExecutorConfig create(java.util.Map<java.lang.String,java.lang.Object> options, ExecutorConfig parent)
          Create an ExecutorConfig instance based on the information in the options map.
 java.lang.Integer getCorePoolSize()
           
 java.lang.Long getKeepAliveTime()
           
 java.lang.Integer getMaximumPoolSize()
           
 ExecutorConfig getParent()
           
 java.lang.Integer getQueueSize()
           
 java.lang.Long getShutdownDelay()
           
 java.lang.Integer getThreadPriority()
           
 java.lang.Boolean isAllowCoreThreadTimeOut()
           
 java.lang.Boolean isBypassIfSynchronous()
           
 java.lang.Boolean isThreadDaemon()
           
 void setAllowCoreThreadTimeOut(java.lang.Boolean allowCoreThreadTimeOut)
           
 void setBypassIfSynchronous(java.lang.Boolean bypassIfSynchronous)
           
 void setCorePoolSize(java.lang.Integer corePoolSize)
           
 void setKeepAliveTime(java.lang.Long keepAlive)
           
 void setMaximumPoolSize(java.lang.Integer maximumPoolSize)
           
 void setParent(ExecutorConfig parent)
           
 void setQueueSize(java.lang.Integer queueSize)
           
 void setShutdownDelay(java.lang.Long shutdownDelay)
           
 void setThreadDaemon(java.lang.Boolean threadDaemon)
           
 void setThreadPriority(java.lang.Integer threadPriority)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CORE_POOL_SIZE

public static final java.lang.Integer DEFAULT_CORE_POOL_SIZE

DEFAULT_MAXIMUM_POOL_SIZE

public static final java.lang.Integer DEFAULT_MAXIMUM_POOL_SIZE

DEFAULT_KEEP_ALIVE_TIME

public static final java.lang.Long DEFAULT_KEEP_ALIVE_TIME

DEFAULT_THREAD_DAEMON

public static final java.lang.Boolean DEFAULT_THREAD_DAEMON

DEFAULT_THREAD_PRIORITY

public static final java.lang.Integer DEFAULT_THREAD_PRIORITY

DEFAULT_QUEUE_SIZE

public static final java.lang.Integer DEFAULT_QUEUE_SIZE

DEFAULT_SHUTDOWN_DELAY

public static final java.lang.Long DEFAULT_SHUTDOWN_DELAY

DEFAULT_ALLOW_CORE_THREAD_TIMEOUT

public static final java.lang.Boolean DEFAULT_ALLOW_CORE_THREAD_TIMEOUT

DEFAULT_BYPASS_IF_SYNCHRONOUS

public static final java.lang.Boolean DEFAULT_BYPASS_IF_SYNCHRONOUS
Constructor Detail

ExecutorConfig

public ExecutorConfig()
default constructor needed by spring beans


ExecutorConfig

public ExecutorConfig(boolean isDefaultConfig,
                      ExecutorConfig parent)
creates a new executor config using the given parent

Parameters:
parent - the parent config
Method Detail

getCorePoolSize

public java.lang.Integer getCorePoolSize()
Returns:
the corePoolSize

setCorePoolSize

public void setCorePoolSize(java.lang.Integer corePoolSize)
Parameters:
corePoolSize - the corePoolSize to set

getKeepAliveTime

public java.lang.Long getKeepAliveTime()
Returns:
the keepAlive

setKeepAliveTime

public void setKeepAliveTime(java.lang.Long keepAlive)
Parameters:
keepAlive - the keepAlive to set

getMaximumPoolSize

public java.lang.Integer getMaximumPoolSize()
Returns:
the maximumPoolSize

setMaximumPoolSize

public void setMaximumPoolSize(java.lang.Integer maximumPoolSize)
Parameters:
maximumPoolSize - the maximumPoolSize to set

getQueueSize

public java.lang.Integer getQueueSize()
Returns:
the queueSize

setQueueSize

public void setQueueSize(java.lang.Integer queueSize)
Parameters:
queueSize - the queueSize to set

isThreadDaemon

public java.lang.Boolean isThreadDaemon()
Returns:
the threadDaemon

setThreadDaemon

public void setThreadDaemon(java.lang.Boolean threadDaemon)
Parameters:
threadDaemon - the threadDaemon to set

getThreadPriority

public java.lang.Integer getThreadPriority()
Returns:
the threadPriority

setThreadPriority

public void setThreadPriority(java.lang.Integer threadPriority)
Parameters:
threadPriority - the threadPriority to set

getShutdownDelay

public java.lang.Long getShutdownDelay()
Returns:
the shutdownDelay

setShutdownDelay

public void setShutdownDelay(java.lang.Long shutdownDelay)
Parameters:
shutdownDelay - the shutdownDelay to set

isAllowCoreThreadTimeOut

public java.lang.Boolean isAllowCoreThreadTimeOut()
Returns:
the allowCoreThreadTimeOut

setAllowCoreThreadTimeOut

public void setAllowCoreThreadTimeOut(java.lang.Boolean allowCoreThreadTimeOut)
Parameters:
allowCoreThreadTimeOut - the allowCoreThreadTimeOut to set

isBypassIfSynchronous

public java.lang.Boolean isBypassIfSynchronous()
Returns:
if synchronous tasks should bypass the executor

setBypassIfSynchronous

public void setBypassIfSynchronous(java.lang.Boolean bypassIfSynchronous)
Parameters:
bypassIfSynchronous - if synchronous tasks should bypass the executor

getParent

public ExecutorConfig getParent()

setParent

public void setParent(ExecutorConfig parent)

create

public static ExecutorConfig create(java.util.Map<java.lang.String,java.lang.Object> options,
                                    ExecutorConfig parent)
Create an ExecutorConfig instance based on the information in the options map.

Parameters:
options - the map of executor configuration options that will get set on the ExecutorConfig instance
parent - (optionally) the parent ExecutorConfig instance
Returns:
the configured instance


Copyright © 2005-2011 FuseSource. All Rights Reserved.