Class DeploymentResourceSupport

java.lang.Object
org.jboss.as.server.deployment.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 Details

    • DeploymentResourceSupport

      protected DeploymentResourceSupport(DeploymentUnit deploymentUnit)
  • Method Details

    • 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
    • getDeploymentSubModel

      public org.jboss.dmr.ModelNode getDeploymentSubModel(String subsystemName, PathAddress 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).

      The subsystem resource as well as each PathAddress.getParent() parent element} from the address will be created if it does not already exist.

      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
    • registerDeploymentSubResource

      public org.jboss.dmr.ModelNode registerDeploymentSubResource(String subsystemName, PathAddress address, Resource resource)
      Registers the provided resource as the resource for the last element of the address. Operations, metrics and descriptions have to be registered as part of the subsystem registration ExtensionContext and SubsystemRegistration.registerDeploymentModel(org.jboss.as.controller.ResourceDefinition).

      The subsystem resource as well as each PathAddress.getParent() parent element} from the address will be created if it does not already exist.

      Parameters:
      subsystemName - the subsystem name the model was registered
      address - the path address this sub-model should be created in
      resource - the resource to be registered as sub-module
      Returns:
      the model from the resource parameter
      Throws:
      IllegalStateException - if the last resource already exists