Download
FAQ History |
API
Search Feedback |
deploytool Tips for Message-Driven Beans
Chapter 24 covers the basic steps for building and packaging enterprise beans. This section describes the tasks in
deploytool
that are necessary for message-driven beans. To view this example indeploytool
, expand theSimpleMessageApp
node in the tree view, and then expand theMDBJAR
node and selectSimpleMessageBean
.Specifying the Bean's Type
You specify the type when you create the bean using the New Enterprise Bean wizard.
Setting the Message-Driven Bean's Characteristics
You can specify these settings in two places:
These settings are as follows:
- For the Messaging Service, accept the default, JMS.
- For the Destination Type, choose either
javax.jms.Queue
orjavax.jms.Topic
. A queue uses the point-to-point messaging domain and can have at most one consumer. A topic uses the publish/subscribe messaging domain; it can have zero, one, or many consumers. For this example, you would selectjavax.jms.Queue
.- For the Target Destination Name, type the name of the physical destination that you created administratively. For an example, see the section Creating the Administered Objects. The destination is either a
queue
or atopic
object; it represents the source of incoming messages and the target of outgoing messages. For this example, you would typePhysicalQueue
.- If your bean will be a durable subscriber to a topic, select the Durable Subscription checkbox and enter a subscription name. If the bean uses a message selector, enter the value in the Message Selector text area. For an example that uses these features, see A J2EE Application That Uses the JMS API with a Session Bean. You normally leave the Acknowledgement Mode set to Auto-Acknowledge.
For information on durable subscriptions, see Creating Durable Subscriptions. For information on message selectors, see Message Selectors. For information on message acknowledgment, see Controlling Message Acknowledgment.
- In the Connection Factory JNDI Name (Sun-specific) field, type the JNDI name of the connection factory the bean will use. For this example, you would type
jms/QueueConnectionFactory
.Use the tabbed panes as follows:
Download
FAQ History |
API
Search Feedback |
All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.