org.apache.camel.model
Class LoadBalanceDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedType<Type>
      extended by org.apache.camel.model.ProcessorDefinition<LoadBalanceDefinition>
          extended by org.apache.camel.model.LoadBalanceDefinition
All Implemented Interfaces:
Block

public class LoadBalanceDefinition
extends ProcessorDefinition<LoadBalanceDefinition>

Represents an XML <loadBalance/> element


Field Summary
 
Fields inherited from class org.apache.camel.model.OptionalIdentifiedType
nodeCounters
 
Constructor Summary
LoadBalanceDefinition()
           
 
Method Summary
protected  Processor createOutputsProcessor(RouteContext routeContext, Collection<ProcessorDefinition> outputs)
           
 Processor createProcessor(RouteContext routeContext)
           
 LoadBalanceDefinition failover()
          Uses fail over load balancer
 LoadBalanceDefinition failover(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
 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()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, aop, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, delay, delay, delay, doTry, end, enrich, enrich, errorHandler, filter, filter, filter, filter, getErrorHandlerBuilder, getErrorHandlerRef, getInterceptStrategies, getNodeFactory, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, loadBalance, loop, loop, loop, makeProcessor, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, process, processRef, recipientList, recipientList, removeFaultHeader, removeHeader, removeProperty, resequence, resequence, resequence, resequencer, rollback, rollback, routingSlip, routingSlip, setBody, setBody, setErrorHandlerBuilder, setErrorHandlerBuilderIfNull, setErrorHandlerRef, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, threads, threads, throttle, throwException, to, to, to, to, to, to, to, to, to, to, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, wireTap, wireTap, wireTap, wrapChannel, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedType
createId, description, getDescription, getId, getNodeCounter, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoadBalanceDefinition

public LoadBalanceDefinition()
Method Detail

getShortName

public String getShortName()
Description copied from class: OptionalIdentifiedType
Returns a short name for this node which can be useful for ID generation or referring to related resources like images

Overrides:
getShortName in class OptionalIdentifiedType<LoadBalanceDefinition>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

getOutputs

public List<ProcessorDefinition> getOutputs()
Specified by:
getOutputs in class ProcessorDefinition<LoadBalanceDefinition>

setOutputs

public void setOutputs(List<ProcessorDefinition> outputs)

getRef

public String getRef()

setRef

public void setRef(String ref)

getLoadBalancerType

public LoadBalancerDefinition getLoadBalancerType()

setLoadBalancerType

public void setLoadBalancerType(LoadBalancerDefinition loadbalancer)

createOutputsProcessor

protected Processor createOutputsProcessor(RouteContext routeContext,
                                           Collection<ProcessorDefinition> outputs)
                                    throws Exception
Overrides:
createOutputsProcessor in class ProcessorDefinition<LoadBalanceDefinition>
Throws:
Exception

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Overrides:
createProcessor in class ProcessorDefinition<LoadBalanceDefinition>
Throws:
Exception

loadBalance

public LoadBalanceDefinition loadBalance(LoadBalancer loadBalancer)
Uses a custom load balancer

Overrides:
loadBalance in class ProcessorDefinition<LoadBalanceDefinition>
Parameters:
loadBalancer - the load balancer
Returns:
the builder

failover

public LoadBalanceDefinition failover()
Uses fail over load balancer

Returns:
the builder

failover

public LoadBalanceDefinition failover(Class... exceptions)
Uses fail over load balancer

Parameters:
exceptions - exception classes which we want to failover if one of them was thrown
Returns:
the builder

roundRobin

public LoadBalanceDefinition roundRobin()
Uses round robin load balancer

Returns:
the builder

random

public LoadBalanceDefinition random()
Uses random load balancer

Returns:
the builder

sticky

public LoadBalanceDefinition sticky(Expression correlationExpression)
Uses sticky load balancer

Parameters:
correlationExpression - the expression for correlation
Returns:
the builder

topic

public LoadBalanceDefinition topic()
Uses topic load balancer

Returns:
the builder

getLabel

public String getLabel()
Description copied from class: ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node

Overrides:
getLabel in class ProcessorDefinition<LoadBalanceDefinition>

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL