コード例 #1
0
 MQMessageProducer(MQSession session, MQProducer producer, Destination dest) throws JMSException {
   this.session = session;
   targetProducer = producer;
   destination = dest;
   session.addProducer(this);
   if (session.isStarted()) {
     start();
   }
 }
コード例 #2
0
 @Override
 public void close() throws JMSException {
   try {
     if (started.get()) {
       targetProducer.shutdown();
       targetProducer = null;
       session.removeProducer(this);
       started.set(false);
     }
   } catch (Exception ex) {
     throw JMSExceptionSupport.create(ex);
   }
 }