org.apache.camel.impl
Class DefaultRouteContext

java.lang.Object
  extended by org.apache.camel.impl.DefaultRouteContext
All Implemented Interfaces:
RouteContext

public class DefaultRouteContext
extends Object
implements RouteContext

The context used to activate new routing rules

Version:
$Revision: 701021 $

Constructor Summary
DefaultRouteContext(CamelContext camelContext)
          Only used for lazy construction from inside ExpressionType
DefaultRouteContext(RouteType route, FromType from, Collection<Route> routes)
           
 
Method Summary
 void addEventDrivenProcessor(Processor processor)
          Adds an event driven processor
 void addInterceptStrategy(InterceptStrategy interceptStrategy)
          Adds a InterceptStrategy to this route context
 void commit()
          Lets complete the route creation, creating a single event driven route for the current from endpoint with any processors required
 Processor createProceedProcessor()
          Creates a proceed processor
 Processor createProcessor(ProcessorType node)
          Creates a processor
 CamelContext getCamelContext()
          Gets the camel context
 DataFormatType getDataFormat(String ref)
          Get a DataFormatType by ref name
 Endpoint<? extends Exchange> getEndpoint()
          Gets the endpoint
 ErrorHandlerWrappingStrategy getErrorHandlerWrappingStrategy()
          This method retrieves the ErrorHandlerWrappingStrategy.
 FromType getFrom()
          Gets the from type
 List<InterceptStrategy> getInterceptStrategies()
          This method retrieves the InterceptStrategy instances this route context.
 RouteType getRoute()
          Get the route type
 void intercept(Intercept interceptor)
          Intercepts with the given interceptor
 boolean isRouteAdded()
          Returns the isRouteAdded flag
<T> T
lookup(String name, Class<T> type)
          lookup an object by name and type
 Endpoint<? extends Exchange> resolveEndpoint(String uri)
          Resolves an endpoint from the URI
 Endpoint<? extends Exchange> resolveEndpoint(String uri, String ref)
          Resolves an endpoint from either a URI or a named reference
 void setErrorHandlerWrappingStrategy(ErrorHandlerWrappingStrategy strategy)
          This method sets the ErrorHandlerWrappingStrategy.
 void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
          This method sets the InterceptStrategy instances on this route context.
 void setIsRouteAdded(boolean b)
          If this flag is true, ProcessorType.addRoutes(RouteContext, java.util.Collection) will not add processor to addEventDrivenProcessor to the RouteContext and it will prevent from adding an EventDrivenRoute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRouteContext

public DefaultRouteContext(RouteType route,
                           FromType from,
                           Collection<Route> routes)

DefaultRouteContext

public DefaultRouteContext(CamelContext camelContext)
Only used for lazy construction from inside ExpressionType

Method Detail

getEndpoint

public Endpoint<? extends Exchange> getEndpoint()
Description copied from interface: RouteContext
Gets the endpoint

Specified by:
getEndpoint in interface RouteContext
Returns:
the endpoint

getFrom

public FromType getFrom()
Description copied from interface: RouteContext
Gets the from type

Specified by:
getFrom in interface RouteContext
Returns:
the from type

getRoute

public RouteType getRoute()
Description copied from interface: RouteContext
Get the route type

Specified by:
getRoute in interface RouteContext
Returns:
the route type

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: RouteContext
Gets the camel context

Specified by:
getCamelContext in interface RouteContext
Returns:
the camel context

createProcessor

public Processor createProcessor(ProcessorType node)
                          throws Exception
Description copied from interface: RouteContext
Creates a processor

Specified by:
createProcessor in interface RouteContext
Parameters:
node - the node
Returns:
the created processor
Throws:
Exception - can be thrown

resolveEndpoint

public Endpoint<? extends Exchange> resolveEndpoint(String uri)
Description copied from interface: RouteContext
Resolves an endpoint from the URI

