Class DeploymentStructureDescriptorParser

  • All Implemented Interfaces:
    DeploymentUnitProcessor

    public class DeploymentStructureDescriptorParser
    extends Object
    implements DeploymentUnitProcessor
    Parses jboss-deployment-structure.xml, and merges the result with the deployment.

    jboss-deployment-structure.xml is only parsed for top level deployments. It allows configuration of the following for deployments and sub deployments:

    • Additional dependencies
    • Additional resource roots
    • ClassFileTransformers that will be applied at classloading
    • Child first behaviour

    It also allows for the use to add additional modules, using a syntax similar to that used in module xml files.

    Author:
    Stuart Douglas, Marius Bogoevici
    • Field Detail

      • DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS

        public static final String[] DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS
    • Constructor Detail

      • DeploymentStructureDescriptorParser

        public DeploymentStructureDescriptorParser()
    • Method Detail

      • registerJBossXMLParsers

        public static void registerJBossXMLParsers()
      • deploy

        public void deploy​(DeploymentPhaseContext phaseContext)
                    throws DeploymentUnitProcessingException
        Description copied from interface: DeploymentUnitProcessor
        Perform a single step in processing the deployment phase. The resulting state after executing this method should be that either the method completes normally and all changes are made, or an exception is thrown and all changes made in this method are reverted such that the original pre-invocation state is restored.

        Data stored on the phase context only exists until the end of the phase. The deployment unit context which is persistent is available via context.getDeploymentUnitContext().

        Specified by:
        deploy in interface DeploymentUnitProcessor
        Parameters:
        phaseContext - the deployment unit context
        Throws:
        DeploymentUnitProcessingException - if an error occurs during processing
      • undeploy

        public void undeploy​(DeploymentUnit context)
        Description copied from interface: DeploymentUnitProcessor
        Undo the deployment processing. This method should undo any action taken by deploy(); however, if the deploy() method added services, they need not be removed here (they will automatically be removed).

        This method should avoid throwing exceptions; any exceptions thrown are logged and ignored. Implementations of this method cannot assume that the deployment process has (or has not) proceeded beyond the current processor, nor can they assume that the undeploy() method will be called from the same thread as the deploy() method.

        Specified by:
        undeploy in interface DeploymentUnitProcessor
        Parameters:
        context - the deployment unit context