@Override public void close() throws JMSException { next.close(); }
/** Closes the {@code QueueRequestor} and its session. * * <P>Since a provider may allocate some resources on behalf of a * {@code QueueRequestor} outside the Java virtual machine, clients * should close them when they * are not needed. Relying on garbage collection to eventually reclaim * these resources may not be timely enough. * * <P>Note that this method closes the {@code QueueSession} object * passed to the {@code QueueRequestor} constructor. * * @exception JMSException if the JMS provider fails to close the * {@code QueueRequestor} due to some internal * error. */ public void close() throws JMSException { // publisher and consumer created by constructor are implicitly closed. session.close(); tempQueue.delete(); } }
protected void initializeInboundDestinationBridgesOutboundSide(QueueConnection connection) throws JMSException { if (inboundQueueBridges != null) { QueueSession outboundSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); for (InboundQueueBridge bridge : inboundQueueBridges) { String queueName = bridge.getInboundQueueName(); Queue foreignQueue = createForeignQueue(outboundSession, queueName); bridge.setConsumer(null); bridge.setConsumerQueue(foreignQueue); bridge.setConsumerConnection(connection); bridge.setJmsConnector(this); addInboundBridge(bridge); } outboundSession.close(); } }
protected void initializeOutboundDestinationBridgesLocalSide(QueueConnection connection) throws JMSException { if (outboundQueueBridges != null) { QueueSession localSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); for (OutboundQueueBridge bridge : outboundQueueBridges) { String localQueueName = bridge.getLocalQueueName(); Queue activemqQueue = createActiveMQQueue(localSession, localQueueName); bridge.setConsumer(null); bridge.setConsumerQueue(activemqQueue); bridge.setConsumerConnection(connection); bridge.setJmsConnector(this); addOutboundBridge(bridge); } localSession.close(); } }
protected void initializeOutboundDestinationBridgesOutboundSide(QueueConnection connection) throws JMSException { if (outboundQueueBridges != null) { QueueSession outboundSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); for (OutboundQueueBridge bridge : outboundQueueBridges) { String queueName = bridge.getOutboundQueueName(); Queue foreignQueue = createForeignQueue(outboundSession, queueName); bridge.setProducerQueue(foreignQueue); bridge.setProducerConnection(connection); if (bridge.getJmsMessageConvertor() == null) { bridge.setJmsMessageConvertor(getOutboundMessageConvertor()); } bridge.setJmsConnector(this); addOutboundBridge(bridge); } outboundSession.close(); } }
protected void initializeInboundDestinationBridgesLocalSide(QueueConnection connection) throws JMSException { if (inboundQueueBridges != null) { QueueSession localSession = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE); for (InboundQueueBridge bridge : inboundQueueBridges) { String localQueueName = bridge.getLocalQueueName(); Queue activemqQueue = createActiveMQQueue(localSession, localQueueName); bridge.setProducerQueue(activemqQueue); bridge.setProducerConnection(connection); if (bridge.getJmsMessageConvertor() == null) { bridge.setJmsMessageConvertor(getInboundMessageConvertor()); } bridge.setJmsConnector(this); addInboundBridge(bridge); } localSession.close(); } }
.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue replyToConsumerQueue = replyToConsumerSession.createTemporaryQueue(); replyToConsumerSession.close(); bridge.setConsumerQueue(replyToConsumerQueue); bridge.setProducerQueue(replyToProducerQueue); .createQueueSession(false, Session.AUTO_ACKNOWLEDGE); Queue replyToConsumerQueue = replyToConsumerSession.createTemporaryQueue(); replyToConsumerSession.close(); bridge.setConsumerQueue(replyToConsumerQueue); bridge.setProducerQueue(replyToProducerQueue);
/** * Close this JMSAppender. Closing releases all resources used by the * appender. A closed appender cannot be re-opened. */ public synchronized void stop() { // The synchronized modifier avoids concurrent append and close operations if (!this.started) { return; } this.started = false; try { if (queueSession != null) { queueSession.close(); } if (queueConnection != null) { queueConnection.close(); } } catch (Exception e) { addError("Error while closing JMSAppender [" + name + "].", e); } // Help garbage collection queueSender = null; queueSession = null; queueConnection = null; }
public void close() throws JMSException { getSession().close(); getTemporaryQueue().delete(); }
/** * Cleanup on shutdown */ public void dispose() throws JMSException { producerSession.close(); cacheManager = null; messageProducer.close(); getQueueSession.close(); shutdown = true; }
/** * Cleanup on shutdown */ public void dispose() throws JMSException { producerSession.close(); cacheManager = null; messageProducer.close(); getQueueSession.close(); shutdown = true; }
@Destroy public void destroy() throws JMSException { queueSession.close(); }
public void stop() throws JMSException { conn.stop(); session.close(); conn.close(); }
public void destroy() throws JMSException { sender.close(); conn.stop(); session.close(); conn.close(); } }