Package org.jboss.as.host.controller

Examples of org.jboss.as.host.controller.ServerInventory$ProxyCreatedCallback


                channel.close();
            }
        }

        public void handleMessage(final Channel channel, final DataInput input, final ManagementRequestHeader header) throws IOException {
            final ServerInventory inventory = serverInventory.getValue();
            final byte type = header.getOperationId();
            // Handle the server registration request
            if (type == DomainServerProtocol.REGISTER_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Register the communication channel
                        inventory.serverCommunicationRegistered(serverName, handler);
                        // Send the response once the server is fully registered
                        safeWriteResponse(channel, header, null);
                        // Onto the next message
                        channel.receiveMessage(handler.getReceiver());
                    }
                };
                executorService.execute(task);
            // Handle the server reconnect request
            } else if(type == DomainServerProtocol.SERVER_RECONNECT_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Check if the server is still in sync with the domain model
                        final byte param;
                        if(inventory.serverReconnected(serverName, handler)) {
                            param = DomainServerProtocol.PARAM_OK;
                        } else {
                            param = DomainServerProtocol.PARAM_RESTART_REQUIRED;
                        }
                        // Notify the server whether configuration is still in sync or it requires a reload
View Full Code Here


            final String message = input.readUTF(); // Server started/failed message
            context.executeAsync(new ManagementRequestContext.AsyncTask<ServerInventory>() {
                @Override
                public void execute(ManagementRequestContext<ServerInventory> serverInventoryManagementRequestContext) throws Exception {
                    try {
                        final ServerInventory inventory = context.getAttachment();
                        if(param == DomainServerProtocol.PARAM_OK) {
                            inventory.serverStarted(serverProcessName);
                        } else {
                            inventory.serverStartFailed(serverProcessName);
                        }
                    } finally {
                        resultHandler.done(null);
                    }
                }
View Full Code Here

                channel.close();
            }
        }

        public void handleMessage(final Channel channel, final DataInput input, final ManagementRequestHeader header) throws IOException {
            final ServerInventory inventory = serverInventory.getValue();
            final byte type = header.getOperationId();
            // Handle the server registration request
            if (type == DomainServerProtocol.REGISTER_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Register the communication channel
                        inventory.serverCommunicationRegistered(serverName, handler);
                        // Send the response once the server is fully registered
                        safeWriteResponse(channel, header, null);
                        // Onto the next message
                        channel.receiveMessage(handler.getReceiver());
                    }
                };
                executorService.execute(task);
            // Handle the server reconnect request
            } else if(type == DomainServerProtocol.SERVER_RECONNECT_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Check if the server is still in sync with the domain model
                        final byte param;
                        if(inventory.serverReconnected(serverName, handler)) {
                            param = DomainServerProtocol.PARAM_OK;
                        } else {
                            param = DomainServerProtocol.PARAM_RESTART_REQUIRED;
                        }
                        // Notify the server whether configuration is still in sync or it requires a reload
View Full Code Here

            final String message = input.readUTF(); // Server started/failed message
            context.executeAsync(new ManagementRequestContext.AsyncTask<ServerInventory>() {
                @Override
                public void execute(ManagementRequestContext<ServerInventory> serverInventoryManagementRequestContext) throws Exception {
                    try {
                        final ServerInventory inventory = context.getAttachment();
                        if(param == DomainServerProtocol.PARAM_OK) {
                            inventory.serverStarted(serverProcessName);
                        } else {
                            inventory.serverStartFailed(serverProcessName);
                        }
                    } finally {
                        resultHandler.done(null);
                    }
                }
View Full Code Here

                channel.close();
            }
        }

        public void handleMessage(final Channel channel, final DataInput input, final ManagementRequestHeader header) throws IOException {
            final ServerInventory inventory = serverInventory.getValue();
            final byte type = header.getOperationId();
            // Handle the server registration request
            if (type == DomainServerProtocol.REGISTER_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Register the communication channel
                        inventory.serverCommunicationRegistered(serverName, handler);
                        // Send the response once the server is fully registered
                        safeWriteResponse(channel, header, null);
                        // Onto the next message
                        channel.receiveMessage(handler.getReceiver());
                    }
                };
                executorService.execute(task);
            // Handle the server reconnect request
            } else if(type == DomainServerProtocol.SERVER_RECONNECT_REQUEST) {
                expectHeader(input, DomainServerProtocol.PARAM_SERVER_NAME);
                final String serverName = input.readUTF();
                final Runnable task = new Runnable() {
                    @Override
                    public void run() {
                        CONTROLLER_MANAGEMENT_LOGGER.serverRegistered(serverName, channel);
                        // Create the server mgmt handler
                        final ManagementChannelHandler handler = new ManagementChannelHandler(channel, executorService, new ServerHandlerFactory(serverName));
                        // Check if the server is still in sync with the domain model
                        final byte param;
                        if(inventory.serverReconnected(serverName, handler)) {
                            param = DomainServerProtocol.PARAM_OK;
                        } else {
                            param = DomainServerProtocol.PARAM_RESTART_REQUIRED;
                        }
                        // Notify the server whether configuration is still in sync or it requires a reload
View Full Code Here

            final String message = input.readUTF(); // Server started/failed message
            context.executeAsync(new ManagementRequestContext.AsyncTask<ServerInventory>() {
                @Override
                public void execute(ManagementRequestContext<ServerInventory> serverInventoryManagementRequestContext) throws Exception {
                    try {
                        final ServerInventory inventory = context.getAttachment();
                        if(param == DomainServerProtocol.PARAM_OK) {
                            inventory.serverStarted(serverProcessName);
                        } else {
                            inventory.serverStartFailed(serverProcessName);
                        }
                    } finally {
                        resultHandler.done(null);
                    }
                }
View Full Code Here

            final String message = input.readUTF(); // Server started/failed message
            context.executeAsync(new ManagementRequestContext.AsyncTask<ServerInventory>() {
                @Override
                public void execute(ManagementRequestContext<ServerInventory> serverInventoryManagementRequestContext) throws Exception {
                    try {
                        final ServerInventory inventory = context.getAttachment();
                        if(param == DomainServerProtocol.PARAM_OK) {
                            inventory.serverStarted(serverProcessName);
                        } else {
                            inventory.serverStartFailed(serverProcessName);
                        }
                    } finally {
                        resultHandler.done(null);
                    }
                }
View Full Code Here

TOP

Related Classes of org.jboss.as.host.controller.ServerInventory$ProxyCreatedCallback

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.