Package org.activemq.util

Examples of org.activemq.util.ExceptionTemplate


     *
     * @throws JMSException
     */

    public void stop() throws JMSException {
        ExceptionTemplate template = new ExceptionTemplate();

        if (containerManagers != null) {
            for (int i = 0; i < containerManagers.length; i++) {
                final MessageContainerManager containerManager = containerManagers[i];
                template.run(new Callback() {
                    public void execute() throws Throwable {
                        containerManager.stop();
                    }
                });
            }
        }
        if (transactionManager != null) {
            template.run(new Callback() {
                public void execute() throws Throwable {
                    transactionManager.stop();
                }
            });
        }

        template.run(new Callback() {
            public void execute() throws Throwable {
                persistenceAdapter.stop();
            }
        });

        template.throwJMSException();
    }
View Full Code Here


     *
     * @throws JMSException
     */

    public void stop() throws JMSException {
        ExceptionTemplate template = new ExceptionTemplate();

        if (containerManagers != null) {
            for (int i = 0; i < containerManagers.length; i++) {
                final MessageContainerManager containerManager = containerManagers[i];
                template.run(new Callback() {
                    public void execute() throws Throwable {
                        containerManager.stop();
                    }
                });
            }
        }
        if (transactionManager != null) {
            template.run(new Callback() {
                public void execute() throws Throwable {
                    transactionManager.stop();
                }
            });
        }

        template.run(new Callback() {
            public void execute() throws Throwable {
                persistenceAdapter.stop();
            }
        });

        template.throwJMSException();
    }
View Full Code Here

            throw JMSExceptionHelper.newJMSException("Could not post packet: " + packet + " due to: " + e, e);
        }
    }

    public void stop() {
        ExceptionTemplate template = new ExceptionTemplate();
        if (sendConnection != null) {
            template.run(new Callback() {
                public void execute() throws Throwable {
                    sendConnection.disconnect();
                }
            });
        }
        if (receiveConnection != null) {
            template.run(new Callback() {
                public void execute() throws Throwable {
                    receiveConnection.disconnect();
                }
            });
        }
        super.stop();
        Throwable firstException = template.getFirstException();
        if (firstException != null) {
            log.warn("Failed to shut down cleanly: " + firstException, firstException);
        }
    }
View Full Code Here

     *
     * @throws JMSException
     */

    public void stop() throws JMSException {
        ExceptionTemplate template = new ExceptionTemplate();

        if (containerManagers != null) {
            for (int i = 0; i < containerManagers.length; i++) {
                final MessageContainerManager containerManager = containerManagers[i];
                template.run(new Callback() {
                    public void execute() throws Throwable {
                        containerManager.stop();
                    }
                });
            }
        }
        if (transactionManager != null) {
            template.run(new Callback() {
                public void execute() throws Throwable {
                    transactionManager.stop();
                }
            });
        }

        template.run(new Callback() {
            public void execute() throws Throwable {
                persistenceAdapter.stop();
            }
        });

        template.throwJMSException();
    }
View Full Code Here

        super.start();
    }

    public void stop() {
        ExceptionTemplate template = new ExceptionTemplate();
        template.run(new Callback() {
            public void execute() throws Throwable {
                discoveryAgent.stop();
            }
        });
        template.run(new Callback() {
            public void execute() throws Throwable {
                DiscoveryTransportChannel.super.stop();
            }
        });
        Throwable e = template.getFirstException();
        log.warn("Failed to stop the transport channel cleanly due to: " + e, e);
    }
View Full Code Here

TOP

Related Classes of org.activemq.util.ExceptionTemplate

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.