org.jboss.soa.esb.listeners.config
Class Generator

java.lang.Object
  extended by org.jboss.soa.esb.listeners.config.Generator

public class Generator
extends java.lang.Object

ESB Configuration Generator.

Generates a legacy/deprecated configuration fileset in accordance with the ConfigTree approach to ESB configuration. The generator input should be a configuration that has been validated against the JBoss ESB configuration schema (XMLSchema).

Author:
tom.fennelly@jboss.com

Field Summary
static java.lang.String ESB_CONFIG_GATEWAY_XML_FILE
          Gateway Listeners config file.
static java.lang.String ESB_CONFIG_XML_FILE
          ESB Aware Listeners config file.
 
Constructor Summary
Generator(java.io.InputStream config)
          Public constructor.
Generator(java.io.InputStream config, java.io.OutputStream listenerOutputStream, java.io.OutputStream gatewayOutputStream)
           
 
Method Summary
 void generate()
          Generate the configuration set in the supplied output directory and store it in the member outputstreams.
 void generate(java.io.File outdir)
          Generate the configuration set in the supplied output directory.
 ModelAdapter getModel()
          Get the model instance associate with the configuration used to create this Generator instance.
static ModelAdapter parseConfig(java.io.InputStream config)
          Parse the supplied config into a config model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESB_CONFIG_GATEWAY_XML_FILE

public static final java.lang.String ESB_CONFIG_GATEWAY_XML_FILE
Gateway Listeners config file.

See Also:
Constant Field Values

ESB_CONFIG_XML_FILE

public static final java.lang.String ESB_CONFIG_XML_FILE
ESB Aware Listeners config file.

See Also:
Constant Field Values
Constructor Detail

Generator

public Generator(java.io.InputStream config,
                 java.io.OutputStream listenerOutputStream,
                 java.io.OutputStream gatewayOutputStream)
          throws ConfigurationException,
                 java.io.IOException
Throws:
ConfigurationException
java.io.IOException

Generator

public Generator(java.io.InputStream config)
          throws ConfigurationException,
                 java.io.IOException
Public constructor.

Parameters:
config - The input configuration stream.
Throws:
ConfigurationException - Bad listener ESB configuration.
java.io.IOException - Unable to read the ESB listener configuration.
Method Detail

parseConfig

public static ModelAdapter parseConfig(java.io.InputStream config)
                                throws java.io.IOException,
                                       ConfigurationException
Parse the supplied config into a config model.

Parameters:
config - The input configuration stream.
Returns:
Config model.
Throws:
ConfigurationException - Bad listener ESB configuration.
java.io.IOException - Unable to read the ESB listener configuration.

generate

public void generate()
              throws ConfigurationException
Generate the configuration set in the supplied output directory and store it in the member outputstreams.

Throws:
ConfigurationException - Failed to generate configuration set.

generate

public void generate(java.io.File outdir)
              throws ConfigurationException
Generate the configuration set in the supplied output directory.

The names of the generated files will be esb-config.xml (ESB Aware Listeners configuration) and esb-config-gateway.xml (Gateway Listeners configuration).

Parameters:
outdir - The output directory to where the configuration set is to be generated. The directory will be created if it doesn't already exist.
Throws:
ConfigurationException - Failed to generate configuration set.

getModel

public ModelAdapter getModel()
Get the model instance associate with the configuration used to create this Generator instance.

Returns:
Returns the model.