- ホーム
- > 洋書
- > 英文書
- > Computer / Languages
Full Description
The Java EE 7 Tutorialexample-driven guide to developing enterprise applications for the Java Platform, Enterprise Edition 7 (Java EE 7). Written by members of the Java EE documentation team at Oracle, this book provides new and intermediate Java programmers with a deep understanding of the platform. This guide includes descriptions of platform features and provides instructions for using the latest versions of NetBeans IDE and GlassFish Server Open Source Edition. The book introduces Enterprise JavaBeans components, the Java Persistence API, the Java Message Service (JMS) API, Java EE security, transactions, resource adapters, Java EE Interceptors, Batch Applications for the Java Platform, and Concurrency Utilities for Java EE. The book culminates with three case studies that illustrate the use of multiple Java EE 7 APIs.
Contents
Preface xxxiPart I: Introduction 1Chapter 1: Overview 31.1 Java EE 7 Platform Highlights 41.2 Java EE Application Model 51.3 Distributed Multitiered Applications 61.4 Java EE Containers 131.5 Web Services Support 151.6 Java EE Application Assembly and Deployment 171.7 Development Roles 171.8 Java EE 7 APIs 201.9 Java EE 7 APIs in the Java Platform, Standard Edition 7 301.10 GlassFish Server Tools 33Chapter 2: Using the Tutorial Examples 352.1 Required Software 352.2 Starting and Stopping GlassFish Server 392.3 Starting the Administration Console 402.4 Starting and Stopping the Java DB Server 402.5 Building the Examples 412.6 Tutorial Example Directory Structure 412.7 Java EE 7 Maven Archetypes in the Tutorial 422.8 Getting the Latest Updates to the Tutorial 432.9 Debugging Java EE Applications 44Part II: Enterprise Beans 47Chapter 3: Enterprise Beans 493.1 What Is an Enterprise Bean? 493.2 What Is a Session Bean? 513.3 What Is a Message-Driven Bean? 533.4 Accessing Enterprise Beans 553.5 The Contents of an Enterprise Bean 623.6 Naming Conventions for Enterprise Beans 633.7 The Lifecycles of Enterprise Beans 633.8 Further Information about Enterprise Beans 66Chapter 4: Getting Started with Enterprise Beans 674.1 Creating the Enterprise Bean 684.2 Modifying the Java EE Application 71Chapter 5: Running the Enterprise Bean Examples 735.1 The cart Example 735.2 A Singleton Session Bean Example: counter 815.3 A Web Service Example: helloservice 895.4 Using the Timer Service 925.5 Handling Exceptions 104Chapter 6: Using the Embedded Enterprise Bean Container 1056.1 Overview of the Embedded Enterprise Bean Container 1056.2 Developing Embeddable Enterprise Bean Applications 1066.3 The standalone Example Application 109Chapter 7: Using Asynchronous Method Invocation in Session Beans 1137.1 Asynchronous Method Invocation 1137.2 The async Example Application 116Part III: Persistence 121Chapter 8: Introduction to the Java Persistence API 1238.1 Entities 1238.2 Entity Inheritance 1368.3 Managing Entities 1418.4 Querying Entities 1468.5 Database Schema Creation 1478.6 Further Information about Persistence 150Chapter 9: Running the Persistence Examples 1519.1 The order Application 1519.2 The roster Application 1659.3 The address-book Application 174Chapter 10: The Java Persistence Query Language 17910.1 Query Language Terminology 18010.2 Creating Queries Using the Java Persistence Query Language 18010.3 Simplified Query Language Syntax 18210.4 Example Queries 18310.5 Full Query Language Syntax 189Chapter 11: Using the Criteria API to Create Queries 21511.1 Overview of the Criteria and Metamodel APIs 21511.2 Using the Metamodel API to Model Entity Classes 21711.3 Using the Criteria API and Metamodel API to Create Basic Typesafe Queries 219Chapter 12: Creating and Using String-Based Criteria Queries 22712.1 Overview of String-Based Criteria API Queries 22712.2 Creating String-Based Queries 22812.3 Executing String-Based Queries 229Chapter 13: Controlling Concurrent Access to Entity Data with Locking 23113.1 Overview of Entity Locking and Concurrency 23113.2 Lock Modes 233Chapter 14: Creating Fetch Plans with Entity Graphs 23714.1 Entity Graph Basics 23814.2 Using Named Entity Graphs 24014.3 Using Entity Graphs in Query Operations 241Chapter 15: Using a Second-Level Cache with Java Persistence API Applications 24315.1 Overview of the Second-Level Cache 24315.2 Specifying the Cache Mode Settings to Improve Performance 245Part IV: Messaging 251Chapter 16: Java Message Service Concepts 25316.1 Overview of the JMS API 25316.2 Basic JMS API Concepts 25716.3 The JMS API Programming Model 26016.4 Using Advanced JMS Features 27816.5 Using the JMS API in Java EE Applications 28716.6 Further Information about JMS 298Chapter 17: Java Message Service Examples 29917.1 Overview of the JMS Examples 30017.2 Writing Simple JMS Applications 30117.3 Writing More Advanced JMS Applications 31917.4 Writing High Performance and Scalable JMS Applications 32817.5 Sending and Receiving Messages Using a Simple Web Application 33217.6 Receiving Messages Asynchronously Using a Message-Driven Bean 33617.7 Sending Messages from a Session Bean to an MDB 34117.8 Using an Entity to Join Messages from Two MDBs 34617.9 Using NetBeans IDE to Create JMS Resources 354Part V: Security 357Chapter 18: Introduction to Security in the Java EE Platform 35918.1 Overview of Java EE Security 36018.2 Security Mechanisms 36518.3 Securing Containers 36918.4 Securing GlassFish Server 37018.5 Working with Realms, Users, Groups, and Roles 37118.6 Establishing a Secure Connection Using SSL 37918.7 Further Information about Security 381Chapter 19: Getting Started Securing Web Applications 38319.1 Overview of Web Application Security 38419.2 Securing Web Applications 38519.3 Using Programmatic Security with Web Applications 39519.4 Examples: Securing Web Applications 401Chapter 20: Getting Started Securing Enterprise Applications 41120.1 Basic Security Tasks for Enterprise Applications 41120.2 Securing Enterprise Beans 41220.3 Examples: Securing Enterprise Beans 422Chapter 21: Java EE Security: Advanced Topics 43121.1 Working with Digital Certificates 43121.2 Authentication Mechanisms 43621.3 Using the JDBC Realm for User Authentication 44121.4 Securing HTTP Resources 44321.5 Securing Application Clients 44621.6 Securing Enterprise Information Systems Applications 44821.7 Configuring Security Using Deployment Descriptors 45121.8 Further Information about Advanced Security Topics 453Part VI: Java EE Supporting Technologies 455Chapter 22: Transactions 45722.1 Transactions in Java EE Applications 45822.2 What Is a Transaction 45822.3 Container-Managed Transactions 45922.4 Bean-Managed Transactions 46522.5 Transaction Timeouts 46722.6 Updating Multiple Databases 46722.7 Transactions in Web Components 46822.8 Further Information about Transactions 469Chapter 23: Resource Adapters and Contracts 47123.1 What Is a Resource Adapter? 47123.2 Metadata Annotations 47523.3 Common Client Interface 47723.4 Using Resource Adapters with Contexts and Dependency Injection forJava EE (CDI) 47823.5 Further Information about Resource Adapters 479Chapter 24: The Resource Adapter Examples 48124.1 The trading Example 48124.2 The traffic Example 488Chapter 25: Using Java EE Interceptors 49725.1 Overview of Interceptors 49725.2 Using Interceptors 49925.3 The interceptor Example Application 507Chapter 26: Batch Processing 51126.1 Introduction to Batch Processing 51226.2 Batch Processing in Java EE 51626.3 Simple Use Case 51926.4 Using the Job Specification Language 52326.5 Creating Batch Artifacts 53326.6 Submitting Jobs to the Batch Runtime 53926.7 Packaging Batch Applications 54026.8 The webserverlog Example Application 54126.9 The phonebilling Example Application 54826.10 Further Information about Batch Processing 557Chapter 27: Concurrency Utilities for Java EE 55927.1 Concurrency Basics 55927.2 Main Components of the Concurrency Utilities 56027.3 Concurrency and Transactions 56127.4 Concurrency and Security 56227.5 The jobs Concurrency Example 56227.6 The taskcreator Concurrency Example 56727.7 Further Information about the Concurrency Utilities 570Part VII: Case Studies 571Chapter 28: Duke's Bookstore Case Study Example 57328.1 Design and Architecture of Duke's Bookstore 57328.2 The Duke's Bookstore Interface 57528.3 Running the Duke's Bookstore Case Study Application 580Chapter 29: Duke's Tutoring Case Study Example 58329.1 Design and Architecture of Duke's Tutoring 58329.2 Main Interface 58529.3 Administration Interface 59029.4 Running the Duke's Tutoring Case Study Application 592Chapter 30: Duke's Forest Case Study Example 59530.1 Design and Architecture of Duke's Forest 59630.2 Building and Deploying the Duke's Forest Case Study Application 61030.3 Running the Duke's Forest Application 611Index 615