Package org.apache.qpid.transport

Examples of org.apache.qpid.transport.ConnectionClose


        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));

            _qpidConnection.notifyFailoverRequired();

            synchronized (_conn.getFailoverMutex())
            {
                try
                {
                    if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                    {
                        _conn.failoverPrep();
                        _conn.resubscribeSessions();
                        _conn.fireFailoverComplete();
                        return;
                    }
                }
                catch (Exception e)
                {
                    _logger.error("error during failover", e);
                }
                finally
                {
                    _conn.getProtocolHandler().getFailoverLatch().countDown();
                    _conn.getProtocolHandler().setFailoverLatch(null);
                }
            }
        }

        _conn.setClosed();

        ExceptionListener listener = _conn.getExceptionListenerNoCheck();
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here


        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));

            _qpidConnection.notifyFailoverRequired();

            synchronized (_conn.getFailoverMutex())
            {
                try
                {
                    if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                    {
                        _conn.failoverPrep();
                        _conn.resubscribeSessions();
                        _conn.fireFailoverComplete();
                        return;
                    }
                }
                catch (Exception e)
                {
                    _logger.error("error during failover", e);
                }
                finally
                {
                    _conn.getProtocolHandler().getFailoverLatch().countDown();
                    _conn.getProtocolHandler().setFailoverLatch(null);
                }
            }
        }

        _conn.setClosed();

        ExceptionListener listener = _conn.getExceptionListenerNoCheck();
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));
           
            try
            {
                if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                {
                    _conn.failoverPrep();
                    _conn.resubscribeSessions();
                    _conn.fireFailoverComplete();
                    return;
                }
            }
            catch (Exception e)
            {
                _logger.error("error during failover", e);
            }
            finally
            {
                _conn.getProtocolHandler().getFailoverLatch().countDown();
                _conn.getProtocolHandler().setFailoverLatch(null);
            }
        }

        ExceptionListener listener = _conn._exceptionListener;
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));
           
            try
            {
                if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                {
                    _conn.failoverPrep();
                    _conn.resubscribeSessions();
                    _conn.fireFailoverComplete();
                    return;
                }
            }
            catch (Exception e)
            {
                _logger.error("error during failover", e);
            }
            finally
            {
                _conn.getProtocolHandler().getFailoverLatch().countDown();
                _conn.getProtocolHandler().setFailoverLatch(null);
            }
        }

        ExceptionListener listener = _conn._exceptionListener;
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null)
        {
            try
            {
                if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                {
                    _conn.failoverPrep();
                    _qpidConnection.resume();
                    _conn.fireFailoverComplete();
                    return;
                }
            }
            catch (Exception e)
            {
                _logger.error("error during failover", e);
            }
        }

        ExceptionListener listener = _conn._exceptionListener;
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.initCause(exc);
            listener.onException(ex);
View Full Code Here

        {
            sconn.setVirtualHost(vhost);

            if (!vhost.getSecurityManager().accessVirtualhost(vhostName, ((ProtocolEngine) sconn.getConfig()).getRemoteAddress()))
            {
                sconn.invoke(new ConnectionClose(ConnectionCloseCode.CONNECTION_FORCED, "Permission denied '"+vhostName+"'"));
                sconn.setState(Connection.State.CLOSING);
            }
            else
            {
              sconn.invoke(new ConnectionOpenOk(Collections.emptyList()));
              sconn.setState(Connection.State.OPEN);
            }
        }
        else
        {
            sconn.invoke(new ConnectionClose(ConnectionCloseCode.INVALID_PATH, "Unknown virtualhost '"+vhostName+"'"));
            sconn.setState(Connection.State.CLOSING);
        }
       
    }
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));

            _qpidConnection.notifyFailoverRequired();

            synchronized (_conn.getFailoverMutex())
            {
                try
                {
                    if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                    {
                        _conn.failoverPrep();
                        _conn.resubscribeSessions();
                        _conn.fireFailoverComplete();
                        return;
                    }
                }
                catch (Exception e)
                {
                    _logger.error("error during failover", e);
                }
                finally
                {
                    _conn.getProtocolHandler().getFailoverLatch().countDown();
                    _conn.getProtocolHandler().setFailoverLatch(null);
                }
            }
        }

        ExceptionListener listener = _conn._exceptionListener;
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));

            _qpidConnection.notifyFailoverRequired();

            synchronized (_conn.getFailoverMutex())
            {
                try
                {
                    if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                    {
                        _conn.failoverPrep();
                        _conn.resubscribeSessions();
                        _conn.fireFailoverComplete();
                        return;
                    }
                }
                catch (Exception e)
                {
                    _logger.error("error during failover", e);
                }
                finally
                {
                    _conn.getProtocolHandler().getFailoverLatch().countDown();
                    _conn.getProtocolHandler().setFailoverLatch(null);
                }
            }
        }

        _conn.setClosed();

        ExceptionListener listener = _conn.getExceptionListenerNoCheck();
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null)
        {
            try
            {
                if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                {
                    _qpidConnection.resume();

                    if (_conn.firePreResubscribe())
                    {
                        _conn.resubscribeSessions();
                    }

                    _conn.fireFailoverComplete();
                    return;
                }
            }
            catch (Exception e)
            {
                _logger.error("error during failover", e);
            }
        }

        ExceptionListener listener = _conn._exceptionListener;
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.initCause(exc);
            listener.onException(ex);
View Full Code Here

        if (exc == null)
        {
            return;
        }

        ConnectionClose close = exc.getClose();
        if (close == null || close.getReplyCode() == ConnectionCloseCode.CONNECTION_FORCED)
        {
            _conn.getProtocolHandler().setFailoverLatch(new CountDownLatch(1));

            _qpidConnection.notifyFailoverRequired();

            synchronized (_conn.getFailoverMutex())
            {
                try
                {
                    if (_conn.firePreFailover(false) && _conn.attemptReconnection())
                    {
                        _conn.failoverPrep();
                        _conn.resubscribeSessions();
                        _conn.fireFailoverComplete();
                        return;
                    }
                }
                catch (Exception e)
                {
                    _logger.error("error during failover", e);
                }
                finally
                {
                    _conn.getProtocolHandler().getFailoverLatch().countDown();
                    _conn.getProtocolHandler().setFailoverLatch(null);
                }
            }
        }

        _conn.setClosed();

        ExceptionListener listener = _conn.getExceptionListenerNoCheck();
        if (listener == null)
        {
            _logger.error("connection exception: " + conn, exc);
        }
        else
        {
            String code = null;
            if (close != null)
            {
                code = close.getReplyCode().toString();
            }

            JMSException ex = new JMSException(exc.getMessage(), code);
            ex.setLinkedException(exc);
            ex.initCause(exc);
View Full Code Here

TOP

Related Classes of org.apache.qpid.transport.ConnectionClose

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.