org.apache.camel.spi
Interface RouteContext

All Known Implementing Classes:
DefaultRouteContext

public interface RouteContext

The context used to activate new routing rules

Version:
$Revision: 695550 $

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

Method Detail

getEndpoint

Endpoint<? extends Exchange> getEndpoint()
Gets the endpoint

Returns:
the endpoint

getFrom

FromType getFrom()
Gets the from type

Returns:
the from type

getRoute

RouteType getRoute()
Get the route type

Returns:
the route type

getCamelContext

CamelContext getCamelContext()
Gets the camel context

Returns:
the camel context

createProcessor

Processor createProcessor(ProcessorType node)
                          throws Exception
Creates a processor

Parameters:
node - the node
Returns:
the created processor
Throws:
Exception - can be thrown

resolveEndpoint

Endpoint<? extends Exchange> resolveEndpoint(String uri)
Resolves an endpoint from the URI

Parameters:
uri - the URI
Returns:
the resolved endpoint

resolveEndpoint

Endpoint<? extends Exchange> resolveEndpoint(String uri,
                                             String ref)
Resolves an endpoint from either a URI or a named reference

Parameters:
uri - the URI or
ref - the named reference
Returns:
the resolved endpoint

lookup

<T> T lookup(String name,
             Class<T> type)
lookup an object by name and type

Parameters:
name - the name to lookup
type - the expected type
Returns:
the found object

commit

void commit()
Lets complete the route creation, creating a single event driven route for the current from endpoint with any processors required


addEventDrivenProcessor

void addEventDrivenProcessor(Processor processor)
Adds an event driven processor

Parameters:
processor - the processor

intercept

void intercept(Intercept interceptor)
Intercepts with the given interceptor

Parameters:
interceptor - the interceptor

createProceedProcessor

Processor createProceedProcessor()
Creates a proceed processor

Returns:
the created proceed processor

getInterceptStrategies

List<InterceptStrategy> getInterceptStrategies()
This method retrieves the InterceptStrategy instances this route context.

Returns:
the strategy

setInterceptStrategies

void setInterceptStrategies(List<InterceptStrategy> interceptStrategies)
This method sets the InterceptStrategy instances on this route context.

Parameters:
interceptStrategies - the strategies

addInterceptStrategy

void addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds a InterceptStrategy to this route context

Parameters:
interceptStrategy - the strategy

getErrorHandlerWrappingStrategy

ErrorHandlerWrappingStrategy getErrorHandlerWrappingStrategy()
This method retrieves the ErrorHandlerWrappingStrategy.

Returns:
the strategy

setErrorHandlerWrappingStrategy

void setErrorHandlerWrappingStrategy(ErrorHandlerWrappingStrategy strategy)
This method sets the ErrorHandlerWrappingStrategy.

Parameters:
strategy - the strategy

setIsRouteAdded

void setIsRouteAdded(boolean value)
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.

Parameters:
value - the flag

isRouteAdded

boolean isRouteAdded()
Returns the isRouteAdded flag

Returns:
the flag

getDataFormat

DataFormatType getDataFormat(String ref)
Get a DataFormatType by ref name

Parameters:
ref - the ref name to lookup
Returns:
the found object


Apache CAMEL