org.apache.camel.model
Class RouteDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedType<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: 751357 $

Field Summary
 
Fields inherited from class org.apache.camel.model.OptionalIdentifiedType
nodeCounters
 
Constructor Summary
RouteDefinition()
           
RouteDefinition(Endpoint endpoint)
           
RouteDefinition(String uri)
           
 
Method Summary
 void addInterceptor(AbstractInterceptorDefinition interceptor)
          Adds an interceptor around the whole of this nodes processing
 List<RouteContext> addRoutes(CamelContext context, Collection<Route> routes)
           
protected  RouteContext addRoutes(Collection<Route> routes, FromDefinition fromType)
           
protected  void configureChild(ProcessorDefinition output)
           
 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()
           
 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<AbstractInterceptorDefinition> getInterceptors()
           
 List<ProcessorDefinition> getOutputs()
           
 ServiceStatus getStatus()
          Returns the status of the route if it has been registered with a CamelContext
 Boolean getStreamCaching()
           
 RouteDefinition group(String name)
          Set the group name for this route
 boolean isStartable()
           
 boolean isStoppable()
           
 RouteDefinition noStreamCaching()
          Disable stream caching for this route
 Endpoint resolveEndpoint(String uri)
           
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 void setGroup(String group)
           
 void setInputs(List<FromDefinition> inputs)
           
 void setInterceptors(List<AbstractInterceptorDefinition> interceptors)
           
 void setOutputs(List<ProcessorDefinition> outputs)
           
 void setStreamCaching(Boolean streamCaching)
          Enable stream caching on this route
 RouteDefinition streamCaching()
          Enable stream caching for this route
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptor, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, convertBodyTo, convertBodyTo, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, createProcessor, delay, delay, delay, delay, end, enrich, errorHandler, filter, filter, filter, filter, getErrorHandlerBuilder, getErrorHandlerRef, getInheritErrorHandlerFlag, getLabel, getNodeFactory, getParent, handleFault, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, intercept, intercept, intercept, intercept, interceptor, interceptors, isInheritErrorHandler, isInheritErrorHandler, loadBalance, loop, loop, loop, makeProcessor, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onException, pipeline, pipeline, pipeline, policies, policy, popBlock, proceed, process, processRef, pushBlock, recipientList, recipientList, removeFaultHeader, removeHeader, removeProperty, resequence, resequence, resequence, resequencer, routingSlip, routingSlip, setBody, setBody, setErrorHandlerBuilder, setErrorHandlerBuilderIfNull, setErrorHandlerRef, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandlerFlag, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, thread, thread, throttle, throwFault, throwFault, to, to, to, to, to, to, to, to, to, to, transform, transform, tryBlock, unmarshal, unmarshal, unmarshal, unmarshal, wireTap, wrapInErrorHandler, wrapProcessor, wrapProcessorInInterceptors
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedType
createId, description, getDescription, getId, getNodeCounter, getShortName, 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

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

Returns:
the builder

streamCaching

public RouteDefinition streamCaching()
Enable stream caching for this route

Returns:
the builder

getInterceptors

public List<AbstractInterceptorDefinition> getInterceptors()

setInterceptors

public void setInterceptors(List<AbstractInterceptorDefinition> interceptors)

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()

setCamelContext

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

Specified by:
setCamelContext in interface CamelContextAware

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)

getStreamCaching

public Boolean getStreamCaching()

setStreamCaching

public void setStreamCaching(Boolean streamCaching)
Enable stream caching on this route

Parameters:
streamCaching - true for enabling stream caching

addRoutes

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

configureChild

protected void configureChild(ProcessorDefinition output)
Overrides:
configureChild in class ProcessorDefinition<ProcessorDefinition>

addInterceptor

public void addInterceptor(AbstractInterceptorDefinition interceptor)
Description copied from class: ProcessorDefinition
Adds an interceptor around the whole of this nodes processing

Overrides:
addInterceptor in class ProcessorDefinition<ProcessorDefinition>
Parameters:
interceptor - the interceptor


Copyright © 2009 Apache Software Foundation. All Rights Reserved.