Package org.apache.camel.impl.engine
Class DurationRoutePolicyFactory
- java.lang.Object
-
- org.apache.camel.impl.engine.DurationRoutePolicyFactory
-
- All Implemented Interfaces:
org.apache.camel.spi.RoutePolicyFactory
public class DurationRoutePolicyFactory extends Object implements org.apache.camel.spi.RoutePolicyFactory
RoutePolicyFactory
which executes for a duration and then triggers an action. This can be used to stop a set of routes (or CamelContext) after it has processed a number of messages, or has been running for N seconds.
-
-
Constructor Summary
Constructors Constructor Description DurationRoutePolicyFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.spi.RoutePolicy
createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode route)
org.apache.camel.impl.engine.DurationRoutePolicy.Action
getAction()
String
getFromRouteId()
int
getMaxSeconds()
void
setAction(org.apache.camel.impl.engine.DurationRoutePolicy.Action action)
What action to perform when maximum is triggered.void
setFromRouteId(String fromRouteId)
Limit the route policy to the route which matches this patternvoid
setMaxMessages(int maxMessages)
Maximum number of messages to process before the action is triggeredvoid
setMaxSeconds(int maxSeconds)
Maximum seconds Camel is running before the action is triggered
-
-
-
Method Detail
-
createRoutePolicy
public org.apache.camel.spi.RoutePolicy createRoutePolicy(org.apache.camel.CamelContext camelContext, String routeId, org.apache.camel.NamedNode route)
- Specified by:
createRoutePolicy
in interfaceorg.apache.camel.spi.RoutePolicyFactory
-
getFromRouteId
public String getFromRouteId()
-
setFromRouteId
public void setFromRouteId(String fromRouteId)
Limit the route policy to the route which matches this pattern- See Also:
PatternHelper.matchPattern(String, String)
-
setMaxMessages
public void setMaxMessages(int maxMessages)
Maximum number of messages to process before the action is triggered
-
getMaxSeconds
public int getMaxSeconds()
-
setMaxSeconds
public void setMaxSeconds(int maxSeconds)
Maximum seconds Camel is running before the action is triggered
-
getAction
public org.apache.camel.impl.engine.DurationRoutePolicy.Action getAction()
-
setAction
public void setAction(org.apache.camel.impl.engine.DurationRoutePolicy.Action action)
What action to perform when maximum is triggered.
-
-