private static Resource getOrCreate(final Resource parent, final PathElement element) { return getOrCreate(parent, element, null); }
private static Resource getOrCreate(final Resource parent, final PathElement element) { return getOrCreate(parent, element, null); }
/** * Gets or creates the a resource for the sub-deployment on the parent deployments resource. * * @param deploymentName the name of the deployment * @param parent the parent deployment used to find the parent resource * * @return the already registered resource or a newly created resource */ static Resource getOrCreateSubDeployment(final String deploymentName, final DeploymentUnit parent) { final Resource root = parent.getAttachment(DEPLOYMENT_RESOURCE); return getOrCreate(root, PathElement.pathElement(SUBDEPLOYMENT, deploymentName)); }
/** * Gets or creates the a resource for the sub-deployment on the parent deployments resource. * * @param deploymentName the name of the deployment * @param parent the parent deployment used to find the parent resource * * @return the already registered resource or a newly created resource */ static Resource getOrCreateSubDeployment(final String deploymentName, final DeploymentUnit parent) { final Resource root = parent.getAttachment(DEPLOYMENT_RESOURCE); return getOrCreate(root, PathElement.pathElement(SUBDEPLOYMENT, deploymentName)); }
/** * @see #getDeploymentSubModel(String, org.jboss.as.controller.PathElement, DeploymentUnit) */ static ModelNode getDeploymentSubModel(final String subsystemName, final PathElement address, final DeploymentUnit unit) { final Resource root = unit.getAttachment(DEPLOYMENT_RESOURCE); synchronized (root) { final ImmutableManagementResourceRegistration registration = unit.getAttachment(REGISTRATION_ATTACHMENT); final PathElement subsystemPath = PathElement.pathElement(SUBSYSTEM, subsystemName); if (address == null) { return getOrCreate(root, subsystemPath, null).getModel(); } Resource parent = getOrCreate(root, subsystemPath); final ImmutableManagementResourceRegistration subModel = registration.getSubModel(PathAddress.pathAddress(subsystemPath, address)); if (subModel == null) { throw new IllegalStateException(address.toString()); } return getOrCreate(parent, address, null).getModel(); } }
/** * @see #getDeploymentSubModel(String, org.jboss.as.controller.PathElement, DeploymentUnit) */ static ModelNode getDeploymentSubModel(final String subsystemName, final PathElement address, final DeploymentUnit unit) { final Resource root = unit.getAttachment(DEPLOYMENT_RESOURCE); synchronized (root) { final ImmutableManagementResourceRegistration registration = unit.getAttachment(REGISTRATION_ATTACHMENT); final PathElement subsystemPath = PathElement.pathElement(SUBSYSTEM, subsystemName); if (address == null) { return getOrCreate(root, subsystemPath, null).getModel(); } Resource parent = getOrCreate(root, subsystemPath); final ImmutableManagementResourceRegistration subModel = registration.getSubModel(PathAddress.pathAddress(subsystemPath, address)); if (subModel == null) { throw new IllegalStateException(address.toString()); } return getOrCreate(parent, address, null).getModel(); } }
/** * @see #getDeploymentSubModel(String, org.jboss.as.controller.PathAddress) */ static ModelNode getDeploymentSubModel(final String subsystemName, final PathAddress address, final Resource resource, final DeploymentUnit unit) { final Resource root = unit.getAttachment(DEPLOYMENT_RESOURCE); synchronized (root) { final ImmutableManagementResourceRegistration registration = unit.getAttachment(REGISTRATION_ATTACHMENT); final PathElement subsystemPath = PathElement.pathElement(SUBSYSTEM, subsystemName); if (address == PathAddress.EMPTY_ADDRESS) { return getOrCreate(root, subsystemPath, resource).getModel(); } Resource parent = getOrCreate(root, subsystemPath); int count = address.size() - 1; for (int index = 0; index < count; index++) { parent = getOrCreate(parent, address.getElement(index)); } final ImmutableManagementResourceRegistration subModel = registration.getSubModel(getSubsystemAddress(subsystemName, address)); if (subModel == null) { throw new IllegalStateException(address.toString()); } return getOrCreate(parent, address.getLastElement(), resource).getModel(); } }
/** * @see #getDeploymentSubModel(String, org.jboss.as.controller.PathAddress) */ static ModelNode getDeploymentSubModel(final String subsystemName, final PathAddress address, final Resource resource, final DeploymentUnit unit) { final Resource root = unit.getAttachment(DEPLOYMENT_RESOURCE); synchronized (root) { final ImmutableManagementResourceRegistration registration = unit.getAttachment(REGISTRATION_ATTACHMENT); final PathElement subsystemPath = PathElement.pathElement(SUBSYSTEM, subsystemName); if (address == PathAddress.EMPTY_ADDRESS) { return getOrCreate(root, subsystemPath, resource).getModel(); } Resource parent = getOrCreate(root, subsystemPath); int count = address.size() - 1; for (int index = 0; index < count; index++) { parent = getOrCreate(parent, address.getElement(index)); } final ImmutableManagementResourceRegistration subModel = registration.getSubModel(getSubsystemAddress(subsystemName, address)); if (subModel == null) { throw new IllegalStateException(address.toString()); } return getOrCreate(parent, address.getLastElement(), resource).getModel(); } }
return register(root, subsystemPath, resource).getModel(); Resource parent = getOrCreate(root, subsystemPath); int count = address.size() - 1; for (int index = 0; index < count; index++) { parent = getOrCreate(parent, address.getElement(index));
return register(root, subsystemPath, resource).getModel(); Resource parent = getOrCreate(root, subsystemPath); int count = address.size() - 1; for (int index = 0; index < count; index++) { parent = getOrCreate(parent, address.getElement(index));