Bug 27158: Added the JVM shutdown hook listener(thread) to the long-running process(loop - poll a database table for new rows) inside the DatabasePoller class to complete JBoss shutdown. Updated the JmsClientHelper class to make sure we are properly closing JNDI context and JMS connection.