org.ow2.jonas.camel.service.api
Interface ICamelService

All Known Implementing Classes:
CamelService

public interface ICamelService

Interface of the Camel Service.

Author:
Guillaume Renault

Method Summary
 void addComponent(String componentName, org.apache.camel.Component component, String camelContextName)
          Add a component on the given camel context.
 void addRegistry(InputStream input, String camelContextName)
          Add values to the registry component.
 void addRoutes(org.apache.camel.builder.RouteBuilder builder, String camelContextName)
          Add a Route to the given context, by providing a RouteBuilder
 org.apache.camel.CamelContext getCamelContext(String name)
          Get an instance of Camel.
 List<String> getContextNames()
          Get the names of Camel contexts managed by the service.
 org.apache.camel.ProducerTemplate getProducerTemplate(String camelContextName)
          Get a producer template for the given camel context.
 List<org.apache.camel.model.RouteDefinition> getRouteDefinitions(String camelContextName)
          Get the list of existing routes.
 void removeRegistry(InputStream input, String camelContextName)
          Remove entries from the registry component.
 org.apache.camel.CamelContext startAndGetNewContext(org.osgi.framework.BundleContext bundleContext)
          Start a new camel context using a given OSGi BundleContext and return context.
 String startNewContext(org.osgi.framework.BundleContext bundleContext)
          Start a new camel context using a given OSGi BundleContext and return camel context name.
 void stop(String name)
          Stop an instance of Camel.
 

Method Detail

getContextNames

List<String> getContextNames()
Get the names of Camel contexts managed by the service.

Returns:
Names of Camel contexts managed by the service.

startNewContext

String startNewContext(org.osgi.framework.BundleContext bundleContext)
                       throws Exception
Start a new camel context using a given OSGi BundleContext and return camel context name.

Parameters:
bundleContext - OSGi bundle context to use.
Returns:
the camel context name.
Throws:
Exception - If starting the context fails.

startAndGetNewContext

org.apache.camel.CamelContext startAndGetNewContext(org.osgi.framework.BundleContext bundleContext)
                                                    throws Exception
Start a new camel context using a given OSGi BundleContext and return context.

Parameters:
bundleContext - OSGi bundle context to use.
Returns:
the camel context.
Throws:
Exception - If starting the context fails.

stop

void stop(String name)
          throws Exception
Stop an instance of Camel.

Parameters:
name - the camel context name to stop.
Throws:
Exception - If stopping any CAMEL console fails.

getCamelContext

org.apache.camel.CamelContext getCamelContext(String name)
Get an instance of Camel.

Parameters:
name - the camel context name
Returns:
the camel context

addRoutes

void addRoutes(org.apache.camel.builder.RouteBuilder builder,
               String camelContextName)
               throws Exception
Add a Route to the given context, by providing a RouteBuilder

Parameters:
builder - the route builder.
camelContextName - the camel context name on which the route has to be set.
Throws:
Exception - If adding route fails.

getRouteDefinitions

List<org.apache.camel.model.RouteDefinition> getRouteDefinitions(String camelContextName)
Get the list of existing routes.

Parameters:
camelContextName - the identifier of the camel context to check.
Returns:
the list of existing routes for the given camel context..

getProducerTemplate

org.apache.camel.ProducerTemplate getProducerTemplate(String camelContextName)
Get a producer template for the given camel context.

Parameters:
camelContextName - the camel context name on which the producer has to be taken.
Returns:
the producer template.

addRegistry

void addRegistry(InputStream input,
                 String camelContextName)
                 throws Exception
Add values to the registry component.

Parameters:
input - the stream that contains the entries to add.
camelContextName - the camel context name that contains the registry to update.
Throws:
Exception

removeRegistry

void removeRegistry(InputStream input,
                    String camelContextName)
Remove entries from the registry component.

Parameters:
input - the input stream that contains all the entries to remove
camelContextName - the camel context name to remove the entries on.

addComponent

void addComponent(String componentName,
                  org.apache.camel.Component component,
                  String camelContextName)
Add a component on the given camel context.

Parameters:
componentName - the component name.
component - the component.
camelContextName - the camel name context.


Copyright © 2012 OW2 Consortium. All Rights Reserved.