Java Reference
In-Depth Information
At this point we are ready to try our application. We can do so by simply right-clicking
on our Enterprise Application Project and selecting Run , at this point the application
will be deployed, and the application client project will be executed, sending a message
to our message queue. Our EJBs will also be deployed, and the application server will
automatically assign one to process the message sent to the queue. We can see the
output of the message driven bean in the application server log.
As we can see, NetBeans automates most of the "grunt work" needed to write
applications taking advantage of the JMS API, leaving us to only write the business
logic part that is specific to our application.
Before moving on, let's discuss the code that NetBeans generates in our
Message Driven Beans. Notice that the generated class is decorated with the
@MessageDriven annotation, this annotation marks our class as a Message
Driven Enterprise JavaBean.
The mappedName attribute of the @MessageDriven annotation should contain the
JNDI name of the JMS destination (queue or topic) that our message driven bean
will be assigned to.
The value of the activationConfig property must be an array of
@ActivationConfigProperty annotations. The @ActivationConfigProperty
annotation is used to specify values for certain properties, it has a propertyName
attribute used to specify the property name, and a propertyValue attribute used
to specify the property value.
Search WWH ::

Custom Search