This section describes the steps to programmatically create the JMS administered objects.
Note that an application that programmatically creates JMS administered objects will have dependencies on the JMS provider, which will make it less portable. For the application to be portable, it is recommended that JMS administered objects are stored in a JNDI repository.
The JMS 1.1 administered objects are javax.jms.ConnectionFactory
, and javax.jms.Topic
The JMS1.0.2b administered objects are javax.jms.TopicConnectionFactory
, and javax.jms.Queue
- The application needs to obtain a reference to a factory from which JMS administered objects may be created.
JmsFactoryFactory jmsFactory =
- The application needs to create a ConnectionFactory, a TopicConnectionFactory, or a QueueConnectionFactory.
ConnectionFactory cf =
TopicConnectionFactory tcf =
QueueConnectionFactory qcf =
- The application can create topic or queue destinations from the JmsFactoryFactory.
Topic t = jmsFactory.createTopic("a/b/c");
Queue q = jmsFactory.createQueue("MyQueue");
Parent topic: Developing a JMS application: XPD621