|
||||||||||
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<LoadBalanceDefinition>
org.apache.camel.model.LoadBalanceDefinition
public class LoadBalanceDefinition
Represents an XML <loadBalance/> element
Field Summary |
---|
Fields inherited from class org.apache.camel.model.ProcessorDefinition |
---|
inheritErrorHandler, log |
Constructor Summary | |
---|---|
LoadBalanceDefinition()
|
Method Summary | |
---|---|
protected Processor |
createOutputsProcessor(RouteContext routeContext,
Collection<ProcessorDefinition<?>> outputs)
|
Processor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor based on the definition model. |
LoadBalanceDefinition |
custom(String ref)
Uses the custom load balancer |
LoadBalanceDefinition |
failover()
Uses fail over load balancer Will not round robin and inherit the error handler. |
LoadBalanceDefinition |
failover(Class<?>... exceptions)
Uses fail over load balancer Will not round robin and inherit the error handler. |
LoadBalanceDefinition |
failover(int maximumFailoverAttempts,
boolean inheritErrorHandler,
boolean roundRobin,
Class<?>... exceptions)
Uses fail over load balancer |
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node |
LoadBalancerDefinition |
getLoadBalancerType()
|
List<ProcessorDefinition<?>> |
getOutputs()
|
String |
getRef()
|
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images |
boolean |
isOutputSupported()
|
LoadBalanceDefinition |
loadBalance(LoadBalancer loadBalancer)
Uses a custom load balancer |
LoadBalanceDefinition |
random()
Uses random load balancer |
LoadBalanceDefinition |
roundRobin()
Uses round robin load balancer |
void |
setLoadBalancerType(LoadBalancerDefinition loadbalancer)
|
void |
setOutputs(List<ProcessorDefinition<?>> outputs)
|
void |
setRef(String ref)
|
LoadBalanceDefinition |
sticky(Expression correlationExpression)
Uses sticky load balancer |
LoadBalanceDefinition |
topic()
Uses topic load balancer |
String |
toString()
|
LoadBalanceDefinition |
weighted(boolean roundRobin,
String distributionRatio)
Uses weighted load balancer |
LoadBalanceDefinition |
weighted(boolean roundRobin,
String distributionRatio,
String distributionRatioDelimiter)
Uses weighted load balancer |
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition |
---|
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 LoadBalanceDefinition()
Method Detail |
---|
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class OptionalIdentifiedDefinition<LoadBalanceDefinition>
public List<ProcessorDefinition<?>> getOutputs()
getOutputs
in class ProcessorDefinition<LoadBalanceDefinition>
public void setOutputs(List<ProcessorDefinition<?>> outputs)
public boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<LoadBalanceDefinition>
public String getRef()
public void setRef(String ref)
public LoadBalancerDefinition getLoadBalancerType()
public void setLoadBalancerType(LoadBalancerDefinition loadbalancer)
protected Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorDefinition<?>> outputs) throws Exception
createOutputsProcessor
in class ProcessorDefinition<LoadBalanceDefinition>
Exception
public Processor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<LoadBalanceDefinition>
Exception
public LoadBalanceDefinition loadBalance(LoadBalancer loadBalancer)
loadBalance
in class ProcessorDefinition<LoadBalanceDefinition>
loadBalancer
- the load balancer
public LoadBalanceDefinition failover()
public LoadBalanceDefinition failover(Class<?>... exceptions)
exceptions
- exception classes which we want to failover if one of them was thrown
public LoadBalanceDefinition failover(int maximumFailoverAttempts, boolean inheritErrorHandler, boolean roundRobin, Class<?>... exceptions)
maximumFailoverAttempts
- maximum number of failover attempts before exhausting.
Use -1 to newer exhaust when round robin is also enabled.
If round robin is disabled then it will exhaust when there are no more endpoints to failoverinheritErrorHandler
- whether or not to inherit error handler.
If false then it will failover immediately in case of an exceptionroundRobin
- whether or not to use round robin (which keeps state)exceptions
- exception classes which we want to failover if one of them was thrown
public LoadBalanceDefinition weighted(boolean roundRobin, String distributionRatio)
roundRobin
- used to set the processor selection algorithm.distributionRatio
- String of weighted ratios for distribution of messages.
public LoadBalanceDefinition weighted(boolean roundRobin, String distributionRatio, String distributionRatioDelimiter)
roundRobin
- used to set the processor selection algorithm.distributionRatio
- String of weighted ratios for distribution of messages.distributionRatioDelimiter
- String containing delimiter to be used for ratios
public LoadBalanceDefinition roundRobin()
public LoadBalanceDefinition random()
public LoadBalanceDefinition custom(String ref)
ref
- reference to lookup a custom load balancer from the Registry
to be used.
public LoadBalanceDefinition sticky(Expression correlationExpression)
correlationExpression
- the expression for correlation
public LoadBalanceDefinition topic()
public String getLabel()
ProcessorDefinition
getLabel
in interface NamedNode
getLabel
in class ProcessorDefinition<LoadBalanceDefinition>
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |