List of usage examples for javax.jms TemporaryTopic toString
String toString();
From source file:org.openanzo.combus.bayeux.BridgeConnectionManager.java
/** * Destroy all state including the JMS connection and Bayeux client state. * // w w w . j av a 2 s.co m * @param bundleStopping * bundle stopping * @throws AnzoException */ protected void destroy(boolean bundleStopping) throws AnzoException { closed = true; topicDeletionTimeoutTimer.cancel(); topicDeletionTimeoutTimer = null; if (conn != null) { try { Collection<MessageConsumer> consumersToClose = null; Collection<TemporaryTopic> topicsToDelete = null; mapLock.lock(); try { if (bundleStopping) { Collection<MessageConsumer> graphTopicConsumersToClose = removeAllTopicSubscriptions(); consumersToClose = new ArrayList<MessageConsumer>( graphTopicConsumersToClose.size() + clientIdToClientState.size()); consumersToClose.addAll(graphTopicConsumersToClose); topicsToDelete = new ArrayList<TemporaryTopic>(clientIdToClientState.size()); for (Map.Entry<String, ClientState> entry : clientIdToClientState.entrySet()) { ClientState state = entry.getValue(); if (state != null) { consumersToClose.add(state.consumer); topicsToDelete.add(state.topic); } } } clientIdToClientState.clear(); } finally { mapLock.unlock(); } if (bundleStopping) { if (consumersToClose != null) { for (MessageConsumer consumer : consumersToClose) { if (consumer != null) { closeMessageConsumer(consumer); } } } if (topicsToDelete != null) { for (TemporaryTopic topic : topicsToDelete) { if (topic != null) { try { topic.delete(); } catch (JMSException jmsex) { log.warn(LogUtils.COMBUS_MARKER, "Error deleting bayuex connection manager temporary topic:" + topic.toString(), jmsex); } } } } if (session != null) { try { session.close(); } catch (JMSException jmsex) { log.warn(LogUtils.COMBUS_MARKER, "Error closing bayuex connection manager session", jmsex); } finally { session = null; } } } } finally { try { conn.close(); } catch (JMSException jmsex) { log.warn(LogUtils.COMBUS_MARKER, "Error closing bayuex connection manager connection", jmsex); } finally { conn = null; } } } }