Class DeploymentResourceSupport


  • public final class DeploymentResourceSupport
    extends Object
    Support for creation of resources on deployments or retrieving the model of a resource on deployments.
    Author:
    James R. Perkins
    • Constructor Detail

      • DeploymentResourceSupport

        protected DeploymentResourceSupport​(DeploymentUnit deploymentUnit)
    • Method Detail

      • hasDeploymentSubsystemModel

        public boolean hasDeploymentSubsystemModel​(String subsystemName)
        Checks to see if a subsystem resource has already been registered for the deployment.
        Parameters:
        subsystemName - the name of the subsystem
        Returns:
        true if the subsystem exists on the deployment otherwise false
      • getDeploymentSubsystemModel

        public org.jboss.dmr.ModelNode getDeploymentSubsystemModel​(String subsystemName)
        Get the subsystem deployment model root.

        If the subsystem resource does not exist one will be created.

        Parameters:
        subsystemName - the subsystem name.
        Returns:
        the model
      • registerDeploymentSubsystemResource

        public org.jboss.dmr.ModelNode registerDeploymentSubsystemResource​(String subsystemName,
                                                                           Resource resource)
        Registers the resource to the parent deployment resource. The model returned is that of the resource parameter.
        Parameters:
        subsystemName - the subsystem name
        resource - the resource to be used for the subsystem on the deployment
        Returns:
        the model
        Throws:
        IllegalStateException - if the subsystem resource already exists
      • hasDeploymentSubModel

        public boolean hasDeploymentSubModel​(String subsystemName,
                                             PathElement address)
        Checks to see if a resource has already been registered for the specified address on the subsystem.
        Parameters:
        subsystemName - the name of the subsystem
        address - the address to check
        Returns:
        true if the address exists on the subsystem otherwise false
      • hasDeploymentSubModel

        public boolean hasDeploymentSubModel​(String subsystemName,
                                             PathAddress address)
        Checks to see if a resource has already been registered for the specified address on the subsystem.
        Parameters:
        subsystemName - the name of the subsystem
        address - the address to check
        Returns:
        true if the address exists on the subsystem otherwise false
      • getDeploymentSubModel

        public org.jboss.dmr.ModelNode getDeploymentSubModel​(String subsystemName,
                                                             PathElement address)
        Gets the sub-model for a components from the deployment itself. Operations, metrics and descriptions have to be registered as part of the subsystem registration ExtensionContext and SubsystemRegistration.registerDeploymentModel(org.jboss.as.controller.ResourceDefinition).

        If the subsystem resource does not exist it will be created. If no resource exists for the address parameter on the resource it also be created.

        Parameters:
        subsystemName - the name of the subsystem
        address - the path address this sub-model should return the model for
        Returns:
        the model for the resource