Oracle Fusion Middleware Programming Enterprise Javabeans, Version 3.0, for Oracle Weblogic Server, 11G Release 1 (10.3.4) E13720-04

Oracle Fusion Middleware Programming Enterprise Javabeans, Version 3.0, for Oracle Weblogic Server, 11G Release 1 (10.3.4) E13720-04

Oracle® Fusion Middleware Programming Enterprise JavaBeans, Version 3.0, for Oracle WebLogic Server 11g Release 1 (10.3.4) E13720-04 January 2011 This document is a resource for software developers who develop applications that include WebLogic Server Enterprise JavaBeans (EJBs), Version 3.0. Oracle Fusion Middleware Programming Enterprise JavaBeans, Version 3.0, for Oracle WebLogic Server, 11g Release 1 (10.3.4) E13720-04 Copyright © 2007, 2011, Oracle and/or its affiliates. All rights reserved. Primary Author: Ben Gelernter This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services. Contents Preface ............................................................................................................................................................. xxix Documentation Accessibility................................................................................................................. xxix Conventions ............................................................................................................................................. xxix 1 Introduction and Roadmap 1.1 Document Scope and Audience................................................................................................ 1-1 1.2 Guide to this Document............................................................................................................. 1-1 1.3 Related Documentation.............................................................................................................. 1-2 1.4 Comprehensive Example for the EJB 3.0 Developer.............................................................. 1-2 1.5 New and Changed Features in this Release............................................................................ 1-3 2 Understanding Enterprise JavaBeans 3.0 2.1 Understanding EJB 3.0: New Features and Changes From EJB 2.X .................................... 2-1 2.1.1 Changes Between Versions 2.X and 3.0............................................................................ 2-1 2.1.2 New EJB 3.0 Features .......................................................................................................... 2-2 2.2 WebLogic Server Value-Added EJB 3.0 Features................................................................... 2-3 2.3 EJB 3.0 Examples ......................................................................................................................... 2-3 2.4 Programming 3.0 Entities .......................................................................................................... 2-4 3 Simple Enterprise JavaBeans 3.0 Examples 3.1 Example of a Simple Stateless EJB............................................................................................ 3-1 3.2 Example of a Simple Stateful EJB ............................................................................................. 3-2 3.3 Example of an Interceptor Class ............................................................................................... 3-5 3.4 Example of Invoking a 3.0 Entity From A Session Bean ....................................................... 3-6 4 Iterative Development of Enterprise JavaBeans 3.0 4.1 Overview of the EJB 3.0 Development Process ...................................................................... 4-1 4.2 Create a Source Directory .......................................................................................................... 4-2 4.3 Program the EJB 3.0 Business Interface ................................................................................... 4-3 4.3.1 Business Interface Application Exceptions ...................................................................... 4-3 4.3.2 Using Generics in EJBs........................................................................................................ 4-4 4.3.3 Serializing and Deserializing Business Objects............................................................... 4-5 4.4 Program the Annotated EJB Class............................................................................................ 4-5 4.5 Optionally Program Interceptors.............................................................................................. 4-5 iii 4.6 Compile Java Source .................................................................................................................. 4-5 4.7 Optionally Create and Edit Deployment Descriptors ........................................................... 4-6 4.8 Packaging EJBs ............................................................................................................................ 4-7 4.9 Deploying EJBs............................................................................................................................ 4-7 5 Programming the Annotated EJB 3.0 Class 5.1 Overview of Metadata Annotations and EJB 3.0 Bean Files................................................. 5-1 5.2 Programming the Bean File: Requirements and Changes From 2.X ................................... 5-2 5.2.1 Bean Class Requirements and Changes From 2.X .......................................................... 5-2 5.2.2 Bean Class Method Requirements..................................................................................... 5-2 5.3 Programming the Bean File: Typical Steps ............................................................................. 5-3 5.3.1 Specifying the Business and Other Interfaces ................................................................. 5-4 5.3.2 Specifying the Bean Type (Stateless, Stateful, Message-Driven) .................................. 5-5 5.3.3 Injecting Resource Dependency into a Variable or Setter Method............................... 5-5 5.3.4 Invoking a 3.0 Entity ........................................................................................................... 5-6 5.3.4.1 Injecting Persistence Context Using Metadata Annotations.................................. 5-7 5.3.4.2 Finding an Entity Using the EntityManager API..................................................... 5-8 5.3.4.3 Creating and Updating an Entity Using EntityManager........................................ 5-8 5.3.5 Specifying Interceptors for Business Methods or Life Cycle Callback Events ........ 5-10 5.3.5.1 Specifying Business or Life Cycle Interceptors: Typical Steps............................ 5-10 5.3.5.2 Programming the Interceptor Class........................................................................ 5-11 5.3.5.3 Programming Business Method Interceptor Methods......................................... 5-11 5.3.5.4 Programming Life Cycle Callback Interceptor Methods..................................... 5-12 5.3.5.5 Specifying Default Interceptor Methods................................................................ 5-13 5.3.5.6 Saving

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    270 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