org.apache.camel.model
Class RouteDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedDefinition<Type>
      extended by org.apache.camel.model.ProcessorDefinition<ProcessorDefinition>
          extended by org.apache.camel.model.RouteDefinition
All Implemented Interfaces:
CamelContextAware, Block

public class RouteDefinition
extends ProcessorDefinition<ProcessorDefinition>
implements CamelContextAware

Represents an XML <route/> element

Version:
$Revision: 801608 $

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
log
 
Constructor Summary
RouteDefinition()
           
RouteDefinition(Endpoint endpoint)
           
RouteDefinition(String uri)
           
 
Method Summary
 List<RouteContext> addRoutes(CamelContext context, Collection<Route> routes)
           
protected  RouteContext addRoutes(Collection<Route> routes, FromDefinition fromType)
           
 RouteDefinition delayer(long delay)
          Enable delayer for this route.
 RouteDefinition from(Endpoint... endpoints)
          Creates inputs to the route
 RouteDefinition from(Endpoint endpoint)
          Creates an input to the route
 RouteDefinition from(String... uris)
          Creates inputs to the route
 RouteDefinition from(String uri)
          Creates an input to the route
 CamelContext getCamelContext()
          Get the CamelContext
 Long getDelayer()
           
 String getGroup()
          The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML.
 List<FromDefinition> getInputs()
           
 List<ProcessorDefinition> getOutputs()
           
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 ServiceStatus getStatus()
          Returns the status of the route if it has been registered with a CamelContext
 RouteDefinition group(String name)
          Set the group name for this route
 RouteDefinition handleFault()
          Enable handle fault for this route.
 Boolean isHandleFault()
           
 boolean isStartable()
           
 boolean isStoppable()
           
 Boolean isStreamCache()
           
 Boolean isTrace()
           
 RouteDefinition noDelayer()
          Disable delayer for this route.
 RouteDefinition noHandleFault()
          Disable handle fault for this route.
 RouteDefinition noStreamCaching()
          Disable stream caching for this route.
 RouteDefinition noTracing()
          Disable tracing for this route.
 Endpoint resolveEndpoint(String uri)
           
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 void setDelayer(Long delayer)
           
 void setGroup(String group)
           
 void setHandleFault(Boolean handleFault)
           
 void setInputs(List<FromDefinition> inputs)
           
 void setOutputs(List<ProcessorDefinition> outputs)
           
 void setStreamCache(Boolean streamCache)
           
 void setTrace(Boolean trace)
           
 RouteDefinition streamCaching()
          Enable stream caching for this route.
 String toString()
           
 RouteDefinition tracing()
          Enable tracing for this route.
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, aop, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, createProcessor, delay, delay, delay, doTry, end, enrich, enrich, errorHandler, filter, filter, filter, filter, getErrorHandlerBuilder, getErrorHandlerRef, getInterceptStrategies, getLabel, getNodeFactory, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, loadBalance, 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.OptionalIdentifiedDefinition
description, getDescription, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RouteDefinition

public RouteDefinition()

RouteDefinition

public RouteDefinition(String uri)

RouteDefinition

public RouteDefinition(Endpoint endpoint)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getShortName

public String getShortName()
Description copied from class: OptionalIdentifiedDefinition
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 OptionalIdentifiedDefinition<ProcessorDefinition>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

getStatus

public ServiceStatus getStatus()
Returns the status of the route if it has been registered with a CamelContext


isStartable

public boolean isStartable()

isStoppable

public boolean isStoppable()

addRoutes

public List<RouteContext> addRoutes(CamelContext context,
                                    Collection<Route> routes)
                             throws Exception
Throws:
Exception

resolveEndpoint

public Endpoint resolveEndpoint(String uri)
                         throws NoSuchEndpointException
Throws:
NoSuchEndpointException

from

public RouteDefinition from(String uri)
Creates an input to the route

Parameters:
uri - the from uri
Returns:
the builder

from

public RouteDefinition from(Endpoint endpoint)
Creates an input to the route

Parameters:
endpoint - the from endpoint
Returns:
the builder

from

public RouteDefinition from(String... uris)
Creates inputs to the route

Parameters:
uris - the from uris
Returns:
the builder

from

public RouteDefinition from(Endpoint... endpoints)
Creates inputs to the route

Parameters:
endpoints - the from endpoints
Returns:
the builder

group

public RouteDefinition group(String name)
Set the group name for this route

Parameters:
name - the group name
Returns:
the builder

noStreamCaching

public RouteDefinition noStreamCaching()
Disable stream caching for this route.


streamCaching

public RouteDefinition streamCaching()
Enable stream caching for this route.


noTracing

public RouteDefinition noTracing()
Disable tracing for this route.


tracing

public RouteDefinition tracing()
Enable tracing for this route.


noHandleFault

public RouteDefinition noHandleFault()
Disable handle fault for this route.


handleFault

public RouteDefinition handleFault()
Enable handle fault for this route.


noDelayer

public RouteDefinition noDelayer()
Disable delayer for this route.


delayer

public RouteDefinition delayer(long delay)
Enable delayer for this route.

Parameters:
delay - delay in millis

getInputs

public List<FromDefinition> getInputs()

setInputs

public void setInputs(List<FromDefinition> inputs)

getOutputs

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

setOutputs

public void setOutputs(List<ProcessorDefinition> outputs)

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: CamelContextAware
Get the CamelContext

Specified by:
getCamelContext in interface CamelContextAware
Returns:
camelContext the Camel context

setCamelContext

public void setCamelContext(CamelContext camelContext)
Description copied from interface: CamelContextAware
Injects the CamelContext

Specified by:
setCamelContext in interface CamelContextAware
Parameters:
camelContext - the Camel context

getGroup

public String getGroup()
The group that this route belongs to; could be the name of the RouteBuilder class or be explicitly configured in the XML. May be null.


setGroup

public void setGroup(String group)

isStreamCache

public Boolean isStreamCache()

setStreamCache

public void setStreamCache(Boolean streamCache)

isTrace

public Boolean isTrace()

setTrace

public void setTrace(Boolean trace)

isHandleFault

public Boolean isHandleFault()

setHandleFault

public void setHandleFault(Boolean handleFault)

getDelayer

public Long getDelayer()

setDelayer

public void setDelayer(Long delayer)

addRoutes

protected RouteContext addRoutes(Collection<Route> routes,
                                 FromDefinition fromType)
                          throws Exception
Throws:
Exception


Apache CAMEL