Package org.jboss.as.controller

Examples of org.jboss.as.controller.ProxyController


                checkState(server, ServerState.STARTING);
            }
            server.setState(ServerState.STARTED);

            final PathElement element = PathElement.pathElement(RUNNING_SERVER, server.getServerName());
            final ProxyController serverController = RemoteProxyController.create(Executors.newCachedThreadPool(),
                    PathAddress.pathAddress(PathElement.pathElement(HOST, domainController.getLocalHostInfo().getLocalHostName()), element),
                    ProxyOperationAddressTranslator.SERVER,
                    channel);
            if (callback != null && serverController instanceof ManagementOperationHandler) {
                callback.proxyOperationHandlerCreated((ManagementOperationHandler)serverController);
View Full Code Here


        if (!hostControllerInfo.isMasterDomainController()) {
            throw new UnsupportedOperationException("Registration of remote hosts is not supported on slave host controllers");
        }
        PathAddress pa = hostControllerClient.getProxyNodeAddress();
        PathElement pe = pa.getElement(0);
        ProxyController existingController = modelNodeRegistration.getProxyController(pa);

        if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){
            throw new IllegalArgumentException("There is already a registered host named '" + pe.getValue() + "'");
        }
        modelNodeRegistration.registerProxyController(pe, hostControllerClient);
View Full Code Here

        verifyOp.get(OP_ADDR).add(HOST, address.getElement(0).getValue());
        context.addStep(context.getResult(), verifyOp, new OperationStepHandler() {
            @Override
            public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
                final PathAddress serverAddress = PathAddress.EMPTY_ADDRESS.append(PathElement.pathElement(SERVER, serverName));
                final ProxyController controller = context.getResourceRegistration().getProxyController(serverAddress);
                if(! context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).contains(SERVER)) {
                    throw new OperationFailedException(new ModelNode().set(context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).toString()));
                }
                if(controller != null) {
                    context.getFailureDescription().set("server (" + serverName + ") still running");
View Full Code Here

        verifyOp.get(OP_ADDR).add(HOST, address.getElement(0).getValue());
        context.addStep(context.getResult(), verifyOp, new OperationStepHandler() {
            @Override
            public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
                final PathAddress serverAddress = PathAddress.EMPTY_ADDRESS.append(PathElement.pathElement(SERVER, serverName));
                final ProxyController controller = context.getResourceRegistration().getProxyController(serverAddress);
                if(! context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).contains(SERVER)) {
                    throw new OperationFailedException(new ModelNode().set(context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).toString()));
                }
                if(controller != null) {
                    context.getFailureDescription().set(MESSAGES.serverStillRunning(serverName));
View Full Code Here

            return;
        }
        server.serverStarted(new ManagedServer.TransitionTask() {
            @Override
            public void execute(ManagedServer server) throws Exception {
                final ProxyController proxy = server.getProxyController();
                if(proxy != null) {
                    domainController.registerRunningServer(proxy);
                }
            }
        });
View Full Code Here

        if (runningModeControl.getRunningMode() == RunningMode.ADMIN_ONLY) {
            throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode());
        }
        PathAddress pa = hostControllerClient.getProxyNodeAddress();
        PathElement pe = pa.getElement(0);
        ProxyController existingController = modelNodeRegistration.getProxyController(pa);

        if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){
            throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue());
        }
        modelNodeRegistration.registerProxyController(pe, hostControllerClient);
View Full Code Here

        assertNull(root.getProxyController(PathAddress.pathAddress(profileB)));
        assertNull(root.getProxyController(PathAddress.pathAddress(profileB, PathElement.pathElement("a", "b"))));

        PathAddress address = PathAddress.pathAddress(profileB, proxyA);
        ProxyController proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(address, proxy.getProxyNodeAddress());

        address = PathAddress.pathAddress(profileB, proxyB);
        proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(address, proxy.getProxyNodeAddress());

        address = PathAddress.pathAddress(profileB, proxyA, PathElement.pathElement("a", "b"), PathElement.pathElement("c", "d"));
        proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(PathAddress.pathAddress(profileB, proxyA), proxy.getProxyNodeAddress());


        address = PathAddress.pathAddress(proxyA);
        proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(address, proxy.getProxyNodeAddress());

        address = PathAddress.pathAddress(proxyB);
        proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(address, proxy.getProxyNodeAddress());

        address = PathAddress.pathAddress(proxyA, PathElement.pathElement("a", "b"), PathElement.pathElement("c", "d"));
        proxy = root.getProxyController(address);
        assertNotNull(proxy);
        assertEquals(PathAddress.pathAddress(proxyA), proxy.getProxyNodeAddress());
    }
View Full Code Here

        if (runningModeControl.getRunningMode() == RunningMode.ADMIN_ONLY) {
            throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode());
        }
        PathAddress pa = hostControllerClient.getProxyNodeAddress();
        PathElement pe = pa.getElement(0);
        ProxyController existingController = modelNodeRegistration.getProxyController(pa);

        if (existingController != null || hostControllerInfo.getLocalHostName().equals(pe.getValue())){
            throw SlaveRegistrationException.forHostAlreadyExists(pe.getValue());
        }
        modelNodeRegistration.registerProxyController(pe, hostControllerClient);
View Full Code Here

        verifyOp.get(OP_ADDR).add(HOST, address.getElement(0).getValue());
        context.addStep(context.getResult(), verifyOp, new OperationStepHandler() {
            @Override
            public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
                final PathAddress serverAddress = PathAddress.EMPTY_ADDRESS.append(PathElement.pathElement(SERVER, serverName));
                final ProxyController controller = context.getResourceRegistration().getProxyController(serverAddress);
                if(! context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).contains(SERVER)) {
                    throw new OperationFailedException(new ModelNode().set(context.getResourceRegistration().getChildNames(PathAddress.EMPTY_ADDRESS).toString()));
                }
                if(controller != null) {
                    context.getFailureDescription().set(MESSAGES.serverStillRunning(serverName));
View Full Code Here

            return;
        }
        server.serverStarted(new ManagedServer.TransitionTask() {
            @Override
            public void execute(ManagedServer server) throws Exception {
                final ProxyController proxy = server.getProxyController();
                if(proxy != null) {
                    domainController.registerRunningServer(proxy);
                }
            }
        });
View Full Code Here

TOP

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

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.