|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.model.OptionalIdentifiedDefinition<Type> org.apache.camel.model.ProcessorDefinition<Type> org.apache.camel.model.OutputDefinition<ThreadsDefinition> org.apache.camel.model.ThreadsDefinition
public class ThreadsDefinition
Represents an XML <threads/> element
Field Summary |
---|
Fields inherited from class org.apache.camel.model.OutputDefinition |
---|
outputs |
Fields inherited from class org.apache.camel.model.ProcessorDefinition |
---|
inheritErrorHandler, log |
Constructor Summary | |
---|---|
ThreadsDefinition()
|
Method Summary | |
---|---|
ThreadsDefinition |
callerRunsWhenRejected(boolean callerRunsWhenRejected)
Whether or not the caller should run the task when it was rejected by the thread pool. |
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor based on the definition model. |
ThreadsDefinition |
executorService(ExecutorService executorService)
Setting the executor service for executing |
ThreadsDefinition |
executorServiceRef(String executorServiceRef)
Setting the executor service for executing |
Boolean |
getCallerRunsWhenRejected()
|
ExecutorService |
getExecutorService()
Gets the executor service |
String |
getExecutorServiceRef()
Gets the reference to lookup in the Registry for the executor service to be used. |
Long |
getKeepAliveTime()
|
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node |
Integer |
getMaxPoolSize()
|
Integer |
getMaxQueueSize()
|
Integer |
getPoolSize()
|
ThreadPoolRejectedPolicy |
getRejectedPolicy()
|
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images |
String |
getThreadName()
|
TimeUnit |
getTimeUnit()
|
ThreadsDefinition |
keepAliveTime(long keepAliveTime)
Sets the keep alive time for idle threads |
ThreadsDefinition |
maxPoolSize(int maxPoolSize)
Sets the maximum pool size for the underlying ExecutorService . |
ThreadsDefinition |
maxQueueSize(int maxQueueSize)
Sets the maximum number of tasks in the work queue. |
ThreadsDefinition |
poolSize(int poolSize)
Sets the core pool size for the underlying ExecutorService . |
ThreadsDefinition |
rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
Sets the handler for tasks which cannot be executed by the thread pool. |
void |
setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)
|
void |
setExecutorService(ExecutorService executorService)
Sets the executor service to be used. |
void |
setExecutorServiceRef(String executorServiceRef)
Sets a reference to lookup in the Registry for the executor service to be used. |
void |
setKeepAliveTime(Long keepAliveTime)
|
void |
setMaxPoolSize(Integer maxPoolSize)
|
void |
setMaxQueueSize(Integer maxQueueSize)
|
void |
setPoolSize(Integer poolSize)
|
void |
setRejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
|
void |
setThreadName(String threadName)
|
void |
setTimeUnit(TimeUnit timeUnit)
|
ThreadsDefinition |
threadName(String threadName)
Sets the thread name to use. |
ThreadsDefinition |
timeUnit(TimeUnit keepAliveTimeUnits)
Sets the keep alive time unit. |
String |
toString()
|
Methods inherited from class org.apache.camel.model.OutputDefinition |
---|
getOutputs, isOutputSupported, setOutputs |
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition |
---|
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThreadsDefinition()
Method Detail |
---|
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<ThreadsDefinition>
Exception
public String getLabel()
ProcessorDefinition
getLabel
in class ProcessorDefinition<ThreadsDefinition>
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class OutputDefinition<ThreadsDefinition>
public String toString()
toString
in class OutputDefinition<ThreadsDefinition>
public ThreadsDefinition executorService(ExecutorService executorService)
ExecutorServiceAwareDefinition
executorService
in interface ExecutorServiceAwareDefinition<ThreadsDefinition>
executorService
- the executor service
public ThreadsDefinition executorServiceRef(String executorServiceRef)
ExecutorServiceAwareDefinition
executorServiceRef
in interface ExecutorServiceAwareDefinition<ThreadsDefinition>
executorServiceRef
- reference for a ExecutorService
to lookup in the Registry
public ThreadsDefinition poolSize(int poolSize)
ExecutorService
.
poolSize
- the core pool size to keep minimum in the pool
public ThreadsDefinition maxPoolSize(int maxPoolSize)
ExecutorService
.
maxPoolSize
- the maximum pool size
public ThreadsDefinition keepAliveTime(long keepAliveTime)
keepAliveTime
- keep alive time
public ThreadsDefinition timeUnit(TimeUnit keepAliveTimeUnits)
keepAliveTimeUnits
- time unit
public ThreadsDefinition maxQueueSize(int maxQueueSize)
maxQueueSize
- the max queue size
public ThreadsDefinition rejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
rejectedPolicy
- the policy for the handler
public ThreadsDefinition threadName(String threadName)
threadName
- the thread name
public ThreadsDefinition callerRunsWhenRejected(boolean callerRunsWhenRejected)
callerRunsWhenRejected
- whether or not the caller should run
public ExecutorService getExecutorService()
ExecutorServiceAware
getExecutorService
in interface ExecutorServiceAware
public void setExecutorService(ExecutorService executorService)
ExecutorServiceAware
setExecutorService
in interface ExecutorServiceAware
executorService
- the executorpublic String getExecutorServiceRef()
ExecutorServiceAware
Registry
for the executor service to be used.
getExecutorServiceRef
in interface ExecutorServiceAware
public void setExecutorServiceRef(String executorServiceRef)
ExecutorServiceAware
Registry
for the executor service to be used.
setExecutorServiceRef
in interface ExecutorServiceAware
executorServiceRef
- reference for the executorpublic Integer getPoolSize()
public void setPoolSize(Integer poolSize)
public Integer getMaxPoolSize()
public void setMaxPoolSize(Integer maxPoolSize)
public Long getKeepAliveTime()
public void setKeepAliveTime(Long keepAliveTime)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public Integer getMaxQueueSize()
public void setMaxQueueSize(Integer maxQueueSize)
public String getThreadName()
public void setThreadName(String threadName)
public ThreadPoolRejectedPolicy getRejectedPolicy()
public void setRejectedPolicy(ThreadPoolRejectedPolicy rejectedPolicy)
public Boolean getCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |