In addition to the ejb-jar.xml file, most containers require one or more vendor-specific descriptors as part of a bean’s deployment information. In this case, all we need to do is associate a JNDI name with our bean. Example 13-6 shows how this is done with JBoss. The fully qualified name of the bean’s remote interface was chosen as the JNDI name. It’s also common to use the home interface name. Example 13-6. The J Boss deployment descriptor for the Storefront session bean Storefront com.oreilly.struts.storefront.service.Storefront Deployment of an EJB requires packaging it into a Java archive (JAR) file. The deployment JAR file for our session bean needs to include the following files: The home and remote interface class files The bean implementation class file The two deployment descriptors (these files must be placed in a META-INF directory) The OJB.properties file and the various repository XML files used by the ORM framework The business object and DTO class files referenced by the Storefront bean Once you’ve created this JAR file, you can deploy the bean by copying the file to the server/default/deploy directory underneath your JBoss installation. You can place the JAR files for your JDBC driver and the OJB classes in the server/default/lib directory. At this point, you can start JBoss and verify that you have everything in place to execute the application tier. 13.2 Interfacing Struts to EJB It’s now time to turn our attention back to the client side of our session fa ade. In this section, we’ll first cover how to satisfy the requirements of our service interface with our session-bean implementation. We’ll then look at how to better manage the JNDI lookups and home and remote interface management inherent in being a remote client to an EJB. 13.2.1 Using a Business Delegate As you saw when we defined the business interface for the Storefront session bean, we still have some work to do to match it up to the Storefront service interface. Our business interface doesn’t include all the methods of IStorefrontService, and the methods that are declared include
You want to have a cheap webhost for your apache application, then check apache web hosting services.
This entry was posted
on Sunday, October 7th, 2007 at 4:55 pm and is filed under Domain.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.