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: 767405 $

Field Summary
 
Fields inherited from class org.apache.camel.model.OptionalIdentifiedType
nodeCounters
 
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)
           
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<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
 boolean isStartable()
           
 boolean isStoppable()
           
 Endpoint resolveEndpoint(String uri)
           
 void setCamelContext(CamelContext camelContext)
          Injects the CamelContext
 void setGroup(String group)
           
 void setInputs(List<FromDefinition> inputs)
           
 void setOutputs(List<ProcessorDefinition> outputs)
           
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, 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, 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

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: 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<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

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

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>


Copyright © 2009 Apache Software Foundation. All Rights Reserved.