Package javax.jms

Examples of javax.jms.ExceptionListener


                _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);
            listener.onException(ex);
        }
    }
View Full Code Here


        doTest();
    }

    public void testWithExceptionListener() throws Exception
    {
        _connection.setExceptionListener(new ExceptionListener()
            {
                public void onException(JMSException jmsException)
                {
                    _log.warn("onException - " + jmsException.getMessage());
                }
View Full Code Here

       
        //QPID-2081: use a latch to sync on exception causing connection close, to work
        //around the connection close race during tearDown() causing sporadic failures
        _exceptionReceived = new CountDownLatch(1);

        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                _exceptionReceived.countDown();
            }
View Full Code Here

               }
               throw new Exception( "Unable to get the brokers pid " + pid);
           }
           _logger.debug("pid : " + pid);
          
           con.setExceptionListener(new ExceptionListener(){
              
               public void onException(JMSException e)
               {
                   synchronized(lock) {
                       lock.set(true);
View Full Code Here

                }

                while ( connecting.get() && running ) {
                try {
                    connection = adapter.makeConnection(activationSpec);
                    connection.setExceptionListener(new ExceptionListener() {
                        public void onException(JMSException error) {
                            if (!serverSessionPool.isClosing()) {
                                    // initiate reconnection only once, i.e. on initial exception
                                    // and only if not already trying to connect
                                    LOG.error("Connection to broker failed: " + error.getMessage(), error);
View Full Code Here

        Connection conn = getConnection("guest", "guest");

        conn.start();

        final CountDownLatch fired = new CountDownLatch(1);
        conn.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                fired.countDown();
            }
View Full Code Here

    try {
      jndiCntxt = new InitialContext();
      ConnectionFactory connFac = (ConnectionFactory)jndiCntxt.lookup("ConnectionFactory");
      Connection conn = connFac.createConnection();
      conn.start();
      conn.setExceptionListener(new ExceptionListener() {
        @Override
        public void onException(JMSException jmse) {
            LOG.error(jmse);
        }
      });
View Full Code Here

    private void prepareQueues() throws Exception
    {
        // Create a connection
        Connection connection = _connFac.createConnection();
        connection.start();
        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                e.printStackTrace();
            }
View Full Code Here

    {

        // Create a connection
        TopicConnection connection = _connFac.createTopicConnection();
        connection.start();
        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                e.printStackTrace();
            }
View Full Code Here

    private void prepareDurableSubscriptionWithoutSelector() throws Exception
    {
        // Create a connection
        TopicConnection connection = _connFac.createTopicConnection();
        connection.start();
        connection.setExceptionListener(new ExceptionListener()
        {
            public void onException(JMSException e)
            {
                e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of javax.jms.ExceptionListener

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.