Package org.jboss.as.server.deployment
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 Summary
Constructors Modifier Constructor Description protectedDeploymentResourceSupport(DeploymentUnit deploymentUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.jboss.dmr.ModelNodegetDeploymentSubModel(String subsystemName, PathAddress address)Gets the sub-model for a components from the deployment itself.org.jboss.dmr.ModelNodegetDeploymentSubModel(String subsystemName, PathElement address)Gets the sub-model for a components from the deployment itself.org.jboss.dmr.ModelNodegetDeploymentSubsystemModel(String subsystemName)Get the subsystem deployment model root.booleanhasDeploymentSubModel(String subsystemName, PathAddress address)Checks to see if a resource has already been registered for the specified address on the subsystem.booleanhasDeploymentSubModel(String subsystemName, PathElement address)Checks to see if a resource has already been registered for the specified address on the subsystem.booleanhasDeploymentSubsystemModel(String subsystemName)Checks to see if a subsystem resource has already been registered for the deployment.org.jboss.dmr.ModelNoderegisterDeploymentSubResource(String subsystemName, PathAddress address, Resource resource)Registers the provided resource as the resource for thelast elementof the address.org.jboss.dmr.ModelNoderegisterDeploymentSubsystemResource(String subsystemName, Resource resource)Registers the resource to the parent deployment resource.
-
-
-
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:
trueif the subsystem exists on the deployment otherwisefalse
-
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 nameresource- 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 subsystemaddress- the address to check- Returns:
trueif the address exists on the subsystem otherwisefalse
-
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 subsystemaddress- the address to check- Returns:
trueif the address exists on the subsystem otherwisefalse
-
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 registrationExtensionContextandSubsystemRegistration.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 subsystemaddress- 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 registrationExtensionContextandSubsystemRegistration.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 subsystemaddress- 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 thelast elementof the address. Operations, metrics and descriptions have to be registered as part of the subsystem registrationExtensionContextandSubsystemRegistration.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 registeredaddress- the path address this sub-model should be created inresource- the resource to be registered as sub-module- Returns:
- the
modelfrom the resource parameter - Throws:
IllegalStateException- if thelastresource already exists
-
-