allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

EJB Development Quickstart with MyEclipse---5

天下维客,你可以修改的网络知识库

Jump to: navigation, search

Using XDoclet EJB Facilities

Before continuing to Part-2 of the Trader EJB development process, we need to introduce the steps for the configuration and use of XDoclet EJB features. The benefit of XDoclet technology is that a tag processor is able to analyze source files annotated with XDoclet information and generate dependent source code and configuration resources specific to the annotations. XDoclet relies on an ANT script to specify its execution environment and code generation tasks. An XDoclet tag consists of an annotation model that maps 1 or more annotations to corresponding ANT subtasks. MyEclipse allows you to configure and customize the subtasks to execute and their default operating values.



By default, MyEclipse EJB projects are not automatically configured to use XDoclet features. This section presents the steps for enabling and configuring the firstejb EJB project with XDoclet support and executing XDoclet code generation to derive the Trader EJB's dependent source code and deployment components.


XDoclet EJB Configuration

We begin by adding the Standard EJB XDoclet configuration to the firstejb project. The end goal of this section is to produce the XDoclet configuration that will be used to create the ANT script that MyEclipse will execute to generate the additional EJB artifacts required to deploy the Trader EJB.


Basic EJBDoclet Configuration

  • Open the MyEclipse project properties page. Right-click the firstejb project in the Package Explorer View and select Properties > MyEclipse-XDoclet (see Figure 8)


Image:Firstejb-xdocletconfiguration-annot.gif



Figure 8. MyEclipse-XDoclet configuration page


  • Select the Add Standard button.
  • Select Standard EJB configuration followed by OK as shown in Figure 9.


In addition to the preconfigured XDoclet modules provided by MyEclipse you may create your own custom XDoclet configurations. The process for integrating a custom XDoclet module is beyond the scope of this document.



Image:firstejb-addconfig-annot.gif



Figure 9. Adding Standard EJB configuration



Once the Standard EJB module has been added to the list, use the mouse to select it to reveal the doclets it contains. Notice that the ejbdoclet appears in lower left-hand list. The subdoclets under the ejbdoclet's contain both required and optional subtasks. Many of the subtasks are not applicable to a simple stateless session bean such as Trader EJB.



Image:firstejb-ejbconfig-annot.gif



Figure 10. Default subtasks for Standard ejbdoclet


  • Remove unneeded subtasks by right-clicking each subtask in the lower left panel and selecting Remove.
  • Continue this process until only the subtasks shown in Figure 11 remain. Each of the items in this configuration represent EJB XDoclet subtasks.
  • (Optional) If a non-default source folder was specified when the project was created you must update the project relative path attributes of the following elements ejbdoclet > destDir, deploymentdescriptor > destDir and fileset > src tasks. Select each of these elements in the bottom left panel and then review and revise their respective properties in the lower right panel.


Image:firstejb-ejbconfig-trimmed.gif



Figure 11. XDoclet EJB subtasks required by Trader EJB


  • Configure this project's XDoclet build file policy by selecting the corresponding Build page.


Note: If this is a new project, the Build policy is set to the default policy, so you may skip to step 9.


  • Select Use dynamic build specification policy as shown in Figure 12.


If you are using an existing project that already contains XDoclet configurations, you can choose to delete unnecessary xdoclet-build.xml file. It is no longer needed. For a more detailed explanation of these new policies see Table 2. By default new projects are set to use the dynamic build policy. You can modify this default by going to Window > Preferences > MyEclipse > XDoclet > Build preference page.



Image:firstejb-xdoclet-build-file-policy-annot.gif



Figure 12. XDoclet Build File Policy Configuration



Table 2 - Description of XDoclet build policies



Image:EJB-tab-2.gif


  • Select OK .


During completion of XDoclet configuration process are saved to the local file named .xdoclet. Additionally if the "Use xdoclet-build.xml file" build policy is enabled then MyEclipse will generate a file named xdoclet-build.xml from your new XDoclet settings and store this file in the root directory of your project.



This completes the basic XDoclet EJB configuration process. The next section demonstrates how to configure XDoclet EJB subtasks for your specific application server.

Personal tools
工具
金银币拍卖 金币拍卖预展  金银币网店 熊猫金银币 生肖金银币