Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.1
-
None
Description
In JMS the connection close() also closes all sessions, consumers/producers
In JMS the session close() also closes all consumers/producers
See
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Connection.html#close()
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Session.html#close()
SInce this component is closing everything, really a successful connection.close() is all that is needed. So the JmsReceiverComponent destroy() method can be written to make less API calls as follows:
public void destroy() throws Exception {
//PS Fix: START
/*
if (consumer != null)
if (session != null)
{ session.close(); session = null; }if (connection != null)
{ connection.close(); connection = null; } */
try {
if (connection != null)
else if (session != null)
{ session.close(); }else if (consumer != null)
{ consumer.close(); }} finally
{ connection = null; session = null; consumer = null; }//PS Fix: END
}