org.ow2.jonas.camel.wrapper
Class CamelWrapper

java.lang.Object
  extended by org.ow2.jonas.camel.wrapper.CamelWrapper
All Implemented Interfaces:
ICamelWrapper

public class CamelWrapper
extends java.lang.Object
implements ICamelWrapper

Camel wrapper. A camel context is wrapped here.

Author:
Guillaume Renault

Constructor Summary
CamelWrapper(org.apache.camel.osgi.CamelContextFactory factory)
          Constructor, creates a new Camel context.
 
Method Summary
 void addComponent(java.lang.String componentName, org.apache.camel.Component component)
          Add a component on the given camel context.
 void addRoutes(org.apache.camel.builder.RouteBuilder builder)
          Add a route.
 void addToTheRegistry(java.io.InputStream inputStream)
          Add values to the registy.
 org.apache.camel.CamelContext getCamelContext()
           
 java.lang.String getCamelContextName()
          Gets the camel context name.
 java.lang.String getName()
          Get the name of the camel context.
 org.apache.camel.ProducerTemplate getProducerTemplate()
          Get a producer template for the camel context.
 RegistryWrapper getRegistryWrapper()
           
 java.util.List<org.apache.camel.model.RouteDefinition> getRouteDefinitions()
           
 void removeFromTheRegistry(java.io.InputStream inputStream)
          Remove values from the registy.
 void run()
          Main method.
 void setName(java.lang.String name)
          Set the name of the camel context.
 void stopContext()
          Stop the camel context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelWrapper

public CamelWrapper(org.apache.camel.osgi.CamelContextFactory factory)
Constructor, creates a new Camel context.

Parameters:
factory - Camel context factory to use.
Method Detail

getCamelContextName

public java.lang.String getCamelContextName()
Gets the camel context name.

Returns:
the camel context name.

run

public void run()
         throws java.lang.Exception
Main method.

Throws:
java.lang.Exception

stopContext

public void stopContext()
                 throws java.lang.Exception
Stop the camel context.

Specified by:
stopContext in interface ICamelWrapper
Throws:
java.lang.Exception - If stopping fails.

addRoutes

public void addRoutes(org.apache.camel.builder.RouteBuilder builder)
               throws java.lang.Exception
Add a route.

Specified by:
addRoutes in interface ICamelWrapper
Parameters:
builder - the route to add.
Throws:
java.lang.Exception - If adding routes fails.

getRouteDefinitions

public java.util.List<org.apache.camel.model.RouteDefinition> getRouteDefinitions()
Specified by:
getRouteDefinitions in interface ICamelWrapper
Returns:
the list of deployed routes on the camel context.

getProducerTemplate

public org.apache.camel.ProducerTemplate getProducerTemplate()
Get a producer template for the camel context.

Specified by:
getProducerTemplate in interface ICamelWrapper
Returns:
a producer for the camel context.

addComponent

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

Specified by:
addComponent in interface ICamelWrapper
Parameters:
componentName - the component name.
component - the component.

getName

public java.lang.String getName()
Get the name of the camel context.

Returns:
the name of the camel context.

setName

public void setName(java.lang.String name)
Set the name of the camel context.

Parameters:
name - the name of the camel context.

getCamelContext

public org.apache.camel.CamelContext getCamelContext()
Specified by:
getCamelContext in interface ICamelWrapper
Returns:
the wrapped camel instance.

addToTheRegistry

public void addToTheRegistry(java.io.InputStream inputStream)
                      throws java.lang.Exception
Description copied from interface: ICamelWrapper
Add values to the registy.

Specified by:
addToTheRegistry in interface ICamelWrapper
Parameters:
inputStream - the input stream containing the entire xml file that defines the entries to add.
Throws:
java.lang.Exception

removeFromTheRegistry

public void removeFromTheRegistry(java.io.InputStream inputStream)
Description copied from interface: ICamelWrapper
Remove values from the registy.

Specified by:
removeFromTheRegistry in interface ICamelWrapper
Parameters:
inputStream - the input stream containing the entire xml file that defines the entries to remove.

getRegistryWrapper

public RegistryWrapper getRegistryWrapper()
Specified by:
getRegistryWrapper in interface ICamelWrapper
Returns:
the registry wrapper.



Copyright © 2010 OW2 Consortium. All Rights Reserved.
Apache Camel version 2.3.0, OW2 JOnAS version 5.2.0-M2