@Test public void testPublishToTopicFailsIfNotAnonymousPublisher() throws JMSException { JmsPoolConnection connection = (JmsPoolConnection) cf.createTopicConnection(); TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); Topic topic = session.createTemporaryTopic(); TopicPublisher publisher = session.createPublisher(topic); try { publisher.publish(session.createTemporaryTopic(), session.createTextMessage()); fail("Should not be able to send to alternate destination"); } catch (UnsupportedOperationException ex) {} }
@Override public void publish(Message message) throws JMSException { super.send(message); }
JmsPoolTopicPublisher extends JmsPoolMessageProducer implements TopicPublisher, AutoCloseable { @Override public void publish(Message message) throws JMSException { super.send(message); } }
JmsPoolTopicPublisher extends JmsPoolMessageProducer implements TopicPublisher, AutoCloseable { @Override public void publish(Message message) throws JMSException { super.send(message); } JmsPoolTopicPublisher(JmsPoolSession session, TopicPublisher messageProducer, Destination destination, AtomicInteger refCount); }
JmsPoolTopicPublisher extends JmsPoolMessageProducer implements TopicPublisher, AutoCloseable { @Override public void publish(Message message) throws JMSException { super.send(message); } JmsPoolTopicPublisher(JmsPoolSession session, TopicPublisher messageProducer, Destination destination, AtomicInteger refCount); @Override Topic getTopic(); @Override void publish(Message message); @Override void publish(Message message, int deliveryMode, int priority, long timeToLive); @Override void publish(Topic topic, Message message); @Override void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive); @Override String toString(); TopicPublisher getTopicPublisher(); }
JmsPoolTopicPublisher extends JmsPoolMessageProducer implements TopicPublisher, AutoCloseable { @Override public void publish(Message message) throws JMSException { super.send(message); } JmsPoolTopicPublisher(JmsPoolSession session, TopicPublisher messageProducer, Destination destination, AtomicInteger refCount); @Override Topic getTopic(); @Override void publish(Message message); @Override void publish(Message message, int deliveryMode, int priority, long timeToLive); @Override void publish(Topic topic, Message message); @Override void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive); @Override String toString(); TopicPublisher getTopicPublisher();  }