|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.model.OptionalIdentifiedDefinition
org.apache.camel.model.ProcessorDefinition<ExpressionNode>
org.apache.camel.model.ExpressionNode
org.apache.camel.model.ThrottleDefinition
public class ThrottleDefinition
Represents an XML <throttle/> element
Field Summary |
---|
Fields inherited from class org.apache.camel.model.ProcessorDefinition |
---|
inheritErrorHandler, log |
Constructor Summary | |
---|---|
ThrottleDefinition()
|
|
ThrottleDefinition(Expression maximumRequestsPerPeriod)
|
Method Summary | |
---|---|
ThrottleDefinition |
asyncDelayed()
Enables asynchronous delay which means the thread will noy block while delaying. |
ThrottleDefinition |
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. |
protected String |
description()
|
ThrottleDefinition |
executorService(ExecutorService executorService)
Setting the executor service for executing |
ThrottleDefinition |
executorServiceRef(String executorServiceRef)
Setting the executor service for executing |
Boolean |
getAsyncDelayed()
|
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. |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node |
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images |
Long |
getTimePeriodMillis()
|
ThrottleDefinition |
maximumRequestsPerPeriod(Long maximumRequestsPerPeriod)
Sets the time period during which the maximum request count per period |
void |
setAsyncDelayed(Boolean asyncDelayed)
|
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 |
setTimePeriodMillis(Long timePeriodMillis)
|
ThrottleDefinition |
timePeriodMillis(long timePeriodMillis)
Sets the time period during which the maximum request count is valid for |
String |
toString()
|
Methods inherited from class org.apache.camel.model.ExpressionNode |
---|
configureChild, createFilterProcessor, getExpression, getOutputs, isOutputSupported, setExpression, 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 ThrottleDefinition()
public ThrottleDefinition(Expression maximumRequestsPerPeriod)
Method Detail |
---|
public String toString()
toString
in class Object
protected String description()
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class ExpressionNode
public String getLabel()
ProcessorDefinition
getLabel
in class ExpressionNode
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<ExpressionNode>
Exception
public ThrottleDefinition timePeriodMillis(long timePeriodMillis)
timePeriodMillis
- period in millis
public ThrottleDefinition maximumRequestsPerPeriod(Long maximumRequestsPerPeriod)
maximumRequestsPerPeriod
- the maximum request count number per time period
public ThrottleDefinition callerRunsWhenRejected(boolean callerRunsWhenRejected)
callerRunsWhenRejected
- whether or not the caller should run
public ThrottleDefinition asyncDelayed()
public ThrottleDefinition executorService(ExecutorService executorService)
ExecutorServiceAwareDefinition
executorService
in interface ExecutorServiceAwareDefinition<ThrottleDefinition>
executorService
- the executor service
public ThrottleDefinition executorServiceRef(String executorServiceRef)
ExecutorServiceAwareDefinition
executorServiceRef
in interface ExecutorServiceAwareDefinition<ThrottleDefinition>
executorServiceRef
- reference for a ExecutorService
to lookup in the Registry
public Long getTimePeriodMillis()
public void setTimePeriodMillis(Long timePeriodMillis)
public Boolean getAsyncDelayed()
public void setAsyncDelayed(Boolean asyncDelayed)
public Boolean getCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)
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 executor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |