■
TopicConnectionFactory objects, used for publish-subscribe communication
■
ConnectionFactory objects, which can be used for both point-to-point and
publish-subscribe communications; these are recommended for new applications
There are two kinds of destinations:
■
Queue objects, used for point-to-point communication
■
Topic objects, used for publish-subscribe communication
The chapters on JMS in the Java EE 5 Tutorial provide details on these two types of
communication and other aspects of JMS (see
http://java.sun.com/javaee/5/docs/tutorial/doc/index.html).
The order in which the resources are created does not matter.
For a Java EE application, specify connection factory and destination resources in the
Enterprise Server deployment descriptors as follows:
■
Specify a connection factory JNDI name in a resource-ref or an
mdb-connection-factory element.
■
Specify a destination resource JNDI name in the ejb element for a message-driven bean and
in the message-destination element.
■
Specify a physical destination name in a message-destination-link element, within either
a message-driven element of an enterprise bean deployment descriptor or a
message-destination-ref element. In addition, specify it in the message-destination
element. (The message-destination-ref element replaces the resource-env-ref
element, which is deprecated in new applications.) In the message-destination element of
an Enterprise Server deployment descriptor, link the physical destination name with the
destination resource name.
The Relationship Between JMS Resources and Connector
Resources
The Enterprise Server implements JMS by using a system resource adapter named jmsra. When
a user creates JMS resources, the Enterprise Server automatically creates connector resources
that appear under the Connectors node in the Admin Console’s tree view.
For each JMS connection factory that a user creates, the Enterprise Server creates a connector
connection pool and connector resource. For each JMS destination a user creates, the
Enterprise Server creates an admin object resource. When the user deletes the JMS resources,
the Enterprise Server automatically deletes the connector resources.
It is possible to create connector resources for the JMS system resource adapter by using the
Connectors node of the Admin Console instead of the JMS Resources node. See
Chapter 7,
“Connector Resources,” for details.
TheRelationshipBetween JMSResourcesandConnectorResources
SunGlassFishEnterpriseServer2.1AdministrationGuide • December200864