Enterprise Javabeans Development Using Visualage for Java

Enterprise Javabeans Development Using Visualage for Java

Enterprise JavaBeans Development Using VisualAge for Java Joaquin Picon, Patrizia Genchi, Maneesh Sahu, Martin Weiss, Alain Dessureault International Technical Support Organization http://www.redbooks.ibm.com SG24-5429-00 SG24-5429-00 International Technical Support Organization Enterprise JavaBeans Development Using VisualAge for Java June 1999 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix E, “Special Notices” on page 391. First Edition (June 1999) This edition applies to VisualAge for Java Enterprise Edition 2.0 with the Enterprise JavaBeans technology update for use with the Windows Operating System and WebSphere Advanced Edition 2.0. Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. QXXE Building 80-E2 650 Harry Road San Jose, California 95120-6099 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1999. All rights reserved Note to U.S Government Users – Documentation related to restricted rights – Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents FIGURES . xi Tables . xvii Preface . xix The Team That Wrote This Redbook. .xix Acknowledgments . xx Comments Welcome . .xxi Part 1. Enterprise JavaBeans Technology: Essentials . .1 Chapter 1. Moving Business Logic To EJB Technology. 3 1.1 Stand-Alone Applications . 3 1.2 High Volume Transactions . 4 1.3 The SanFrancisco Application Frameworks . 4 1.4 Distributed Object-Oriented Technologies . 7 Microsoft DCOM . 7 CORBA . 8 1.5 Summary . 9 Chapter 2. EJB Beans:Quick Start. 11 2.1 Roles . 12 Provider . 12 Deployer . 12 Application Assembler. 12 Container Provider . 12 Server Provider . 13 System Administrator . 13 2.2 Components . 13 Container . 13 Session and Entity Beans . 13 Session Beans . 14 Entity Beans . 14 2.3 An Overall Picture . 15 Chapter 3. Developing a Session Bean . 19 3.1 Session Bean Basics. 19 Basic Components of a Session Bean . 19 Stateless Versus Stateful Session Beans . 20 © Copyright IBM Corp. 1999 iii Session Bean Life Cycle . 21 Creation State . 21 Ready State . 21 Pooled State . 22 Removal State . 22 3.2 Developing Session Beans . 23 Writing the Enterprise Bean Class . 23 Implementing the Business Methods. 26 Implementing the ejbCreate Methods . 28 Implementing the SessionBean Interface . 29 Writing the Home Interface . 31 Writing the Remote Interface . 32 3.3 Developing Session Bean inside VisualAge for Java . 34 Creating EJB Beans . 34 First step: Adding EJB Groups. 35 Second step: Adding EJB Beans to EJB Groups . 39 Generating Deployed Code . 55 The deployment descriptor . 56 The ejb-jar File . 64 Deploying an Enterprise Bean . 64 Generate the Test Client. 66 Testing EJB Beans . 67 Setting Name Service and EJB Server Properties . 68 Starting the Name Service and EJB Servers. 71 Restarting Servers. 73 Running the Generated Test Client . 73 3.4 Writing Your Own Client Application . 79 Importing Required Java Packages . 80 Instantiating an EJB Object . 80 Stopping the Name Service and EJB Servers . 85 3.5 Running the Client outside VisualAge for Java. 85 Exporting EJB Groups and EJB Beans . 85 Exporting EJB Beans to EJS or EJB Jar Files . 85 Exporting EJB Beans to Client Jar Files. 88 Testing the Client outside VisualAge for Java . 90 3.6 Deployment on WebSphere Advanced Edition 2.0. 91 3.7 Deployment for Other Enterprise JavaBeans Servers . 97 3.8 Deployment Using WebSphere Tools . 99 Chapter 4. Developing a Container-Managed Persistence Bean107 4.1 Container-Managed Persistence Basics . 107 4.2 Developing a CMP Bean . 108 Creating a CMP Bean . 109 Projects, Packages and Reserved Package Organization . 118 iv Enterprise JavaBeans Development Using VisualAge for Java Understanding the Generated Types . 120 Adding Fields to the Bean. 122 Removing a Field. 127 Regarding the Other Modifiers (Final, Transient, Static) . 129 Working with the Key Class . 130 4.3 Understanding the Generated Methods . 131 Life Cycles of Enterprise Bean Instances. 132 Creation State . 132 Pooled State . 132 Ready State . 132 Removal State . 133 The CustomerBean’s Generated Methods . 133 The CustomerHome Interface’s Generated Methods . 135 The CustomerKey’s Generated Methods . 136 4.4 Adding Remote Interface Methods . 137 Methods Inherited from javax.ejs.EJBObject . 139 Using Valid Parameters and Return Values for Java RMI. ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    448 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us