Package org.jboss.as.controller.registry

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


        final ModelNode domainModel = Resource.Tools.readModel(context.getRootResource());
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                // start servers
                final Resource resource =  context.readResource(PathAddress.EMPTY_ADDRESS);
                final ModelNode hostModel = Resource.Tools.readModel(resource);
                if(hostModel.hasDefined(SERVER_CONFIG)) {
                    final ModelNode servers = hostModel.get(SERVER_CONFIG).clone();
                    if (hostControllerEnvironment.isRestart() || runningModeControl.getRestartMode() == RestartMode.HC_ONLY){
                        restartedHcStartOrReconnectServers(servers, domainModel);
View Full Code Here


        this.extensionRegistry = extensionRegistry;
    }

    @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);
        dc.get(LOCAL).setEmptyObject();

        if (dc.has(REMOTE)) {
View Full Code Here

    public void execute(OperationContext context, ModelNode operation) {
        if (!context.isBooting()) {
            throw MESSAGES.invocationNotAllowedAfterBoot(OPERATION_NAME);
        }

        final Resource rootResource = context.createResource(PathAddress.EMPTY_ADDRESS);
        final ModelNode model = rootResource.getModel();

        initCoreModel(model, hostControllerEnvironment);

        // Create the empty management security resources
        context.createResource(PathAddress.pathAddress(PathElement.pathElement(CORE_SERVICE, MANAGEMENT)));

        // Wire in the platform mbean resources. We're bypassing the context.createResource API here because
        // we want to use our own resource type. But it's ok as the createResource calls above have taken the lock
        rootResource.registerChild(PlatformMBeanConstants.ROOT_PATH, new RootPlatformMBeanResource());
        // Wire in the ignored-resources resource
        Resource.ResourceEntry ignoredRoot = ignoredDomainResourceRegistry.getRootResource();
        rootResource.registerChild(ignoredRoot.getPathElement(), ignoredRoot);

        // Add a step to store the HC name
        ModelNode writeNameOp = Util.getWriteAttributeOperation(operation.get(OP_ADDR), NAME, operation.get(NAME));
        context.addStep(writeNameOp, hostControllerEnvironment.getProcessNameWriteHandler(), OperationContext.Stage.IMMEDIATE);
View Full Code Here

        this.environment = environment;
    }

    @Override
    protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> handbackHolder) throws OperationFailedException {
        final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
        final ModelNode subModel = resource.getModel();
        final ServiceVerificationHandler handler = new ServiceVerificationHandler();
        updateHttpManagementService(context, subModel, hostControllerInfo, environment, handler);
        context.addStep(handler, OperationContext.Stage.VERIFY);

        return false;
View Full Code Here

    @Override
    protected void revertUpdateToRuntime(final OperationContext context, final ModelNode operation,
                                         final String attributeName, final ModelNode valueToRestore,
                                         final ModelNode valueToRevert, final Void handback) throws OperationFailedException {
        final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
        final ModelNode subModel = resource.getModel().clone();
        subModel.get(attributeName).set(valueToRestore);
        updateHttpManagementService(context, subModel, hostControllerInfo, environment, null);
    }
View Full Code Here

    protected LocalDomainControllerRemoveHandler() {
    }

    @Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
        final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
        final ModelNode model = resource.getModel();
        model.get(DOMAIN_CONTROLLER).setEmptyObject();
        context.completeStep();
    }
View Full Code Here

        }
    }

    @Override
    public Resource getChild(PathElement element) {
        Resource result = null;
        if (!isMaster() && IGNORED_RESOURCE_TYPE.equals(element.getKey())) {
            result = getChildInternal(element.getValue());
        }
        return result;
    }
View Full Code Here

        return result;
    }

    @Override
    public Resource requireChild(PathElement address) {
        final Resource resource = getChild(address);
        if(resource == null) {
            throw new NoSuchResourceException(address);
        }
        return resource;
    }
View Full Code Here

        }
    }

    @Override
    public Resource removeChild(PathElement address) {
        Resource result = null;
        if (IGNORED_RESOURCE_TYPE.equals(address.getKey())) {
            synchronized (children) {
                result = children.remove(address.getValue());
            }
        }
View Full Code Here

    protected RemoteDomainControllerRemoveHandler() {
    }

    @Override
    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
        final Resource resource = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS);
        final ModelNode model = resource.getModel();
        model.get(DOMAIN_CONTROLLER).setEmptyObject();
        context.completeStep();
    }
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.