Java Reference
In-Depth Information
@Resource
private MessageDrivenContext mdc;
...
NetBeans IDE typically creates a message-driven bean with a default set of @Activa-
tionConfigProperty settings. You can delete those you do not need, or add others.
Table 11-1 lists commonly used properties.
TABLE 11-1. @ActivationConfigProperty Settings for Message-Driven
Beans
The onMessage Method
When the queue receives a message, the EJB container invokes the message listener meth-
od or methods. For a bean that uses JMS, this is the onMessage method of the Mes-
sageListener interface.
A message listener method must follow these rules:
• The method must be declared as public .
• The method must not be declared as final or static .
The onMessage method is called by the bean's container when a message has arrived for
the bean to service. This method contains the business logic that handles the processing of
Search WWH ::




Custom Search