Package org.jboss.remoting3.jmx

Examples of org.jboss.remoting3.jmx.RemotingConnector$ShutDownHook


    private void connectionClosed() {
        if(! reconnect.get()) {
            return; // Nothing to do
        }
        // Wait until the connection is closed before reconnecting
        final Connection connection = this.connection;
        if(connection != null) {
            if(channel == null) {
                connection.closeAsync();
            }
        } else {
            HostControllerLogger.ROOT_LOGGER.lostRemoteDomainConnection();
            executorService.execute(new Runnable() {
                @Override
View Full Code Here


     *
     * @param connectionURI the new connection URI
     */
    protected void reconfigure(final URI connectionURI) {
        configuration.setUri(connectionURI);
        final Connection connection = this.connection;
        if(connection != null) {
            connection.closeAsync();
        }
    }
View Full Code Here

     * Disconnect from the remote controller, allowing reconnection.
     *
     * @throws IOException
     */
    protected void disconnect() throws IOException {
        final Connection connection = this.connection;
        if(connection != null) {
            connection.close();
        }
    }
View Full Code Here

     * @throws InterruptedException
     */
    protected void awaitConnectionClosed(final Connection ref) throws InterruptedException {
        synchronized (this) {
            for(;;) {
                final Connection connection = this.connection;
                if(connection == null) {
                    return;
                } else if (connection != ref) {
                    return;
                }
View Full Code Here

    @Override
    public void close() throws IOException {
        synchronized (this) {
            if(closed.compareAndSet(false, true)) {
                final Connection connection = this.connection;
                if(connection != null) {
                    connection.close();
                }
            }
        }
    }
View Full Code Here

        @Override
        public Channel getChannel() throws IOException {
            if(channel == null) {
                synchronized (this) {
                    if(channel == null) {
                        final Connection connection = connect();
                        channel = openChannel(connection);
                        channel.receiveMessage(handler.getReceiver());
                    }
                }
            }
View Full Code Here

    public ModelNode executeAwaitConnectionClosed(final ModelNode operation) throws IOException {
        final DomainTestClient client = internalGetOrCreateClient();
        final Channel channel = client.getChannel();
        if( null == channel )
            throw new IllegalStateException("Didn't get a remoting channel from the DomainTestClient.");
        final Connection ref = channel.getConnection();
        ModelNode result = new ModelNode();
        try {
            result = client.execute(operation);
            // IN case the operation wasn't successful, don't bother waiting
            if(! "success".equals(result.get("outcome").asString())) {
View Full Code Here

            final String connectionName = outboundConnectionService.getConnectionName();
            logger.debug("Creating remoting EJB receiver for connection " + connectionName);
            try {
                final IoFuture<Connection> futureConnection = outboundConnectionService.connect();
                // TODO: Make the timeout configurable
                final Connection connection = IoFutureHelper.get(futureConnection, DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS);
                // add it to the successful connection list to be returned
                connections.add(connection);

            } catch (IOException ioe) {
                // just log a WARN and move on to the next
View Full Code Here

        this.optionMap = optionMap;
    }

    /** {@inheritDoc} */
    public synchronized void start(final StartContext context) throws StartException {
        final Endpoint endpoint;
        try {
            boolean ok = false;
            endpoint = Remoting.createEndpoint(endpointName, optionMap);
            try {
                endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.EMPTY);
                ok = true;
            } finally {
                if (! ok) {
                    endpoint.closeAsync();
                }
            }
        } catch (IOException e) {
            throw new StartException("Failed to start service", e);
        }
View Full Code Here

        }
    }

    /** {@inheritDoc} */
    public synchronized Endpoint getValue() throws IllegalStateException {
        final Endpoint endpoint = this.endpoint;
        if (endpoint == null) throw new IllegalStateException();
        return endpoint;
    }
View Full Code Here

TOP

Related Classes of org.jboss.remoting3.jmx.RemotingConnector$ShutDownHook

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.