Package org.jboss.as.controller

Examples of org.jboss.as.controller.PathAddress


            model.get(SECURITY_REALM).set(operation.get(SECURITY_REALM).asString());
        }
    }

    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 connectorName = address.getLastElement().getValue();
        ServiceName tmpDirPath = ServiceName.JBOSS.append("server", "path", "jboss.controller.temp.dir");
        final ServiceName securityRealm = model.hasDefined(SECURITY_REALM) ? SecurityRealmService.BASE_SERVICE_NAME
                .append(model.require(SECURITY_REALM).asString()) : null;
        RemotingServices.installSecurityServices(context.getServiceTarget(), connectorName, securityRealm, null, tmpDirPath, verificationHandler, newControllers);
        launchServices(context, address, connectorName, model, verificationHandler, newControllers);
View Full Code Here


*/
public class HandlerDisable implements OperationStepHandler {
    static final HandlerDisable INSTANCE = new HandlerDisable();

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

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

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

    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();

        final ConsoleHandlerService service = new ConsoleHandlerService();
        final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
View Full Code Here

    static final LoggingDescribeHandler INSTANCE = new LoggingDescribeHandler();

    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
        final ModelNode model = context.readModel(PathAddress.EMPTY_ADDRESS);

        PathAddress rootAddress = PathAddress.pathAddress(PathAddress.pathAddress(operation.require(OP_ADDR)).getLastElement());
        final ModelNode result = context.getResult();
        result.add(LoggingExtension.NewLoggingSubsystemAdd.createOperation(rootAddress.toModelNode()));
        if (model.hasDefined(ROOT_LOGGER)) {
            ModelNode add = Util.getEmptyOperation(RootLoggerAdd.OPERATION_NAME, rootAddress.toModelNode());
            add.get(LEVEL).set(model.get(ROOT_LOGGER, LEVEL));
            add.get(HANDLERS).set(model.get(ROOT_LOGGER, HANDLERS));
            result.add(add);
        }
        if (model.hasDefined(LOGGER)) {
            for (Property prop : model.get(LOGGER).asPropertyList()) {
                ModelNode add = Util.getEmptyOperation(ADD, rootAddress.append(PathElement.pathElement(LOGGER, prop.getName())).toModelNode());
                add.get(HANDLERS).set(prop.getValue().get(HANDLERS));
                add.get(LEVEL).set(prop.getValue().get(LEVEL));
                result.add(add);
            }
        }
View Full Code Here

*/
public class HandlerEnable implements OperationStepHandler {
    static final HandlerEnable INSTANCE = new HandlerEnable();

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

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

        model.get(MAX_BACKUP_INDEX).set(operation.get(MAX_BACKUP_INDEX));
        model.get(ROTATE_SIZE).set(operation.get(ROTATE_SIZE));
    }

    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 SizeRotatingFileHandlerService service = new SizeRotatingFileHandlerService();
            final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
            if (operation.hasDefined(FILE)) {
View Full Code Here

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

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

        final ServiceTarget serviceTarget = context.getServiceTarget();
        final AsyncHandlerService service = new AsyncHandlerService();
        final ServiceBuilder<Handler> serviceBuilder = serviceTarget.addService(LogServices.handlerName(name), service);
        final List<InjectedValue<Handler>> list = new ArrayList<InjectedValue<Handler>>();
View Full Code Here

*/
public abstract class HandlerUpdateProperties implements OperationStepHandler {
    static final String OPERATION_NAME = "update-properties";

    public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
        final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
        final String name = address.getLastElement().getValue();

        final ModelNode model = context.readModelForUpdate(PathAddress.EMPTY_ADDRESS);

        if (operation.hasDefined(LEVEL)) {
            apply(operation, model, LEVEL);
View Full Code Here

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

    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

        model.get(CommonAttributes.LEVEL).set(level);
        model.get(CommonAttributes.HANDLERS).set(handlers);
    }

    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 String level = operation.require(CommonAttributes.LEVEL).asString();
        final ModelNode handlers = operation.hasDefined(CommonAttributes.HANDLERS) ? operation.get(CommonAttributes.HANDLERS) : new ModelNode();

        final ServiceTarget target = context.getServiceTarget();
        final String loggerName = name;
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.