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(java.lang.String componentName, org.apache.camel.Component component, java.lang.String camelContextName)
          Add a component on the given camel context.
 void addRegistry(java.io.InputStream input, java.lang.String camelContextName)
          Add values to the registry component.
 void addRoutes(org.apache.camel.builder.RouteBuilder builder, java.lang.String camelContextName)
          Add a Route to the given context, by providing a RouteBuilder
 org.apache.camel.CamelContext getCamelContext(java.lang.String name)
          Get an instance of Camel.
 java.util.List<java.lang.String> getContextNames()
          Get the names of Camel contexts managed by the service.
 org.apache.camel.ProducerTemplate getProducerTemplate(java.lang.String camelContextName)
          Get a producer template for the given camel context.
 java.util.List<org.apache.camel.model.RouteDefinition> getRouteDefinitions(java.lang.String camelContextName)
          Get the list of existing routes.
 void removeRegistry(java.io.InputStream input, java.lang.String camelContextName)
          Remove entries from the registry component.
 org.apache.camel.CamelContext startAndGetNewContext()
          Start a new camel context and return context.
 java.lang.String startNewContext()
          Start a new camel context and return context name.
 void stop(java.lang.String name)
          Stop an instance of Camel.
 

Method Detail

getContextNames

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

Returns:
Names of Camel contexts managed by the service.

startNewContext

java.lang.String startNewContext()
                                 throws java.lang.Exception
Start a new camel context and return context name.

Returns:
the camel context name.
Throws:
java.lang.Exception - If starting the context fails.

startAndGetNewContext

org.apache.camel.CamelContext startAndGetNewContext()
                                                    throws java.lang.Exception
Start a new camel context and return context.

Returns:
the camel context.
Throws:
java.lang.Exception - If starting the context fails.

stop

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

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

getCamelContext

org.apache.camel.CamelContext getCamelContext(java.lang.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,
               java.lang.String camelContextName)
               throws java.lang.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:
java.lang.Exception - If adding route fails.

getRouteDefinitions

java.util.List<org.apache.camel.model.RouteDefinition> getRouteDefinitions(java.lang.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(java.lang.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(java.io.InputStream input,
                 java.lang.String camelContextName)
                 throws java.lang.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:
java.lang.Exception

removeRegistry

void removeRegistry(java.io.InputStream input,
                    java.lang.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(java.lang.String componentName,
                  org.apache.camel.Component component,
                  java.lang.String camelContextName)
Add a component on the given camel context.

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


Copyright © 2010 OW2 Consortium. All Rights Reserved.