Package javax.jms

Examples of javax.jms.ExceptionListener


        AMQInvalidArgumentException expectedException = new AMQInvalidArgumentException("Test", null);
        final AtomicReference<JMSException> receivedException = new AtomicReference<JMSException>();
        try
        {
            MockAMQConnection connection = new MockAMQConnection(url);
            connection.setExceptionListener(new ExceptionListener()
            {

                @Override
                public void onException(JMSException jmsException)
                {
View Full Code Here


        initializeInboundDestinationBridgesOutboundSide(newConnection);
        initializeOutboundDestinationBridgesOutboundSide(newConnection);

        // Register for any async error notifications now so we can reset in the
        // case where there's not a lot of activity and a connection drops.
        newConnection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                handleConnectionFailure(newConnection);
            }
        });
View Full Code Here

        initializeInboundDestinationBridgesLocalSide(newConnection);
        initializeOutboundDestinationBridgesLocalSide(newConnection);

        // Register for any async error notifications now so we can reset in the
        // case where there's not a lot of activity and a connection drops.
        newConnection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                handleConnectionFailure(newConnection);
            }
        });
View Full Code Here

        initializeInboundDestinationBridgesOutboundSide(newConnection);
        initializeOutboundDestinationBridgesOutboundSide(newConnection);

        // Register for any async error notifications now so we can reset in the
        // case where there's not a lot of activity and a connection drops.
        newConnection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                handleConnectionFailure(newConnection);
            }
        });
View Full Code Here

        initializeInboundDestinationBridgesLocalSide(newConnection);
        initializeOutboundDestinationBridgesLocalSide(newConnection);

        // Register for any async error notifications now so we can reset in the
        // case where there's not a lot of activity and a connection drops.
        newConnection.setExceptionListener(new ExceptionListener() {
            @Override
            public void onException(JMSException exception) {
                handleConnectionFailure(newConnection);
            }
        });
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

                   
                    if(clientId != null) {
                      jmsConnection.setClientID(clientId);
                    }
       
                    jmsConnection.setExceptionListener(new ExceptionListener() {
                        public void onException(JMSException arg0)
                        {
                            // This will result in all connections (and their sessions) on this pool
                            // being closed...
                            cleanSessionPool() ;
View Full Code Here

            assertEquals(broker.getTransportConnectorByScheme("tcp").getMaximumConsumersAllowedPerConnection(), MAX_CONSUMERS);

            ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61631");
            javax.jms.Connection connection = activeMQConnectionFactory.createConnection();
            final CountDownLatch latch = new CountDownLatch(1);
            connection.setExceptionListener(new ExceptionListener() {
                public void onException(JMSException e) {
                    if (e.getCause() instanceof IllegalStateException) {
                        latch.countDown();
                    }
                }
View Full Code Here

    }
   
    public void testLotsOfConcurrentConnections() throws Exception {
        ExecutorService executor = Executors.newCachedThreadPool();
        final ConnectionFactory factory = createConnectionFactory();
        final ExceptionListener listener = this;
        int connectionCount = 400;
        for (int i=0;i<connectionCount ;i++) {
            executor.execute(new Runnable() {
                public void run() {
                    try {
View Full Code Here

    public void testSetExceptionListener() throws Exception {
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        connection = (ActiveMQConnection)cf.createConnection();
        assertNull(connection.getExceptionListener());
       
        ExceptionListener exListener = new ExceptionListener() {
      public void onException(JMSException arg0) {
      }
        };
        cf.setExceptionListener(exListener);
       
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.