|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CamelContext
Interface used to represent the context used to configure routes and the policies to use during message exchanges between endpoints.
| Method Summary | ||
|---|---|---|
void |
addComponent(String componentName,
Component component)
Adds a component to the context. |
|
Endpoint |
addEndpoint(String uri,
Endpoint endpoint)
Adds the endpoint to the context using the given URI. |
|
void |
addInterceptStrategy(InterceptStrategy interceptStrategy)
Adds the given interceptor strategy |
|
void |
addRouteDefinitions(Collection<RouteType> routeDefinitions)
Adds a collection of route definitions to the context |
|
void |
addRoutes(Collection<Route> routes)
Adds a collection of routes to this context |
|
void |
addRoutes(Routes builder)
Adds a collection of routes to this context using the given builder to build them |
|
Endpoint |
addSingletonEndpoint(String uri,
Endpoint endpoint)
Deprecated. |
|
FactoryFinder |
createFactoryFinder()
Create a FactoryFinder which will be used for the loading the factory class from META-INF |
|
FactoryFinder |
createFactoryFinder(String path)
Create a FactoryFinder which will be used for the loading the factory class from META-INF |
|
|
createProducerTemplate()
Creates a new ProducerTemplate. |
|
Component |
getComponent(String componentName)
Gets a component from the context by name. |
|
|
getComponent(String name,
Class<T> componentType)
Gets a component from the context by name and specifying the expected type of component. |
|
Map<String,DataFormatType> |
getDataFormats()
Gets the data formats that can be referenced in the routes. |
|
Endpoint |
getEndpoint(String uri)
Resolves the given URI to an Endpoint. |
|
|
getEndpoint(String name,
Class<T> endpointType)
Resolves the given name to an Endpoint of the specified type. |
|
Map<String,Endpoint> |
getEndpointMap()
Returns a new Map containing all of the active endpoints with the key of the map being their unique key |
|
Collection<Endpoint> |
getEndpoints()
Returns the collection of all registered endpoints. |
|
Collection<Endpoint> |
getEndpoints(String uri)
Returns the collection of all registered endpoints for a uri or an empty collection. |
|
ErrorHandlerBuilder |
getErrorHandlerBuilder()
Gets the default error handler builder which is inherited by the routes |
|
ExchangeConverter |
getExchangeConverter()
Returns the converter of exchanges from one type to another |
|
Injector |
getInjector()
Returns the injector used to instantiate objects by type |
|
LifecycleStrategy |
getLifecycleStrategy()
Returns the lifecycle strategy used to handle lifecycle notification |
|
String |
getName()
Gets the name of the this context. |
|
Component |
getOrCreateComponent(String componentName,
Callable<Component> factory)
Gets the a previously added component by name or lazily creates the component using the factory Callback. |
|
Map<String,String> |
getProperties()
Gets the properties that can be referenced in the camel context |
|
Registry |
getRegistry()
Returns the registry used to lookup components by name and type such as the Spring ApplicationContext, JNDI or the OSGi Service Registry |
|
List<RouteType> |
getRouteDefinitions()
Returns a list of the current route definitions |
|
List<Route> |
getRoutes()
Returns the current routes in this context |
|
Collection<Endpoint> |
getSingletonEndpoints()
Returns the collection of all registered singleton endpoints. |
|
TypeConverter |
getTypeConverter()
Returns the type converter used to coerce types from one type to another |
|
Component |
removeComponent(String componentName)
Removes a previously added component. |
|
Collection<Endpoint> |
removeEndpoints(String uri)
Removes all endpoints with the given URI |
|
Endpoint |
removeSingletonEndpoint(String uri)
Deprecated. |
|
Language |
resolveLanguage(String language)
Resolves a language for creating expressions |
|
void |
setDataFormats(Map<String,DataFormatType> dataFormats)
Sets the data formats that can be referenced in the routes. |
|
void |
setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
Sets the default error handler builder which is inherited by the routes |
|
void |
setProperties(Map<String,String> properties)
Sets the properties that can be referenced in the camel context |
|
void |
setRoutes(List<Route> routes)
Deprecated. is considered for deprecation, use addRoutes instead, could be removed in Camel 2.0 |
|
| Methods inherited from interface org.apache.camel.Service |
|---|
start, stop |
| Method Detail |
|---|
String getName()
void addComponent(String componentName,
Component component)
componentName - the name the component is registered ascomponent - the componentComponent getComponent(String componentName)
componentName - the name of the component
<T extends Component> T getComponent(String name,
Class<T> componentType)
name - the name to lookupcomponentType - the expected type
Component removeComponent(String componentName)
componentName - the component name to remove
Component getOrCreateComponent(String componentName,
Callable<Component> factory)
componentName - the name of the componentfactory - used to create a new component instance if the component was not previously added.
Endpoint getEndpoint(String uri)
Endpoint. If the URI has a singleton endpoint
registered, then the singleton is returned. Otherwise, a new Endpoint is created
and if the endpoint is a singleton it is registered as a singleton endpoint.
uri - the URI of the endpoint
<T extends Endpoint> T getEndpoint(String name,
Class<T> endpointType)
Endpoint of the specified type.
If the name has a singleton endpoint registered, then the singleton is returned.
Otherwise, a new Endpoint is created and if the endpoint is a
singleton it is registered as a singleton endpoint.
name - the name of the endpointendpointType - the expected type
Collection<Endpoint> getEndpoints()
Map<String,Endpoint> getEndpointMap()
Collection<Endpoint> getEndpoints(String uri)
uri - the URI of the endpoints
Collection<Endpoint> getSingletonEndpoints()
Endpoint addEndpoint(String uri,
Endpoint endpoint)
throws Exception
uri - the URI to be used to resolve this endpointendpoint - the endpoint to be added to the context
Exception - if the new endpoint could not be started or the old
singleton endpoint could not be stopped
Collection<Endpoint> removeEndpoints(String uri)
throws Exception
uri - the URI to be used to remove
Exception - if at least one endpoint could not be stopped
@Deprecated
Endpoint addSingletonEndpoint(String uri,
Endpoint endpoint)
throws Exception
uri - the URI to be used to resolve this endpointendpoint - the endpoint to be added to the context
Exception - if the new endpoint could not be started or the old endpoint could not be stopped
@Deprecated
Endpoint removeSingletonEndpoint(String uri)
throws Exception
uri - the URI to be used to remove
Exception - if endpoint could not be stoppedList<RouteType> getRouteDefinitions()
List<Route> getRoutes()
@Deprecated void setRoutes(List<Route> routes)
routes - the new routes to use
void addRoutes(Collection<Route> routes)
throws Exception
routes - the routes to add
Exception - if the routes could not be created for whatever reason
void addRoutes(Routes builder)
throws Exception
builder - the builder which will create the routes and add them to this context
Exception - if the routes could not be created for whatever reason
void addRouteDefinitions(Collection<RouteType> routeDefinitions)
throws Exception
routeDefinitions - the route definitions to add
Exception - if the route definition could not be created for whatever reasonExchangeConverter getExchangeConverter()
TypeConverter getTypeConverter()
Registry getRegistry()
Injector getInjector()
LifecycleStrategy getLifecycleStrategy()
Language resolveLanguage(String language)
language - name of the language
<E extends Exchange> ProducerTemplate<E> createProducerTemplate()
void addInterceptStrategy(InterceptStrategy interceptStrategy)
interceptStrategy - the strategyErrorHandlerBuilder getErrorHandlerBuilder()
void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
errorHandlerBuilder - the buildervoid setDataFormats(Map<String,DataFormatType> dataFormats)
dataFormats - the data formatsMap<String,DataFormatType> getDataFormats()
void setProperties(Map<String,String> properties)
Map<String,String> getProperties()
FactoryFinder createFactoryFinder()
FactoryFinder createFactoryFinder(String path)
path - the META-INF path
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||