Specified by:
resolveEndpoint in interface RouteContext
Parameters:
uri - the URI
Returns:
the resolved endpoint

resolveEndpoint

public Endpoint<? extends Exchange> resolveEndpoint(String uri,
                                                    String ref)
Description copied from interface: RouteContext
Resolves an endpoint from either a URI or a named reference

Specified by:
resolveEndpoint in interface RouteContext
Parameters:
uri - the URI or
ref - the named reference
Returns:
the resolved endpoint

lookup

public <T> T lookup(String name,
                    Class<T> type)
Description copied from interface: RouteContext
lookup an object by name and type

Specified by:
lookup in interface RouteContext
Parameters:
name - the name to lookup
type - the expected type
Returns:
the found object

commit

public void commit()
Description copied from interface: RouteContext
Lets complete the route creation, creating a single event driven route for the current from endpoint with any processors required

Specified by:
commit in interface RouteContext

addEventDrivenProcessor

public void addEventDrivenProcessor(Processor processor)
Description copied from interface: RouteContext
Adds an event driven processor

Specified by:
addEventDrivenProcessor in interface RouteContext
Parameters:
processor - the processor

intercept

public void intercept(Intercept interceptor)
Description copied from interface: RouteContext
Intercepts with the given interceptor

Specified by:
intercept in interface RouteContext
Parameters:
interceptor - the interceptor

createProceedProcessor

public Processor createProceedProcessor()
Description copied from interface: RouteContext
Creates a proceed processor

Specified by:
createProceedProcessor in interface RouteContext
Returns:
the created proceed processor

getInterceptStrategies

public List<InterceptStrategy> getInterceptStrategies()
Description copied from interface: RouteContext
This method retrieves the InterceptStrategy instances this route context.

Specified by:
getInterceptStrategies in interface RouteContext
Returns:
the strategy

setInterceptStrategies

public void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
Description copied from interface: RouteContext
This method sets the InterceptStrategy instances on this route context.

Specified by:
setInterceptStrategies in interface RouteContext
Parameters:
interceptStrategies - the strategies

addInterceptStrategy

public void addInterceptStrategy(InterceptStrategy interceptStrategy)
Description copied from interface: RouteContext
Adds a InterceptStrategy to this route context

Specified by:
addInterceptStrategy in interface RouteContext
Parameters:
interceptStrategy - the strategy

getErrorHandlerWrappingStrategy

public ErrorHandlerWrappingStrategy getErrorHandlerWrappingStrategy()
Description copied from interface: RouteContext
This method retrieves the ErrorHandlerWrappingStrategy.

Specified by:
getErrorHandlerWrappingStrategy in interface RouteContext
Returns:
the strategy

setErrorHandlerWrappingStrategy

public void setErrorHandlerWrappingStrategy(ErrorHandlerWrappingStrategy strategy)
Description copied from interface: RouteContext
This method sets the ErrorHandlerWrappingStrategy.

Specified by:
setErrorHandlerWrappingStrategy in interface RouteContext
Parameters:
strategy - the strategy

isRouteAdded

public boolean isRouteAdded()
Description copied from interface: RouteContext
Returns the isRouteAdded flag

Specified by:
isRouteAdded in interface RouteContext
Returns:
the flag

setIsRouteAdded

public void setIsRouteAdded(boolean b)
Description copied from interface: RouteContext
If this flag is true, ProcessorType.addRoutes(RouteContext, java.util.Collection) will not add processor to addEventDrivenProcessor to the RouteContext and it will prevent from adding an EventDrivenRoute.

Specified by:
setIsRouteAdded in interface RouteContext
Parameters:
b - the flag

getDataFormat

public DataFormatType getDataFormat(String ref)
Description copied from interface: RouteContext
Get a DataFormatType by ref name

Specified by:
getDataFormat in interface RouteContext
Parameters:
ref - the ref name to lookup
Returns:
the found object


Apache CAMEL