Home » apache-camel-1.5.0-src » org.apache » camel » [javadoc | source]
org.apache.camel
public interface: CamelContext [javadoc | source]

All Implemented Interfaces:
    Service

All Known Implementing Classes:
    GuiceCamelContext, SpringCamelContext, DefaultCamelContext

Interface used to represent the context used to configure routes and the policies to use during message exchanges between endpoints.
Method from org.apache.camel.CamelContext Summary:
addComponent,   addEndpoint,   addInterceptStrategy,   addRouteDefinitions,   addRoutes,   addRoutes,   addSingletonEndpoint,   createProducerTemplate,   getComponent,   getComponent,   getDataFormats,   getEndpoint,   getEndpoint,   getEndpoints,   getEndpoints,   getErrorHandlerBuilder,   getExchangeConverter,   getInjector,   getLifecycleStrategy,   getName,   getOrCreateComponent,   getRegistry,   getRouteDefinitions,   getRoutes,   getSingletonEndpoints,   getTypeConverter,   removeComponent,   removeEndpoints,   removeSingletonEndpoint,   resolveLanguage,   setDataFormats,   setErrorHandlerBuilder,   setRoutes
Method from org.apache.camel.CamelContext Detail:
 public  void addComponent(String componentName,
    Component component)
    Adds a component to the context.
 public Endpoint addEndpoint(String uri,
    Endpoint endpoint) throws Exception
    Adds the endpoint to the context using the given URI.
 public  void addInterceptStrategy(InterceptStrategy interceptStrategy)
    Adds the given interceptor strategy
 public  void addRouteDefinitions(Collection<RouteType> routeDefinitions) throws Exception
    Adds a collection of route definitions to the context
 public  void addRoutes(Collection<Route> routes) throws Exception
    Adds a collection of routes to this context
 public  void addRoutes(Routes builder) throws Exception
    Adds a collection of routes to this context using the given builder to build them
 public Endpoint addSingletonEndpoint(String uri,
    Endpoint endpoint) throws Exception
    Adds the endpoint to the context using the given URI. The endpoint will be registered as a singleton.
 public ProducerTemplate<E> createProducerTemplate()
 public Component getComponent(String componentName)
    Gets a component from the context by name.
 public T getComponent(String name,
    Class<T> componentType)
    Gets a component from the context by name and specifying the expected type of component.
 public Map<String, DataFormatType> getDataFormats()
    Gets the data formats that can be referenced in the routes.
 public Endpoint getEndpoint(String uri)
    Resolves the given URI to an 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.
 public T getEndpoint(String name,
    Class<T> endpointType)
    Resolves the given name to an 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.
 public Collection<Endpoint> getEndpoints()
    Returns the collection of all registered endpoints.
 public Collection<Endpoint> getEndpoints(String uri)
    Returns the collection of all registered endpoints for a uri or an empty collection. For a singleton endpoint the collection will contain exactly one element.
 public ErrorHandlerBuilder getErrorHandlerBuilder()
    Gets the default error handler builder which is inherited by the routes
 public ExchangeConverter getExchangeConverter()
    Returns the converter of exchanges from one type to another
 public Injector getInjector()
    Returns the injector used to instantiate objects by type
 public LifecycleStrategy getLifecycleStrategy()
    Returns the lifecycle strategy used to handle lifecycle notification
 public String getName()
    Gets the name of the this context.
 public Component getOrCreateComponent(String componentName,
    Callable<Component> factory)
    Gets the a previously added component by name or lazily creates the component using the factory Callback.
 public Registry getRegistry()
    Returns the registry used to lookup components by name and type such as the Spring ApplicationContext, JNDI or the OSGi Service Registry
 public List<RouteType> getRouteDefinitions()
    Returns a list of the current route definitions
 public List<Route> getRoutes()
    Returns the current routes in this context
 public Collection<Endpoint> getSingletonEndpoints()
    Returns the collection of all registered singleton endpoints.
 public TypeConverter getTypeConverter()
    Returns the type converter used to coerce types from one type to another
 public Component removeComponent(String componentName)
    Removes a previously added component.
 public Collection<Endpoint> removeEndpoints(String uri) throws Exception
    Removes all endpoints with the given URI
 public Endpoint removeSingletonEndpoint(String uri) throws Exception
    Removes the singleton endpoint with the given URI
 public Language resolveLanguage(String language)
    Resolves a language for creating expressions
 public  void setDataFormats(Map<String, DataFormatType> dataFormats)
    Sets the data formats that can be referenced in the routes.
 public  void setErrorHandlerBuilder(ErrorHandlerBuilder errorHandlerBuilder)
    Sets the default error handler builder which is inherited by the routes
 public  void setRoutes(List<Route> routes)Deprecated! is -  considered for deprecation, use addRoutes instead, could be removed in Camel 2.0

    Sets the routes for this context, replacing any current routes