Package org.jboss.remoting3

Examples of org.jboss.remoting3.Channel.addCloseHandler()


    /** {@inheritDoc} */
    public synchronized void start(final StartContext context) throws StartException {
        final Channel channel = hcChannel.getValue();
        final HostControllerServerHandler handler = new HostControllerServerHandler(controller.getValue(), executor);
        channel.addCloseHandler(new CloseHandler<Channel>() {
            @Override
            public void handleClose(final Channel closed, final IOException exception) {
                handler.shutdownNow();
            }
        });
View Full Code Here


    @Override
    public void connectionOpened(final Connection connection) throws IOException {
        final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap());
        if(setChannel(channel)) {
            channel.receiveMessage(channelHandler.getReceiver());
            channel.addCloseHandler(channelHandler);
            try {
                // Start the registration process
                channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get();
            } catch (Exception e) {
                if(e.getCause() instanceof IOException) {
View Full Code Here

            return null;
        }
        try {
            final TransactionalProtocolClient client = server.channelRegistered(channelAssociation);
            final Channel channel = channelAssociation.getChannel();
            channel.addCloseHandler(new CloseHandler<Channel>() {

                public void handleClose(final Channel closed, final IOException exception) {
                    final boolean shuttingDown = shutdown || connectionFinished;
                    // Unregister right away
                    if(server.callbackUnregistered(client, shuttingDown)) {
View Full Code Here

        }

        @Override
        protected Channel openChannel(final Connection connection, final String serviceType, final OptionMap options) throws IOException {
            final Channel channel = super.openChannel(connection, serviceType, options);
            channel.addCloseHandler(closeHandler);
            return channel;
        }

    }
View Full Code Here

        this.remoteAsyncInvocationCancelStatus = asyncInvocationCancelStatusService;
    }

    public void startReceiving() {
        final Channel channel = this.channelAssociation.getChannel();
        channel.addCloseHandler(new ChannelCloseHandler());

        channel.receiveMessage(this);
        // listen to module availability/unavailability events
        this.deploymentRepository.addListener(this);
        // listen to new clusters (a.k.a groups) being started/stopped
View Full Code Here

    @Override
    public void connectionOpened(final Connection connection) throws IOException {
        final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap());
        if(setChannel(channel)) {
            channel.receiveMessage(channelHandler.getReceiver());
            channel.addCloseHandler(channelHandler);
        } else {
            channel.closeAsync();
        }
    }
View Full Code Here

        this.clientMappingRegistryCollector = clientMappingRegistryCollector;
    }

    public void startReceiving() {
        final Channel channel = this.channelAssociation.getChannel();
        channel.addCloseHandler(new ChannelCloseHandler());

        channel.receiveMessage(this);
        // listen to module availability/unavailability events
        this.deploymentRepository.addListener(this);
        // listen to new clusters (a.k.a groups) being started/stopped
View Full Code Here

    public synchronized ProxyController popChannelAndCreateProxy(final String hostName) {
        final Channel channel = unregisteredHostChannels.remove(hostName);
        if (channel == null) {
            throw MESSAGES.noChannelForHost(hostName);
        }
        channel.addCloseHandler(new CloseHandler<Channel>() {
            public void handleClose(final Channel closed, final IOException exception) {
                unregisterRemoteHost(hostName);
            }
        });
        final PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.HOST, hostName));
View Full Code Here

                        final Channel mgmtChannel = context.getChannel();
                        registry.registerChannel(hostId, mgmtChannel, new ProxyCreatedCallback() {
                            @Override
                            public void proxyCreated(final ManagementMessageHandler handler) {
                                proxyHandler = handler;
                                mgmtChannel.addCloseHandler(new CloseHandler<Channel>() {
                                    @Override
                                    public void handleClose(Channel closed, IOException exception) {
                                        handler.shutdownNow();
                                    }
                                });
View Full Code Here

                    // Connection opened notification
                    final ConnectionOpenHandler openHandler = connectTask.getConnectionOpenedHandler();
                    openHandler.connectionOpened(connection);
                    ok = true;
                    this.connection = connection;
                    connection.addCloseHandler(new CloseHandler<Connection>() {
                        @Override
                        public void handleClose(Connection closed, IOException exception) {
                            onConnectionClose(closed);
                        }
                    });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.