concept connection factory in category ejb

This is an excerpt from Manning's book EJB 3 in Action, Second Edition.
In JMS, message server resources are similar to JDBC javax.sql.DataSource objects. These resources are created and configured outside the code and stored in the server JNDI registry, usually through XML or an administrative console. JMS has two primary types of resources: javax.jms.JMSContext
and javax.jms.Destination
, both of which are used in listing 4.1. You retrieve the JMSContext using dependency injection with the CDI @Inject
annotation and configure the JMSContext to connect to a connection factory with the @JMSConnectionFactory
annotation. The JMSContext wraps a javax.jmx.ConnectionFactory and javax.jmx.Session in one object. The JMSContext was introduced with EE 7 to simplify JMS operations and also to make it easier to stick to the one-session-per-connection restriction in EE environments (this isn’t a restriction in SE applications). You also inject the queue to forward the shipping request to, aptly named ShippingRequestQueue, using the @Resource annotation
.
and javax.jms.Destination
, both of which are used in
annotation and configure the JMSContext to connect to a connection factory with the @JMSConnectionFactory
annotation. The JMSContext wraps a javax.jmx.ConnectionFactory and javax.jmx.Session in one object. The