Package org.jboss.as.controller

Examples of org.jboss.as.controller.PathAddress


        model.get(LEVEL).set(operation.get(LEVEL));
        model.get(FILE).set(operation.get(FILE));
    }

    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();

        final ServiceTarget serviceTarget = context.getServiceTarget();
        try {
            final FileHandlerService service = new FileHandlerService();
View Full Code Here


        if (existingFile.hasDefined(CommonAttributes.RELATIVE_TO)) {
            existingFile.get(CommonAttributes.RELATIVE_TO).set(operation.get(CommonAttributes.RELATIVE_TO));
        }

        final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
        final String name = address.getLastElement().getValue();

        if (context.getType() == OperationContext.Type.SERVER) {
            context.addStep(new OperationStepHandler() {
                public void execute(final OperationContext context, final ModelNode operation) {
                    final ServiceRegistry serviceRegistry = context.getServiceRegistry(false);
View Full Code Here

class LoggerHandlerRemove extends AbstractRemoveStepHandler {

    static final LoggerHandlerRemove INSTANCE = new LoggerHandlerRemove();

    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        context.removeService(LogServices.handlerName(name));
    }
View Full Code Here

        model.get(FILE).set(operation.get(FILE));
        model.get(SUFFIX).set(operation.get(SUFFIX));
    }

    protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {
        final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
        final String name = address.getLastElement().getValue();
        final ServiceTarget serviceTarget = context.getServiceTarget();
        try {
            final PeriodicRotatingFileHandlerService service = new PeriodicRotatingFileHandlerService();
            final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
            if (operation.hasDefined(FILE)) {
View Full Code Here

public class HandlerLevelChange implements OperationStepHandler {
    static final String OPERATION_NAME = "change-log-level";
    static final HandlerLevelChange INSTANCE = new HandlerLevelChange();

    public void execute(OperationContext context, ModelNode operation) {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();
        final String level = operation.get(CommonAttributes.LEVEL).asString();

        context.readModelForUpdate(PathAddress.EMPTY_ADDRESS).get(CommonAttributes.LEVEL).set(level);

        if (context.getType() == OperationContext.Type.SERVER) {
View Full Code Here

        static final String PROXIES = "proxies";

        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {

            final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
            final ModelNode result = readModel(context, operation, resultHandler, address);
            resultHandler.handleResultFragment(Util.NO_LOCATION, result);
            resultHandler.handleResultComplete();
            return new BasicOperationResult();
        }
View Full Code Here

                for (ProxyController proxyController : proxyControllers) {
                    final ModelNode proxyResult = proxyController.execute(OperationBuilder.Factory.copy(context, operation).build());

                    //Trim the address to not include the host=>hostB part if this is a slave controller
                    PathAddress proxyAddress = proxyController.getProxyNodeAddress();
//                    if (proxyAddress.size() > 1) {
//                        if (proxyAddress.getElement(0).getKey().equals(HOST)) {
//                            proxyAddress = proxyAddress.subAddress(1);
//                            proxyResult =
//                        }
View Full Code Here

        @Override
        public OperationResult execute(final OperationContext context, final ModelNode operation, final ResultHandler resultHandler) throws OperationFailedException {
            OperationResult handlerResult = new BasicOperationResult();

            final String attributeName = operation.require(NAME).asString();
            final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
            final AttributeAccess attributeAccess = context.getRegistry().getAttributeAccess(address, attributeName);
            if (attributeAccess == null) {
                final Set<String> children = context.getRegistry().getChildNames(address);
                if(children.contains(attributeName)) {
                    throw new OperationFailedException(new ModelNode().set(String.format("'%s' is a registered child of resource (%s)", attributeName, address))); // TODO i18n
View Full Code Here

            if (!subModel.isDefined()) {
                final ModelNode result = new ModelNode();
                result.setEmptyList();
                resultHandler.handleResultFragment(new String[0], result);
            } else {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
                final Set<String> childNames = context.getRegistry().getChildNames(address);
                if (!childNames.contains(childName)) {
                    throw new OperationFailedException(new ModelNode().set("No known child called " + childName)); //TODO i18n
                } else {
                    final ModelNode result = new ModelNode();
View Full Code Here

                final ModelNode result = new ModelNode();
                result.setEmptyList();
                resultHandler.handleResultFragment(new String[0], result);
                resultHandler.handleResultComplete();
            } else {
                final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
                final Set<String> childNames = context.getRegistry().getChildNames(address);
                if (!childNames.contains(childName)) {
                    throw new OperationFailedException(new ModelNode().set("No known child called " + childName)); //TODO i18n
                } else {
                    final AtomicBoolean ok = new AtomicBoolean(true);
                    final ModelNode result = new ModelNode();
                    subModel = subModel.get(childName);
                    if (!subModel.isDefined()) {
                        result.setEmptyList();
                    } else {

                        for (final String key : subModel.keys()) {
                            if (!ok.get()) {
                                break;
                            }
                            final PathAddress childAddress = address.append(PathElement.pathElement(childName, key));

                            final ModelNode readOp = operation.clone();
                            readOp.get(OP_ADDR).set(childAddress.toModelNode());

                            if(operation.hasDefined(INCLUDE_RUNTIME))
                                readOp.get(INCLUDE_RUNTIME).set(operation.get(INCLUDE_RUNTIME).asBoolean());

                            final ModelNode readResult = readModel(context, readOp, new ResultHandler() {
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.PathAddress

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.