A message destination reference points to a message destination that is defined in an EJB module, application client module, or web module.
At deployment, the message destination references are bound to the administered message destinations in the target operational environment.
For each message destination reference that you define, a message-destination-ref element is added to the deployment descriptor for that application component. Message destination references are scoped to the application component where they are defined, so they are not accessible to other application components during run time. Other components can define message destination references with the same name without causing a name conflict.
The following code shows an example message destination defined in a deployment descriptor:
<message-destination-ref>
<description></description>
<message-destination-ref-name>MyDest_Ref</message-destination-ref-name>
<message-destination-type>java.net.URL</message-destination-type>
<message-destination-usage>Produces</message-destination-usage>
<message-destination-link>MyDest</message-destination-link>
</message-destination-ref>
Message destination links (the message-destination-link element) can be defined on message-driven beans and message destination references. The message-destination-link element of the message-destination-ref element of an enterprise bean produces messages to link to a target destination. The value for the message-destination-link element is the name of a message destination.