Package org.jboss.as.controller

Examples of org.jboss.as.controller.ProxyController


            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

            if(! preparedResult.finalizeTransaction(! rollback)) {
                final ServerIdentity identity = preparedResult.getServerIdentity();
                try {
                    // Replace the original proxyTask with the requireReloadTask
                    final ModelNode result = preparedResult.getPreparedOperation().getPreparedResult();
                    ProxyController proxy = hostProxies.get(identity.getHostName());
                    if (proxy == null) {
                        if (localHostName.equals(identity.getHostName())) {
                            // Use our server proxies
                            proxy = serverProxies.get(identity.getServerName());
                            if (proxy == null) {
View Full Code Here

            final ServerTaskExecutor taskExecutor = new ServerTaskExecutor(context, submittedTasks, preparedResults) {

                @Override
                protected boolean execute(TransactionalProtocolClient.TransactionalOperationListener<ServerTaskExecutor.ServerOperation> listener, ServerIdentity server, ModelNode original) throws OperationFailedException {
                    final String hostName = server.getHostName();
                    ProxyController proxy = hostProxies.get(hostName);
                    if (proxy == null) {
                        if (localHostName.equals(hostName)) {
                            // Use our server proxies
                            proxy = serverProxies.get(server.getServerName());
                        }
View Full Code Here

        verifyOp.get(OP_ADDR).add(HOST, address.getElement(0).getValue());
        context.addStep(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 (controller != null) {
                    context.getFailureDescription().set(MESSAGES.serverStillRunning(serverName));
                }
                context.stepCompleted();
            }
View Full Code Here

            // Create the boot updates
            final String hostControllerName = domainController.getLocalHostInfo().getLocalHostName();
            final ModelNode hostModel = domainModel.require(HOST).require(hostControllerName);
            final ModelNode updates = ManagedServerOperationsFactory.createBootUpdates(serverName, domainModel, hostModel, domainController, expressionResolver);
            // Register the remote communication
            final ProxyController controller = serverInventory.serverCommunicationRegistered(serverProcessName, channelHandler);
            try {
                // Send the boot updates
                final FlushableDataOutput output = comm.writeMessage(ManagementResponseHeader.create(comm.getRequestHeader()));
                try {
                    output.write(DomainServerProtocol.PARAM_OK);
View Full Code Here

                    remoteHosts.addAll(hostProxies.keySet());
                }

                Map<String, ProxyController> remoteProxies = new HashMap<String, ProxyController>();
                for (String host : remoteHosts) {
                    ProxyController proxy = hostProxies.get(host);
                    if (proxy != null) {
                        remoteProxies.put(host, proxy);
                    } else if (!global) {
                        throw MESSAGES.invalidOperationTargetHost(host);
                    }
View Full Code Here

            throw SlaveRegistrationException.forMasterInAdminOnlyMode(runningModeControl.getRunningMode());
        }

        final PathElement pe = PathElement.pathElement(ModelDescriptionConstants.HOST, hostName);
        final PathAddress addr = PathAddress.pathAddress(pe);
        ProxyController existingController = modelNodeRegistration.getProxyController(addr);

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

                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())){
            //This horrible hack is there to make sure that the slave has not crashed since we don't get notifications due to REM3-121
            if ((existingController instanceof RemoteProxyController)) {
                if (((RemoteProxyController)existingController).ping(3000)) {
                    throw new IllegalArgumentException("There is already a registered host named '" + pe.getValue() + "'");
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.