|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.model.OptionalIdentifiedDefinition<Type>
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()
|
boolean |
isAsyncDelayed()
|
boolean |
isRejectExecution()
|
ThrottleDefinition |
maximumRequestsPerPeriod(Long maximumRequestsPerPeriod)
Sets the time period during which the maximum request count per period |
ThrottleDefinition |
rejectExecution(boolean rejectExecution)
Whether or not throttler throws the ThrottlerRejectedExecutionException when the exchange exceeds the request limit Is by default false |
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 |
setRejectExecution(Boolean rejectExecution)
|
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, createPredicate, getExpression, getOutputs, isOutputSupported, preCreateProcessor, setExpression, setOutputs |
| Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition |
|---|
description, description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, isCustomId, setCustomId, 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 Objectprotected String description()
public String getShortName()
OptionalIdentifiedDefinition
getShortName in interface NamedNodegetShortName in class ExpressionNodepublic String getLabel()
ProcessorDefinition
getLabel in interface NamedNodegetLabel in class ExpressionNode
public Processor createProcessor(RouteContext routeContext)
throws Exception
ProcessorDefinition
createProcessor in class ProcessorDefinition<ExpressionNode>Exceptionpublic 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 rejectExecution(boolean rejectExecution)
throw - the RejectExecutionException if the exchange exceeds the request limit
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 isAsyncDelayed()
public Boolean getCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(Boolean callerRunsWhenRejected)
public ExecutorService getExecutorService()
ExecutorServiceAware
getExecutorService in interface ExecutorServiceAwarepublic void setExecutorService(ExecutorService executorService)
ExecutorServiceAware
setExecutorService in interface ExecutorServiceAwareexecutorService - the executorpublic String getExecutorServiceRef()
ExecutorServiceAwareRegistry for the executor service to be used.
getExecutorServiceRef in interface ExecutorServiceAwarepublic void setExecutorServiceRef(String executorServiceRef)
ExecutorServiceAwareRegistry for the executor service to be used.
setExecutorServiceRef in interface ExecutorServiceAwareexecutorServiceRef - reference for the executorpublic boolean isRejectExecution()
public void setRejectExecution(Boolean rejectExecution)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||