Package org.jboss.as.controller.registry

Examples of org.jboss.as.controller.registry.Resource


        this.ignoredDomainResourceRegistry = ignoredDomainResourceRegistry;
    }

    @Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
        final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
        final ModelNode model = resource.getModel();
        ModelNode dc = model.get(DOMAIN_CONTROLLER);
        ModelNode remoteDC = dc.get(REMOTE);

        PORT.validateAndSet(operation, remoteDC);
        HOST.validateAndSet(operation, remoteDC);
View Full Code Here


        }
        for (Map.Entry<String, String> entry : properties.entrySet()) {
            PathElement childElement = PathElement.pathElement(
                    replaceEscapedCharacters(entry.getKey()),
                    replaceEscapedCharacters(entry.getValue()));
            Resource child = resource.getChild(childElement);
            if (child != null) {
                Map<String, String> childProps = new HashMap<String, String>(properties);
                childProps.remove(entry.getKey());
                PathAddress foundAddr = searchPathAddress(address.append(childElement), child, childProps);
                if (foundAddr != null) {
View Full Code Here

        //
    }

    @Override
    public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
        final Resource subsystem = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
        final ModelNode model = subsystem.getModel();

        final String serverBinding = operation.require(CommonAttributes.SERVER_BINDING).asString();
        final String registryBinding = operation.require(CommonAttributes.REGISTRY_BINDING).asString();

        model.get(CommonAttributes.SERVER_BINDING).set(serverBinding);
View Full Code Here

        if (handleChildren) {
            for (String type : current.getChildTypes()) {
                if (current.hasChildren(type)) {
                    for (ResourceEntry entry : current.getChildren(type)) {
                        final PathElement pathElement = entry.getPathElement();
                        final Resource child = current.getChild(pathElement);
                        final PathAddress childAddress = address.append(pathElement);
                        doIterate(child, childAddress);
                    }
                }
            }
View Full Code Here

    private static class EESubsystemDescribeHandler implements OperationStepHandler, DescriptionProvider {
        static final EESubsystemDescribeHandler INSTANCE = new EESubsystemDescribeHandler();

        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
            final ModelNode model = Resource.Tools.readModel(resource);
            final ModelNode op = createEESubSystemAddOperation();
            if (model.hasDefined(GlobalModulesDefinition.GLOBAL_MODULES)) {
                op.get(GlobalModulesDefinition.GLOBAL_MODULES).set(model.get(GlobalModulesDefinition.GLOBAL_MODULES));
            }
View Full Code Here

        ManagementAdaptor managementAdaptor = adaptor.getManagementAdaptor();
        if (managementAdaptor != null) {
            final String providerLabel = managementAdaptor.getIdentificationLabel();
            final String scopedPersistenceUnitName = pu.getScopedPersistenceUnitName();

            Resource providerResource = managementAdaptor.createPersistenceUnitResource(scopedPersistenceUnitName, providerLabel);
            ModelNode perPuNode = providerResource.getModel();
            perPuNode.get("scoped-unit-name").set(pu.getScopedPersistenceUnitName());
            // TODO this is a temporary hack into internals until DeploymentUnit exposes a proper Resource-based API
            final Resource deploymentResource = deploymentUnit.getAttachment(DeploymentModelUtils.DEPLOYMENT_RESOURCE);
            Resource subsystemResource;
            synchronized (deploymentResource) {
                subsystemResource = getOrCreateResource(deploymentResource, PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "jpa"));
            }
            synchronized (subsystemResource) {
                subsystemResource.registerChild(PathElement.pathElement(providerLabel, scopedPersistenceUnitName), providerResource);
            }
        }
    }
View Full Code Here

    private static Resource getOrCreateResource(final Resource parent, final PathElement element) {
        synchronized (parent) {
            if (parent.hasChild(element)) {
                return parent.requireChild(element);
            } else {
                final Resource resource = Resource.Factory.create();
                parent.registerChild(element, resource);
                return resource;
            }
        }
    }
View Full Code Here

                configuration = operation.get(CommonAttributes.MOD_CLUSTER_CONFIG).get(CommonAttributes.CONFIGURATION);
            }else {
                configuration = operation.get(CommonAttributes.MOD_CLUSTER_CONFIG);
            }
            resource.registerChild(ModClusterExtension.configurationPath, Resource.Factory.create());
            final Resource conf = resource.getChild(ModClusterExtension.configurationPath);
            final ModelNode confModel = conf.getModel();
            for(final String attribute : configuration.keys()) {
                if (attribute.equals(CommonAttributes.SSL)) {
                    conf.registerChild(ModClusterExtension.sslConfigurationPath, Resource.Factory.create());
                    final Resource ssl = conf.getChild(ModClusterExtension.sslConfigurationPath);
                    ModelNode sslnode;
                    if (configuration.get(attribute).hasDefined(CommonAttributes.CONFIGURATION)) {
                        sslnode = configuration.get(attribute).get(CommonAttributes.CONFIGURATION);
                    } else {
                        sslnode = configuration.get(attribute);
                    }
                    final ModelNode sslModel = ssl.getModel();
                    for (AttributeDefinition sslAttr : ModClusterSSLResourceDefinition.ATTRIBUTES) {
                        sslAttr.validateAndSet(sslnode, sslModel);
                    }
                }
                else if (attribute.equals(CommonAttributes.DYNAMIC_LOAD_PROVIDER) || attribute.equals(CommonAttributes.SIMPLE_LOAD_PROVIDER)) {
View Full Code Here

        } else {
            PathAddress subsystem = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, mainSubsystemName));
            Assert.assertFalse("Cannot exclude removal of subsystem itself", ignoredChildAddresses.contains(subsystem));
        }

        Resource rootResource = grabRootResource(kernelServices);

        List<PathAddress> addresses = new ArrayList<PathAddress>();
        PathAddress pathAddress = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, mainSubsystemName));
        Resource subsystemResource = rootResource.getChild(pathAddress.getLastElement());
        Assert.assertNotNull(subsystemResource);
        addresses.add(pathAddress);

        getAllChildAddressesForRemove(pathAddress, addresses, subsystemResource);
View Full Code Here

        op.get(OP).set(RootResourceGrabber.NAME);
        op.get(OP_ADDR).setEmptyList();
        ModelNode result = kernelServices.executeOperation(op);
        Assert.assertEquals(result.get(FAILURE_DESCRIPTION).asString(), SUCCESS, result.get(OUTCOME).asString());

        Resource rootResource = RootResourceGrabber.INSTANCE.resource;
        Assert.assertNotNull(rootResource);
        return rootResource;
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.registry.Resource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.