Announcement Announcement Module
Collapse
No announcement yet.
Why not expose functions createXXX? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why not expose functions createXXX?

    Since spring 1.1 doesn't do async message consumption, one has to write the code. However, it would be nice to have createConnection & createConsumer as public routine from class JmsTemplate. Since I'm using jboss 3.2.x (jms 1.0.2) I had to write it as:

    // Jms 1.0.2
    conn = ((QueueConnectionFactory) jmsTemplate.getConnectionFactory()).createQueueCon nection();
    session = ((QueueConnection) conn).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageConsumer consumer = ((QueueSession) session).createReceiver((Queue) jmsTemplate.getDefaultDestination());
    consumer.setMessageListener(this);
    conn.start();

    It would have been cleaner if the createXXX methods were public. Why aren't they public?

    Dino
Working...
X