Code snippet of onMessage is shown below.

Now our bean is complete, and all that remains are the deployment descriptors for the bean.
Deploy RequestItems Bean :
In order to deploy this bean we have to add a few deployment descriptors. As shown below, five tags have been added.

First add the tag shown below at class level in the RequestItems Bean, to obtain a reference to StoreAccessBean, so that methods can be invoked on that bean.
@ejb.ejb-refejb-name="StoreAccess"view-type="remote"ref-name="StoreAccess"
This tag will generate deployment descriptors in ejb-jar.xml when you generate your ejb classes, as this message bean has to authenticate, before transferring information to the relevant bean. This will generate these descriptors as shown below.

Add another tag as shown below, to obtain a reference to the Supplier Bean from this bean.
@ejb.ejb-refejb-name="Supplier"view-type="local"ref-name="SupplierLocal"
This tag will generate also generate descriptors in ejb-jar.xml when you generate your ejb classes, as this message bean transfers information to the Supplier bean. The following descriptors are generated as shown below.

Note : Another descriptor which has been generated is <ejb-name>, which is generated by the tag @ejb.bean that was added by the EJB creation wizard.

This tag generates the following descriptors in ejb-jar.xml:

Add another tag as shown below. This tag is JBOSS-specific, and is used to register a message-driven bean with a jndi-name, using the format "queue/name".
@jboss.destination-jndi-name name="queue/MdbQueue"
This will generate the following deployment descriptors in jboss.xml:

Note : For further documentation on MDB development with JBOSS, please refer to the JBOSS documentation.
Add another tag as shown below, required by JBOSS, for finding the Supplier bean using its JNDI NAME.
@jboss.ejb-ref-jndi ref-name="SupplierLocal" jndi-name="SupplierLocal"
Note : As discussed in chapter5, this tag generates incorrect descriptors within jboss.xml. For view-type="local" it generates an <ejb-ref> tag rather than an <ejb-local-ref> tag.
Correct the following tags:

Find these tags in jboss.xml and change them to <ejb-local-ref> as shown below.

Now add this last tag as shown below for our StoreAccess Bean, to reference the StoreAccess bean using its JNDI NAME .
@jboss.ejb-ref-jndi ref-name="StoreAccess"jndi-name="StoreAccessBean"
This tag will generate the following descriptors in jboss.xml:

Now our RequestItems Bean is complete, so now add your bean and generate your EJB classes.
Go to the RequestItemsBean node under au.com.tusc.mdb > right click > select Lomboz J2EE... > Add EJB to Module > Ok.
Go to the MyStoreMgr node in Package Explorer > right click > select Lomboz J2EE... > Generate EJB classes.






