Package com.rabbitmq.client

Examples of com.rabbitmq.client.ShutdownSignalException


        checkShutdownSignal(expectedCode, sse);
    }

    public void checkShutdownSignal(int expectedCode, AlreadyClosedException ace) {
        ShutdownNotifierComponent snc = (ShutdownNotifierComponent) ace.getReference();
        ShutdownSignalException sse = snc.getCloseReason();
        checkShutdownSignal(expectedCode, sse);
    }
View Full Code Here


    public void testRequeueFalseNotSupported() throws Exception {
        try {
            channel.basicRecover(false);
            fail("basicRecover(false) should not be supported");
        } catch(IOException ioe) {
            ShutdownSignalException sse =
                (ShutdownSignalException) ioe.getCause();
            Command reason = (Command) sse.getReason();
            AMQP.Connection.Close close =
                (AMQP.Connection.Close) reason.getMethod();
            assertEquals("NOT_IMPLEMENTED - requeue=false",
                close.getReplyText());
        }
View Full Code Here

        }
    }

    private void asyncShutdown(Command command) throws IOException {
        releaseChannel();
        ShutdownSignalException signal = new ShutdownSignalException(false,
                                                                     false,
                                                                     command,
                                                                     this);
        synchronized (_channelMutex) {
            try {
View Full Code Here

        // First, notify all our dependents that we are shutting down.
        // This clears isOpen(), so no further work from the
        // application side will be accepted, and any inbound commands
        // will be discarded (unless they're channel.close-oks).
        Channel.Close reason = new Channel.Close(closeCode, closeMessage, 0, 0);
        ShutdownSignalException signal = new ShutdownSignalException(false,
                                                                     initiatedByApplication,
                                                                     reason,
                                                                     this);
        if (cause != null) {
            signal.initCause(cause);
        }

        BlockingRpcContinuation<AMQCommand> k = new SimpleBlockingRpcContinuation();
        boolean notify = false;
        try {
View Full Code Here

     */
    private volatile ShutdownSignalException shutdownCause = null;

    public void addShutdownListener(ShutdownListener listener)
    {
        ShutdownSignalException sse = null;
        synchronized(this.monitor) {
            sse = this.shutdownCause;
            this.shutdownListeners.add(listener);
        }
        if (sse != null) // closed
View Full Code Here

        }
    }

    public void notifyListeners()
    {
        ShutdownSignalException sse = null;
        ShutdownListener[] sdls = null;
        synchronized(this.monitor) {
            sdls = this.shutdownListeners
                .toArray(new ShutdownListener[this.shutdownListeners.size()]);
            sse = this.shutdownCause;
View Full Code Here

            }
        }
    }

    public void handleConnectionClose(Command closeCommand) {
        ShutdownSignalException sse = shutdown(closeCommand, false, null, false);
        try {
            _channel0.quiescingTransmit(new AMQP.Connection.CloseOk.Builder().build());
        } catch (IOException _) { } // ignore
        _brokerInitiatedShutdown = true;
        Thread scw = new SocketCloseWait(sse);
View Full Code Here

    public ShutdownSignalException shutdown(Object reason,
                         boolean initiatedByApplication,
                         Throwable cause,
                         boolean notifyRpc)
    {
        ShutdownSignalException sse = new ShutdownSignalException(true,initiatedByApplication,
                                                                  reason, this);
        sse.initCause(cause);
        if (!setShutdownCauseIfOpen(sse)) {
            if (initiatedByApplication)
                throw new AlreadyClosedException("Attempt to use closed connection", this);
        }
View Full Code Here

            } else {
              _channel0.quiescingTransmit(reason);
            }
        } catch (TimeoutException tte) {
            if (!abort)
                throw new ShutdownSignalException(true, true, tte, this);
        } catch (ShutdownSignalException sse) {
            if (!abort)
                throw sse;
        } catch (IOException ioe) {
            if (!abort)
View Full Code Here

     */
    private volatile ShutdownSignalException shutdownCause = null;

    public void addShutdownListener(ShutdownListener listener)
    {
        ShutdownSignalException sse = null;
        synchronized(this.monitor) {
            sse = this.shutdownCause;
            this.shutdownListeners.add(listener);
        }
        if (sse != null) // closed
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.ShutdownSignalException

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.