|
||||||||||
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<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 |
---|
errorHandlerBuilder, errorHandlerRef, inheritErrorHandler, log |
Constructor Summary | |
---|---|
LoadBalanceDefinition()
|
Method Summary | |
---|---|
protected Processor |
createOutputsProcessor(RouteContext routeContext,
java.util.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(java.lang.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(java.lang.Class<?>... exceptions)
Uses fail over load balancer Will not round robin and inherit the error handler. |
LoadBalanceDefinition |
failover(int maximumFailoverAttempts,
boolean inheritErrorHandler,
boolean roundRobin,
java.lang.Class<?>... exceptions)
Uses fail over load balancer |
java.lang.String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node |
LoadBalancerDefinition |
getLoadBalancerType()
|
java.util.List<ProcessorDefinition> |
getOutputs()
|
java.lang.String |
getRef()
|
java.lang.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(java.util.List<ProcessorDefinition> outputs)
|
void |
setRef(java.lang.String ref)
|
LoadBalanceDefinition |
sticky(Expression correlationExpression)
Uses sticky load balancer |
LoadBalanceDefinition |
topic()
Uses topic load balancer |
java.lang.String |
toString()
|
LoadBalanceDefinition |
weighted(boolean roundRobin,
java.lang.String distributionRatio)
Uses weighted load balancer |
LoadBalanceDefinition |
weighted(boolean roundRobin,
java.lang.String distributionRatio,
java.lang.String distributionRatioDelimiter)
Uses weighted load balancer |
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 LoadBalanceDefinition()
Method Detail |
---|
public java.lang.String getShortName()
OptionalIdentifiedDefinition
getShortName
in class OptionalIdentifiedDefinition
public java.util.List<ProcessorDefinition> getOutputs()
getOutputs
in class ProcessorDefinition<LoadBalanceDefinition>
public void setOutputs(java.util.List<ProcessorDefinition> outputs)
public boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<LoadBalanceDefinition>
public java.lang.String getRef()
public void setRef(java.lang.String ref)
public LoadBalancerDefinition getLoadBalancerType()
public void setLoadBalancerType(LoadBalancerDefinition loadbalancer)
protected Processor createOutputsProcessor(RouteContext routeContext, java.util.Collection<ProcessorDefinition> outputs) throws java.lang.Exception
createOutputsProcessor
in class ProcessorDefinition<LoadBalanceDefinition>
java.lang.Exception
public Processor createProcessor(RouteContext routeContext) throws java.lang.Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<LoadBalanceDefinition>
java.lang.Exception
public LoadBalanceDefinition loadBalance(LoadBalancer loadBalancer)
loadBalance
in class ProcessorDefinition<LoadBalanceDefinition>
loadBalancer
- the load balancer
public LoadBalanceDefinition failover()
public LoadBalanceDefinition failover(java.lang.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, java.lang.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, java.lang.String distributionRatio)
roundRobin
- used to set the processor selection algorithm.distributionRatio
- String of weighted ratios for distribution of messages.
public LoadBalanceDefinition weighted(boolean roundRobin, java.lang.String distributionRatio, java.lang.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(java.lang.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 java.lang.String getLabel()
ProcessorDefinition
getLabel
in class ProcessorDefinition<LoadBalanceDefinition>
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |