@Test public void testCloseProducer() throws Exception { EmbeddedActiveMq broker = new EmbeddedActiveMq(); try { broker.start(); Session session = broker.createConnection().createSession(false, Session.CLIENT_ACKNOWLEDGE); MessageProducer producer = session.createProducer(session.createTemporaryTopic()); JmsUtils.closeQuietly(producer); JmsUtils.closeQuietly((MessageProducer) null); producer = (MessageProducer) Proxy.newProxyInstance(MessageProducer.class.getClassLoader(), new Class[] { MessageProducer.class }, new FailingDynamicProxy()); JmsUtils.closeQuietly(producer); JmsUtils.closeQuietly(session); } finally { broker.destroy(); } }
public static void closeQuietly(Connection con) { closeQuietly(con, false); }
JmsUtils { public static void closeQuietly(Connection con) { closeQuietly(con, false); } }
JmsUtils { public static void closeQuietly(Connection con) { closeQuietly(con, false); }  }
JmsUtils { public static void closeQuietly(Connection con) { closeQuietly(con, false); }  static JMSException wrapJMSException(Throwable e); static JMSException wrapJMSException(String msg, Throwable e); static void rethrowJMSException(Throwable e); static void rethrowJMSException(String msg, Throwable e); static void deleteQuietly(TemporaryQueue q); static void deleteQuietly(TemporaryTopic t); static void deleteTemporaryDestination(Destination d); static void closeQuietly(Connection con); static void closeQuietly(Connection con, boolean stopFirst); static void stopQuietly(Connection con); static void closeQuietly(Session session); static void closeQuietly(MessageProducer producer); static void closeQuietly(MessageConsumer consumer); }
JmsUtils { public static void closeQuietly(Connection con) { closeQuietly(con, false); }  static JMSException wrapJMSException(Throwable e); static JMSException wrapJMSException(String msg, Throwable e); static void rethrowJMSException(Throwable e); static void rethrowJMSException(String msg, Throwable e); static void deleteQuietly(TemporaryQueue q); static void deleteQuietly(TemporaryTopic t); static void deleteTemporaryDestination(Destination d); static void closeQuietly(Connection con); static void closeQuietly(Connection con, boolean stopFirst); static void stopQuietly(Connection con); static void closeQuietly(Session session); static void closeQuietly(MessageProducer producer); static void closeQuietly(MessageConsumer consumer);  }