Adding a New Entitlements Bean


In the previous chapter, we spent quite a bit of time discussing how to use EJBs with Resin. After we created the first bean using the local home interface, local interface, and implementation, building the Groups bean was fairly routine. When I wrote the code for the Groups files, I just copied the login files and changed what was needed. Wouldn't it be nice if there were an easier way to write the EJB files?

XDoclet is a technology that allows you to do attribute-oriented programming. Using JavaDoc-like tags, you can add meaningful metadata to Java source code and allow XDoclet to generate code or other output based on the specific meaning of the various tags. Caucho has produced its own set of metadata attribute tags for the generation of EJB code. In this chapter, we discuss how to install XDoclet and Resin extensions, and how to use the defined tags to generate bean code for us.

Installing XDoclet

A good deal of the work done by XDoclet is accomplished using Another Neat Tool (Ant), a build tool written in Java. So let's begin by installing Ant as well as XDoclet. Here are simple steps for installing all of the required tools:

  1. Install Resin-EE.

  2. Download Ant from http://jakarta.apache.org/ant and install it. The download is available as a .zip or .tgz file depending on your target system.

    The download installs the application in a directory such as /jakarta-ant-1.5.1, but we will assume a default of /ant instead. (You can either rename your Ant installation directory or change the examples in the chapter.) For ease of use, the ANT_HOME environment variable is set to the installation directory, and an entry to the /bin directory is added to PATH.

  3. Download and install XDoclet from http://xdoclet.sourceforge.net/install.html. Copy the XDoclet JAR files and dependencies (xdoclet.jar, log4j.jar) to the Ant lib directory (/ant/lib).

  4. Download and install Resin XDoclet support from www.caucho.com/projects/xdoclet/resin-xdoclet.jar.




Mastering Resin
Mastering Resin
ISBN: 0471431036
EAN: 2147483647
Year: 2002
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net