org.jboss.soa.esb.listeners.deployers.mc
Class EsbConfigParser

java.lang.Object
  extended by org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
      extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployer
          extended by org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput<T>
              extended by org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer<EsbMetaData>
                  extended by org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser
All Implemented Interfaces:
org.jboss.deployers.spi.deployer.Deployer, org.jboss.deployers.spi.deployer.matchers.JarExtensionProvider, org.jboss.deployers.spi.Ordered, org.jboss.deployers.vfs.spi.deployer.FileMatcher

public class EsbConfigParser
extends org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer<EsbMetaData>

EsbConfigParser is a Microcontainer deployer that picks up jboss-esb.xml files, parses the content and produces an EsbMetaData instance.

Other implementations could read/parse a configuration form another source, for example store the configurations in a database. As long as they produce the EsbMetaData they will be able to be deployed. Sample configuration:

<bean name="EsbConfigParser" class="org.jboss.soa.esb.listeners.deployers.mc.EsbConfigParser">
   <property name="esbDeploymentPrefix">jboss.esb:deployment=</property>
   <property name="warDeploymentPrefix">jboss.web.deployment:war=</property>
   <property name="actionArtifactsFile">/actionArtifactMap.properties</property>
 </bean>
 
  • esbDeploymentPrefix This is the prefix that a ESB archive deployments will have in JBoss AS. Defaults to 'jboss.esb:deployment='.
  • warDeploymentPrefix This is the prefix that a war archive deployments will have in JBoss AS. These are used for .war archives specified in the 'esb-depends' section of a deployment.xml file. Defaults to 'jboss.web.deployment:war='
  • actionArtifactsFile Properties file containing an action name to .esb archive mapping. Defaults to '/actionArtifactMap.properties'.
    For example, and entry in the file could look like this:
    org.jboss.soa.esb.smooks.SmooksAction=smooks.esb
    This says that the SmooksAction exists in the smooks.esb archive. Adding these mappings means that commonly used actions don't need to be explicetely added to the deployment.xml of all deployments. These will be implicit instead.
  • Author:
    Daniel Bevenius

    Nested Class Summary
     
    Nested classes/interfaces inherited from interface org.jboss.deployers.spi.Ordered
    org.jboss.deployers.spi.Ordered.OrderedComparator
     
    Field Summary
     
    Fields inherited from interface org.jboss.deployers.spi.Ordered
    COMPARATOR
     
    Constructor Summary
    EsbConfigParser()
              Sole constructor that performs the following steps: Sets the output of this deployer to be EsbMetaData. Sets the suffix to EsbConfigParser#ESB_FILE_SUFFIX. Sets the jar extension to EsbConfigParser#ESB_ARCHIVE_SUFFIX. Sets this deployers deployment stage to DeploymentStages.PARSE./li>
     
    Method Summary
     void create()
              Create will load the action artifacts file configured.
    protected  EsbMetaData parse(org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit deploymentUnit, org.jboss.virtual.VirtualFile file, EsbMetaData metadata)
              Will parse the VirtualFile representing the deployment and parse the esb configuration xml and extract information from the archive to create an EsbMetaData instance that will be returned.
     void setActionArtifactsFile(java.lang.String actionArtifactsFile)
               
     void setEsbArtifactName(java.lang.String esbArtifactName)
               
     void setEsbDeploymentPrefix(java.lang.String deploymentPrefix)
               
     void setWarDeploymentPrefix(java.lang.String deploymentPrefix)
               
     
    Methods inherited from class org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer
    accepts, accepts, allowsMultipleFiles, getAltMappings, getMetadataFile, handleMultipleFiles, init, isDeployable, matchFileToClass, mergeFiles, openStreamAndValidate, parse, parse, parse, parse, parseAndInit, setAllowMultipleFiles
     
    Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput
    allowsReparse, createMetaData, createMetaData, createMetaData, createMetaData, deploy, getAttachmentKey, getJarExtension, getMetaData, getName, getNames, getOutput, getSuffix, isBuildManagedObject, isIncludeDeploymentFile, setAttachmentKey, setBuildManagedObject, setIncludeDeploymentFile, setJarExtension, setName, setNames, setSuffix
     
    Methods inherited from class org.jboss.deployers.spi.deployer.helpers.AbstractDeployer
    addInput, addInput, addOutput, addOutput, getInput, getInputs, getOutputs, getRelativeOrder, getStage, isAllInputs, isComponentsOnly, isParentFirst, isTopLevelOnly, isWantComponents, setAllInputs, setComponentsOnly, setInput, setInputs, setInputs, setInputs, setOutput, setOutputs, setOutputs, setOutputs, setParentFirst, setRelativeOrder, setStage, setTopLevelOnly, setWantComponents, undeploy
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    EsbConfigParser

    public EsbConfigParser()
    Sole constructor that performs the following steps:
  • Sets the output of this deployer to be EsbMetaData.
  • Sets the suffix to EsbConfigParser#ESB_FILE_SUFFIX.
  • Sets the jar extension to EsbConfigParser#ESB_ARCHIVE_SUFFIX.
  • Sets this deployers deployment stage to DeploymentStages.PARSE./li>

  • Method Detail

    create

    public void create()
                throws java.lang.Exception
    Create will load the action artifacts file configured.

    Throws:
    java.lang.Exception - If the action artifacts files cannot be loaded.

    parse

    protected EsbMetaData parse(org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit deploymentUnit,
                                org.jboss.virtual.VirtualFile file,
                                EsbMetaData metadata)
                         throws java.lang.Exception
    Will parse the VirtualFile representing the deployment and parse the esb configuration xml and extract information from the archive to create an EsbMetaData instance that will be returned.

    Specified by:
    parse in class org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer<EsbMetaData>
    Throws:
    java.lang.Exception

    setActionArtifactsFile

    public void setActionArtifactsFile(java.lang.String actionArtifactsFile)

    setEsbDeploymentPrefix

    public void setEsbDeploymentPrefix(java.lang.String deploymentPrefix)

    setEsbArtifactName

    public void setEsbArtifactName(java.lang.String esbArtifactName)

    setWarDeploymentPrefix

    public void setWarDeploymentPrefix(java.lang.String deploymentPrefix)