org.ow2.jonas.camel.registry.xml
Class RegistryWrapper

java.lang.Object
  extended by org.ow2.jonas.camel.registry.xml.RegistryWrapper

public class RegistryWrapper
extends java.lang.Object

Wraps a Registry for a given CamelContext. A new SimpleRegistry is aggregated to the current registry of the context. This new resgistry will store all the entries parsed from xml files.

Here is an example of the registry file:

Author:
eyindanga
See Also:
http://jonas.ow2.org/ns/camel-registry/file-registry-1.0.xsd for the XSD schema of the registry XML file.

Constructor Summary
RegistryWrapper()
          Public constructor.
 
Method Summary
 void addToTheRegistry(java.io.InputStream inputStream)
          Add entries parsed from xml files into the wrapped registry.
 void addValues(java.io.InputStream input)
          Add entries parsed from an XML file into the wrapped registry.
 org.apache.camel.osgi.CompositeRegistry createRegistry(org.apache.camel.CamelContext ctxt)
          Creates a CompositeRegistry containing the current context of the registry , added in first position, plus a SimpleRegistry where all entries parsed from xml files will be stored.
 void createRegistryAndAssignToContext(org.apache.camel.impl.DefaultCamelContext ctxt)
          Set the current Camel context
 org.apache.camel.impl.SimpleRegistry getRegistry()
          Gets the SimpleRegistry containing entries parsed from xml files.
 void removeFromTheRegistry(java.io.InputStream inputStream)
          Removes entries from the registry component.
 void setRegistry(org.apache.camel.impl.SimpleRegistry registry)
          Sets the registry that will store entries parsed from xml files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryWrapper

public RegistryWrapper()
Public constructor.

Method Detail

getRegistry

public org.apache.camel.impl.SimpleRegistry getRegistry()
Gets the SimpleRegistry containing entries parsed from xml files.

Returns:
the registry

setRegistry

public void setRegistry(org.apache.camel.impl.SimpleRegistry registry)
Sets the registry that will store entries parsed from xml files.

Parameters:
registry - the registry to set

createRegistry

public org.apache.camel.osgi.CompositeRegistry createRegistry(org.apache.camel.CamelContext ctxt)
Creates a CompositeRegistry containing the current context of the registry , added in first position, plus a SimpleRegistry where all entries parsed from xml files will be stored.

Parameters:
ctxt - the CamelContext
Returns:
a CompositeRegistry.

addValues

public void addValues(java.io.InputStream input)
               throws java.lang.Exception
Add entries parsed from an XML file into the wrapped registry.

Parameters:
input - The stream of the registry file that will be parsed to get registry entries.
Throws:
java.lang.Exception - any.
See Also:
RegistryWrapper} for the XML file example.

addToTheRegistry

public void addToTheRegistry(java.io.InputStream inputStream)
                      throws java.lang.Exception
Add entries parsed from xml files into the wrapped registry.

Parameters:
input - The stream of the registry file that will be parsed to get registry entries.
Throws:
java.lang.Exception - any.
See Also:
RegistryWrapper} for the XML file example.

removeFromTheRegistry

public void removeFromTheRegistry(java.io.InputStream inputStream)
                           throws java.lang.IllegalArgumentException
Removes entries from the registry component.

Parameters:
input - the stream of the registry file that will be parsed to get registry entries.
Throws:
java.lang.IllegalArgumentException - if removal of any entry fails
See Also:
RegistryWrapper} for the XML file example.

createRegistryAndAssignToContext

public void createRegistryAndAssignToContext(org.apache.camel.impl.DefaultCamelContext ctxt)
Set the current Camel context

Parameters:
ctxt - the context to set.



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