Package org.jboss.as.controller

Examples of org.jboss.as.controller.ProxyController


                    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 new OperationFailedException(new ModelNode().set(String.format("Operation targets host %s but that host is not registered", host)));
                    }
View Full Code Here


        op.get(OPERATION_HEADERS, "execute-for-coordinator").set(true);
        op.get(OP_ADDR).setEmptyList();
        op.get(DOMAIN_MODEL).set(modelDescription);

        //TODO get this from somewhere
        final ProxyController proxy = registry.popChannelAndCreateProxy(hostName);

        final AtomicReference<ModelNode> failedRef = new AtomicReference<ModelNode>();
        final AtomicReference<ModelNode> preparedRef = new AtomicReference<ModelNode>();
        final AtomicReference<OperationTransaction> txRef = new AtomicReference<OperationTransaction>();
        ProxyController.ProxyOperationControl control = new ProxyController.ProxyOperationControl() {

            @Override
            public void operationFailed(ModelNode response) {
                failedRef.set(response);
            }

            @Override
            public void operationPrepared(OperationTransaction transaction, ModelNode result) {
                txRef.set(transaction);
                preparedRef.set(result);
            }

            @Override
            public void operationCompleted(ModelNode response) {
            }
        };
        proxy.execute(op, OperationMessageHandler.logging, control, null);

        if (failedRef.get() != null) {
            final ModelNode failed = failedRef.get();
            context.getResult().set(failed.get(RESULT));
            context.getFailureDescription().set(failed.get(FAILURE_DESCRIPTION));
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

    public static Map<String, ProxyController> getServerProxies(String localHostName, Resource domainRootResource, ImmutableManagementResourceRegistration domainRootResourceRegistration) {
        final Set<String> serverNames = domainRootResource.getChild(PathElement.pathElement(HOST, localHostName)).getChildrenNames(SERVER_CONFIG);
        final Map<String, ProxyController> proxies = new HashMap<String, ProxyController>();
        for(String serverName : serverNames) {
            final PathAddress serverAddress = PathAddress.pathAddress(PathElement.pathElement(HOST, localHostName), PathElement.pathElement(SERVER, serverName));
            final ProxyController proxyController = domainRootResourceRegistration.getProxyController(serverAddress);
            if(proxyController != null) {
                proxies.put(serverName, proxyController);
            }
        }
        return proxies;
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

    }

    @Override
    public void registerRunningServer(String serverName, Connection connection) {
        final PathElement element = PathElement.pathElement(RUNNING_SERVER, serverName);
        final ProxyController serverController = RemoteProxyController.create(connection, PathAddress.pathAddress(PathElement.pathElement(HOST, name), element));
        getRegistry().registerProxyController(element, serverController);
        getModel().get(element.getKey(), element.getValue());
    }
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

                    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) {
                    ProxyController proxy = hostProxies.get(server.getHostName());
                    if (proxy == null) {
                        if (localHostName.equals(server.getHostName())) {
                            // Use our server proxies
                            proxy = serverProxies.get(server.getServerName());
                        }
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.