Documentation Home
> The Java EE 6 Tutorial, Volume I
The Java EE 6 Tutorial, Volume I
Book Information
Index
Numbers and Symbols
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Preface
Part I Introduction
Chapter 1 Overview
Java EE 6 Highlights
Java EE Application Model
Distributed Multitiered Applications
Security
Java EE Components
Java EE Clients
Web Clients
Applets
Application Clients
The JavaBeans Component Architecture
Java EE Server Communications
Web Components
Business Components
Enterprise Information System Tier
Java EE Containers
Container Services
Container Types
Web Services Support
XML
SOAP Transport Protocol
WSDL Standard Format
Java EE Application Assembly and Deployment
Packaging Applications
Development Roles
Java EE Product Provider
Tool Provider
Application Component Provider
Enterprise Bean Developer
Web Component Developer
Application Client Developer
Application Assembler
Application Deployer and Administrator
Java EE 6 APIs
Enterprise JavaBeans Technology
Java Servlet Technology
JavaServer Faces Technology
JavaServer Pages Technology
JavaServer Pages Standard Tag Library
Java Persistence API
Java Transaction API
Java API for RESTful Web Services (JAX-RS)
Java Message Service API
Java EE Connector Architecture
JavaMail API
Java Authorization Service Provider Contract for Containers (Java ACC)
Java Authentication Service Provider Interface for Containers (JASPIC)
Java API for XML Registries
Simplified Systems Integration
Java EE 6 APIs Included in the Java Platform, Standard Edition 6.0 (Java SE 6)
Java Database Connectivity API
Java Naming and Directory Interface
JavaBeans Activation Framework
Java API for XML Processing
Java Architecture for XML Binding (JAXB)
SOAP with Attachments API for Java
Java API for XML Web Services (JAX-WS)
Java Authentication and Authorization Service
Sun GlassFish Enterprise Server v3
Tools
Chapter 2 Using the Tutorial Examples
Required Software
Java Platform, Standard Edition
Java EE 6 Software Development Kit (SDK)
SDK Installation Tips
Apache Ant
To Obtain Apache Ant
Java EE 6 Tutorial Component
To Obtain the Tutorial Component
NetBeans IDE
To Add Enterprise Server as a Server in NetBeans IDE
Starting and Stopping the Enterprise Server
Starting the Administration Console
To Start the Administration Console in NetBeans IDE
Starting and Stopping the Java DB Database Server
Building the Examples
Tutorial Example Directory Structure
Getting the Latest Updates to the Tutorial
To Update the Tutorial through the Update Center
Debugging Java EE Applications
Using the Server Log
Using a Debugger
Part II The Web Tier
Chapter 3 Getting Started with Web Applications
Web Applications
Web Application Life Cycle
Web Modules
Packaging Web Modules
Deploying a WAR File
Setting the Context Root
Deploying a Packaged Web Module
Deploying with the Admin Console
Deploying with asadmin
Deploying with Ant
Deploying with NetBeans IDE
Testing Deployed Web Modules
Listing Deployed Web Modules
Updating Web Modules
Dynamic Reloading
Undeploying Web Modules
Configuring Web Applications
Mapping URLs to Web Components
Setting the Component Alias
Declaring Welcome Files
Setting Initialization Parameters
Mapping Errors to Error Screens
Declaring Resource References
Declaring a Reference to a Resource
Declaring a Reference to a Web Service
Further Information about Web Applications
Chapter 4 JavaServer Faces Technology
What Is a JavaServer Faces Application?
JavaServer Faces Technology Benefits
Creating a Simple JavaServer Faces Application
Developing Backing Beans
Creating the Web Page
Mapping the Faces Servlet Instance
The Lifecycle of the helloWorld Application
Running the Application in NetBeans IDE
Further Information about JavaServer Faces Technology
Chapter 5 Introduction to Facelets
Advantages of Facelets
What's Facelets ?
Web Pages
Tag Library Support
Unified Expression Language Support
Developing a Simple Facelets Application
Creating a Facelets Application
Developing a Backing Bean
Creating Facelets Views
Configuring the Application
Building, Packaging, Deploying and Running the Application
To Create the Example Facelets Application with NetBeans IDE
To Create the Application
Templating
Composite Components
Resources
Chapter 6 Unified Expression Language
Overview of EL
Immediate and Deferred Evaluation Syntax
Immediate Evaluation
Deferred Evaluation
Value and Method Expressions
Value Expressions
Referencing Objects Using Value Expressions
Referring to Object Properties Using Value Expressions
Where Value Expressions Can Be Used
Method Expressions
Parameterized Method Calls
Defining a Tag Attribute Type
Literal Expressions
Operators
Reserved Words
Examples of EL Expressions
Chapter 7 Using JavaServer Faces Technology in Web Pages
Setting Up a Page
Adding Components to a Page Using HTML Tags
Common Component Tag Attributes
The id Attribute
The immediate Attribute
The rendered Attribute
The style and styleClass Attributes
The value and binding Attributes
Adding HTML Head and Body Tags
Adding a Form Component
Using Text Components
Rendering a Text Field With the inputText Tag
Rendering a Password Field With the inputSecret Tag
Rendering a Label With the outputLabel Tag
Rendering a Hyperlink With the h:outputLink Tag
Displaying a Formatted Message With the h:outputFormat Tag
Using Command Components for Performing Actions and Navigation
Rendering a Button With the h:commandButton Tag
Rendering a Hyperlink With the h:commandLink Tag
Adding Graphics and Images With the h:graphicImage Tag
Laying Out Components With the Panel Component
Displaying Components for Selecting One Value
Displaying a Check Box Using the h:selectBooleanCheckbox Tag
Displaying a Menu Using the h:selectOneMenu Tag
Rendering Components for Selecting Multiple Values
Using The SelectItem and SelectItems Components
Using the f:selectItems Tag
Using the f:selectItem Tag
Using Data-Bound Table Components
Displaying Error Messages With the h:message and h:messages Tags
Creating Bookmarkable URLs with h:button and h:link Tags
Using View Parameters
Resource Relocation using h:output Tags
Using Core Tags
Chapter 8 Using Converters, Listeners and Validators
Using the Standard Converters
Converting a Component’s Value
Using DateTimeConverter
Using NumberConverter
Registering Listeners on Components
Registering a Value-Change Listener on a Component
Registering an Action Listener on a Component
Using the Standard Validators
Validating a Component’s Value
Using the LongRangeValidator
Referencing a Backing Bean Method
Referencing a Method That Performs Navigation
Referencing a Method That Handles an Action Event
Referencing a Method That Performs Validation
Referencing a Method That Handles a Value-Change Event
Chapter 9 Developing With JavaServer Faces Technology
Backing Beans
Creating a Backing Bean
Using the EL to Reference Backing Beans
Writing Bean Properties
Writing Properties Bound to Component Values
Input and Output Properties
Data Properties
SelectBoolean Properties
SelectMany Properties
SelectOne Properties
SelectItem Properties
SelectItems Properties
Properties for SelectItems Composed of SelectItem Instances
Writing Properties Bound to Component Instances
Writing Properties Bound to Converters, Listeners, or Validators
Writing Backing Bean Methods
Writing a Method to Handle Navigation
Writing a Method to Handle an Action Event
Writing a Method to Perform Validation
Writing a Method to Handle a Value-Change Event
Bean Validation
Chapter 10 Java Servlet Technology
What Is a Servlet?
Servlet Life Cycle
Handling Servlet Life-Cycle Events
Defining the Listener Class
Specifying Event Listener Classes
Handling Servlet Errors
Sharing Information
Using Scope Objects
Controlling Concurrent Access to Shared Resources
Initializing a Servlet
Writing Service Methods
Getting Information from Requests
Constructing Responses
Filtering Requests and Responses
Programming Filters
Programming Customized Requests and Responses
Specifying Filter Mappings
Invoking Other Web Resources
Including Other Resources in the Response
Transferring Control to Another Web Component
Accessing the Web Context
Maintaining Client State
Accessing a Session
Associating Objects with a Session
Notifying Objects That Are Associated with a Session
Session Management
Session Tracking
Finalizing a Servlet
Tracking Service Requests
Notifying Methods to Shut Down
Creating Polite Long-Running Methods
Further Information about Java Servlet Technology
Part III Web Services
Chapter 11 Introduction to Web Services
What Are Web Services?
Types of Web Services
Deciding Which Type of Web Service to Use
When Should I Use JAX-WS?
When Should I Use JAX-RS?
Chapter 12 Building Web Services with JAX-WS
Setting the Port
Creating a Simple Web Service and Client with JAX-WS
Requirements of a JAX-WS Endpoint
Coding the Service Endpoint Implementation Class
Building, Packaging, and Deploying the Service
Building, Packaging, and Deploying the Service Using NetBeans IDE
Building, Packaging, and Deploying the Service Using Ant
Undeploying the Service
The all Task
Testing the Service without a Client
A Simple JAX-WS Client
Coding the Client
Building and Running the Client
Building and Running the Client in NetBeans IDE
Building and Running the Client Using Ant
Types Supported by JAX-WS
Web Services Interoperability and JAX-WS
Further Information about JAX-WS
Chapter 13 Building RESTful Web Services with JAX-RS and Jersey
What are RESTful Web Services?
Where Does Jersey Fit In?
Creating a RESTful Root Resource Class
Developing RESTful Web Services with JAX-RS and Jersey
Overview of a Jersey-Annotated Application
The @Path Annotation and URI Path Templates
More on URI Path Template Variables
Responding to HTTP Resources
The Request Method Designator Annotations
Using Entity Providers to Map HTTP Response and Request Entity Bodies
Using @Consumes and @Produces to Customize Requests and Responses
The @Produces Annotation
The @Consumes Annotation
Extracting Request Parameters
Overview of JAX-RS and Jersey: Further Information
Example Applications for JAX-RS and Jersey
Creating a RESTful Web Service
Creating a RESTful Web Service Using NetBeans IDE
Creating a RESTful Web Service From Examples
Creating a RESTful Web Service From Maven Archetype
Example: Creating a Simple Hello World Application Using JAX-RS and Jersey
JAXRSHelloWorld Example: Discussion
Testing the JAXRSHelloWorld Example
Deploying and Running the JAXRSHelloWorld Example
Example: Adding on to the Simple Hello World RESTful Web Service
HelloWorld3 Example: Discussion
Testing the HelloWorld3 Example
Deploying and Running the HelloWorld3 Example
JAX-RS in the First Cup Example
Real World Examples
Further Information
Part IV Enterprise Beans
Chapter 14 Enterprise Beans
What Is an Enterprise Bean?
Benefits of Enterprise Beans
When to Use Enterprise Beans
Types of Enterprise Beans
What Is a Session Bean?
Types of Session Beans
Stateful Session Beans
Stateless Session Beans
Singleton Session Beans
When to Use Session Beans
What Is a Message-Driven Bean?
What Makes Message-Driven Beans Different from Session Beans?
When to Use Message-Driven Beans
Accessing Enterprise Beans
Using Enterprise Beans in Clients
Portable JNDI Syntax
Deciding on Remote or Local Access
Local Clients
Accessing Local Enterprise Beans Using the No-Interface View
Accessing Local Enterprise Beans That Implement Business Interfaces
Remote Clients
Accessing Remote Enterprise Beans
Web Service Clients
Method Parameters and Access
Isolation
Granularity of Accessed Data
The Contents of an Enterprise Bean
Packaging Enterprise Beans In EJB JAR Modules
Packaging Enterprise Beans in WAR Modules
Naming Conventions for Enterprise Beans
The Life Cycles of Enterprise Beans
The Life Cycle of a Stateful Session Bean
The Lifecycle of a Stateless Session Bean
The Lifecycle of a Singleton Session Bean
The Lifecycle of a Message-Driven Bean
Further Information about Enterprise Beans
Chapter 15 Getting Started with Enterprise Beans
Creating the Enterprise Bean
Coding the Enterprise Bean
Coding the Enterprise Bean Class
Creating the converter Web Client
Coding the converter Web Client
Compiling, Packaging, and Running the converter Example
Compiling, Packaging, and Running the converter Example in NetBeans IDE
Compiling, Packaging, and Running the converter Example Using Ant
Modifying the Java EE Application
Modifying a Class File
Chapter 16 Running the Enterprise Bean Examples
The cart Example
The Business Interface
Session Bean Class
Lifecycle Callback Methods
Business Methods
The Remove Method
Helper Classes
Building, Packaging, Deploying, and Running the cart Example
Building, Packaging, and Deploying the cart Example Using NetBeans IDE
Running the cart Application Client Using NetBeans IDE
Building, Packaging, and Deploying the cart Example Using Ant
Running the cart Application Client Using Ant
The all Task
Undeploying the cart Example
A Singleton Session Bean Example: counter
Creating a Singleton Session Bean
Initializing Singleton Session Beans
Managing Concurrent Access in a Singleton Session Bean
Container-Managed Concurrency
Bean-Managed Concurrency
Handling Errors in a Singleton Session Bean
The Architecture of the counter Example
Building, Deploying, and Running the counter Example
Building, Deploying, and Running the counter Example in NetBeans IDE
Building, Deploying, and Running the counter Example Using Ant
A Web Service Example: helloservice
The Web Service Endpoint Implementation Class
Stateless Session Bean Implementation Class
Building, Packaging, Deploying, and Testing the helloservice Example
Building, Packaging, and Deploying the helloservice Example Using NetBeans IDE
Building, Packaging, and Deploying the helloservice Example Using Ant
Testing the Service without a Client
Using the Timer Service
Creating Calendar-Based Timer Expressions
Specifying Multiple Values in Calendar Expressions
Using Wildcards in Calendar Expressions
Specifying a List of Values
Specifying a Range of Values
Specifying Intervals
Programmatic Timers
The Timeout Method
Creating Programmatic Timers
Automatic Timers
The @Schedule and @Schedules Annotations
Canceling and Saving Timers
Getting Timer Information
Transactions and Timers
The timersession Example
Building, Packaging, Deploying, and Running the timersession Example
Building, Packaging, Deploying, and Running the timersession Example Using NetBeans IDE
Building, Packaging, and Deploying the timersession Example Using Ant
Running the Web Client
Handling Exceptions
Part V Contexts and Dependency Injection for the Java EE Platform
Chapter 17 Introduction to Contexts and Dependency Injection for the Java EE Platform
Overview of Contexts and Dependency Injection for the Java EE Platform
About Beans
About Managed Beans
Beans as Injectable Objects
Using Qualifiers
Injecting Beans
Using Scopes
Giving Beans EL Names
Adding Setter and Getter Methods
Using a Managed Bean in a Facelets Page
Injecting Objects by Using Producer Methods
Configuring a CDI Application
Further Information
Chapter 18 Running the Basic Contexts and Dependency Injection Examples
The simplegreeting Example
The simplegreeting Source Files
The Facelets Template and Page
Configuration Files
Building, Packaging, Deploying, and Running the simplegreeting Example
Building and Deploying the simplegreeting Example Using NetBeans IDE
Building, Packaging, and Deploying the simplegreetingExample Using Ant
Running the simplegreeting Example
The guessnumber Example
The guessnumber Source Files
The @MaxNumber and @Random Qualifier Interfaces
The Generator Managed Bean
The UserNumberBean Managed Bean
The Facelets Page
Building, Packaging, Deploying, and Running the guessnumber Example
Building and Deploying the guessnumber Example Using NetBeans IDE
Building, Packaging, and Deploying the guessnumber Example Using Ant
Running the guessnumber Example
Part VI Persistence
Chapter 19 Introduction to the Java Persistence API
Entities
Requirements for Entity Classes
Persistent Fields and Properties in Entity Classes
Persistent Fields
Persistent Properties
Using Collections in Entity Fields and Properties
Using Map Collections in Entities
Primary Keys in Entities
Primary Key Classes
Multiplicity in Entity Relationships
Direction in Entity Relationships
Bidirectional Relationships
Unidirectional Relationships
Queries and Relationship Direction
Cascade Operations and Relationships
Orphan Removal in Relationships
Embeddable Classes in Entities
Entity Inheritance
Abstract Entities
Mapped Superclasses
Non-Entity Superclasses
Entity Inheritance Mapping Strategies
The Single Table per Class Hierarchy Strategy
The Table per Concrete Class Strategy
The Joined Subclass Strategy
Managing Entities
The Persistence Context
The EntityManager Interface
Container-Managed Entity Managers
Application-Managed Entity Managers
Finding Entities Using the EntityManager
Managing an Entity Instance’s Life Cycle
Persisting Entity Instances
Removing Entity Instances
Synchronizing Entity Data to the Database
Persistence Units
The persistence.xml File
Querying Entities
Chapter 20 Running the Persistence Examples
The order Application
Entity Relationships in the order Application
Self-Referential Relationships
One-to-One Relationships
One-to-Many Relationship Mapped to Overlapping Primary and Foreign Keys
Unidirectional Relationships
Primary Keys in the order Application
Generated Primary Keys
Compound Primary Keys
Entity Mapped to More Than One Database Table
Cascade Operations in the order Application
BLOB and CLOB Database Types in the order Application
Temporal Types in the order Application
Managing the order Application’s Entities
Creating Entities
Finding Entities
Setting Entity Relationships
Using Queries
Removing Entities
Building and Running the order Application
Building, Packaging, Deploying, and Running order In NetBeans IDE
Building, Packaging, Deploying, and Running order Using Ant
The all Task
Undeploying order
The roster Application
Relationships in the roster Application
The Many-To-Many Relationship in roster
Entity Inheritance in the roster Application
Criteria Queries in the roster Application
Metamodel Classes in the roster Application
Obtaining a CriteriaBuilder Instance in RequestBean
Creating Criteria Queries in RequestBean's Business Methods
Automatic Table Generation in the roster Application
Building and Running the roster Application
Building, Packaging, Deploying, and Running roster in NetBeans IDE
Building, Packaging, Deploying, and Running roster Using Ant
The all Task
Undeploying order
Chapter 21 The Java Persistence Query Language
Query Language Terminology
Creating Queries Using the Java Persistence Query Language
Named Parameters in Queries
Positional Parameters in Queries
Simplified Query Language Syntax
Select Statements
Update and Delete Statements
Example Queries
Simple Queries
A Basic Select Query
Eliminating Duplicate Values
Using Named Parameters
Queries That Navigate to Related Entities
A Simple Query with Relationships
Navigating to Single-Valued Relationship Fields
Traversing Relationships with an Input Parameter
Traversing Multiple Relationships
Navigating According to Related Fields
Queries with Other Conditional Expressions
The LIKE Expression
The IS NULL Expression
The IS EMPTY Expression
The BETWEEN Expression
Comparison Operators
Bulk Updates and Deletes
Update Queries
Delete Queries
Full Query Language Syntax
BNF Symbols
BNF Grammar of the Java Persistence Query Language
FROM Clause
Identifiers
Identification Variables
Range Variable Declarations
Collection Member Declarations
Joins
Path Expressions
Examples of Path Expressions
Expression Types
Navigation
WHERE Clause
Literals
String Literals
Numeric Literals
Boolean Literals
Enum Literals
Input Parameters
Conditional Expressions
Operators and Their Precedence
BETWEEN Expressions
IN Expressions
LIKE Expressions
NULL Comparison Expressions
Empty Collection Comparison Expressions
Collection Member Expressions
Subqueries
EXISTS Expressions
ALL and ANY Expressions
Functional Expressions
Case Expressions
NULL Values
Equality Semantics
SELECT Clause
Return Types
Aggregate Functions in the SELECT Clause
The DISTINCT Keyword
Constructor Expressions
ORDER BY Clause
The GROUP BY Clause
The HAVING Clause
Chapter 22 Creating Queries Using the Criteria API
Overview of the Criteria and Metamodel APIs
Modeling Entity Classes with the Metamodel API
Using Metamodel Classes
Basic Type-Safe Queries Using the Criteria API and Metamodel API
Creating a Criteria Query
Query Roots
Querying Relationships Using Joins
Path Navigation in Criteria Queries
Restricting Criteria Query Results
The Expression Interface Methods
Expression Methods in the CriteriaBuilder Interface
Managing Criteria Query Results
Ordering Results
Grouping Results
Executing Queries
Single-Valued Query Results
Collection-Valued Query Results
Part VII Security
Chapter 23 Introduction to Security in the Java EE Platform
Overview of Java EE Security
A Simple Security Example
Step 1: Initial Request
Step 2: Initial Authentication
Step 3: URL Authorization
Step 4: Fulfilling the Original Request
Step 5: Invoking Enterprise Bean Business Methods
Security Functions
Characteristics of Application Security
Security Implementation Mechanisms
Java SE Security Implementation Mechanisms
Java EE Security Implementation Mechanisms
Application-Layer Security
Transport-Layer Security
Message-Layer Security
Securing Containers
Using Deployment Descriptors for Declarative Security
Using Annotations
Using Programmatic Security
Securing the Enterprise Server
Working with Realms, Users, Groups, and Roles
What Are Realms, Users, Groups, and Roles?
What Is a Realm?
What Is a User?
What Is a Group?
What Is a Role?
Some Other Terminology
Managing Users and Groups on the Enterprise Server
Adding Users to the Enterprise Server
Adding Users to the Certificate Realm
Setting Up Security Roles
Mapping Roles to Users and Groups
Establishing a Secure Connection Using SSL
Installing and Configuring SSL Support
Specifying a Secure Connection in Your Application Deployment Descriptor
Verifying SSL Support
Tips on Running SSL
Working with Digital Certificates
Creating a Server Certificate
Miscellaneous Commands for Certificates
Further Information about Security
Chapter 24 Getting Started Securing Enterprise Applications
Responsibility for Administering Security
Securing Enterprise Beans
Securing an Enterprise Bean Using Declarative Security and Annotations
Specifying Authorized Users by Declaring Security Roles
Mapping Security Roles to Enterprise Server Groups
Specifying an Authentication Mechanism and Secure Connection
Example: Securing an Enterprise Bean
Annotating the Bean
Building, Deploying, and Running the Secure Cart Example Using NetBeans IDE
Building, Deploying, and Running the Secure Cart Example Using Ant
Securing an Enterprise Bean Programmatically
Accessing an Enterprise Bean Caller’s Security Context
Example: Using the isCallerInRole and getCallerPrincipal Methods
Modifying ConverterBean
Building, Deploying, and Running the Secure Converter Example Using NetBeans IDE
Building, Deploying, and Running the Secure Converter Example Using Ant
Troubleshooting the Secure Converter Application
Propagating a Security Identity (Run-As)
Configuring a Component’s Propagated Security Identity
Trust between Containers
Deploying Secure Enterprise Beans
Accepting Unauthenticated Users
Securing Application Clients
Using Login Modules
Using Programmatic Login
Securing Enterprise Information Systems (EIS) Applications
Container-Managed Sign-On
Component-Managed Sign-On
Configuring Resource Adapter Security
Mapping an Application Principal to EIS Principals
Chapter 25 Getting Started Securing Web Applications
Overview of Web Application Security
Using Deployment Descriptors to Secure Web Applications
Introduction to Web Application Deployment Descriptors
Specifying Security Constraints
Specifying a Web Resource Collection
Specifying an Authorization Constraint
Specifying a Secure Connection
Specifying Separate Security Constraints for Different Resources
Specifying an Authentication Mechanism
HTTP Basic Authentication
Form-Based Authentication
Using Login Forms
HTTPS Client Authentication
Mutual Authentication
Digest Authentication
Working with Security Roles
Reviewing Security Concepts
Declaring Security Roles
Mapping Security Roles to Enterprise Server Groups
Using Programmatic Security with Web Applications
Authenticating Users Programmatically
Checking Caller Identity Programmatically
Example Code for Programmatic Security
Declaring and Linking Role References
Using Message Security with Web Applications
Examples: Securing Web Applications
Setting Up Your System for Running the Security Examples
Example: Basic Authentication with a Servlet
Specifying Security in the Deployment Descriptor
Building, Packaging, and Deploying the Servlet Basic Authentication Example Using NetBeans IDE
Building, Packaging, and Deploying the Servlet Basic Authentication Example Using Ant
Running the Basic Authentication Servlet
Troubleshooting the Basic Authentication Example
Example: Basic Authentication with JAX-WS
Adding Security Elements to the Deployment Descriptor
Building and Deploying helloservice with Basic Authentication Using NetBeans IDE
Building and Deploying helloservice with Basic Authentication Using Ant
Building and Running the helloservice Client Application with Basic Authentication Using NetBeans IDE
Building and Running the helloservice Client Application with Basic Authentication Using Ant
Example: Form-Based Authentication with a Servlet
Creating the Login Form and the Error Page
Specifying Security in the Deployment Descriptor
Building, Packaging, and Deploying the Form-Based Authentication Example Using NetBeans IDE
Building, Packaging, and Deploying the Form-Based Authentication Example Using Ant
Testing the Form-Based Authentication Web Client
Part VIII Java EE Supporting Technologies
Chapter 26 Introduction to Java EE Supporting Technologies
Transactions
Resources
The Java EE Connector Architecture and Resource Adapters
Java Message Service
Java DataBase Connectivity (JDBC) Software
Chapter 27 Transactions
What Is a Transaction?
Container-Managed Transactions
Transaction Attributes
Required Attribute
RequiresNew Attribute
Mandatory Attribute
NotSupported Attribute
Supports Attribute
Never Attribute
Summary of Transaction Attributes
Setting Transaction Attributes
Rolling Back a Container-Managed Transaction
Synchronizing a Session Bean’s Instance Variables
Methods Not Allowed in Container-Managed Transactions
Bean-Managed Transactions
JTA Transactions
Returning without Committing
Methods Not Allowed in Bean-Managed Transactions
Transaction Timeouts
Updating Multiple Databases
Transactions in Web Components
Chapter 28 Resource Connections
Resources and JNDI Naming
DataSource Objects and Connection Pools
Resource Injection
Field-Based Injection
Method-Based Injection
Class-Based Injection
Declaring Multiple Resources
Resource Adapters
Resource Adapter Contracts
Management Contracts
Life cycle Management
Work Management Contract
Generic Work Context Contract
Transaction Context
Security Context
Work Security Map
Hints Context
Outbound Contracts
Connection Management Contract
Transaction Management Contract
Security Management Contract
Inbound Contracts
Messaging Contracts
Transaction Inflow
Metadata Annotations
Replacing Deployment Descriptors With Metadata Annotations
Example 1: @Connector Annotation
Example 2: @ConnectionDefinition Annotation
Example 3: @Activation Annotation
Common Client Interface
Further Information about Resources
© 2010, Oracle Corporation and/or its affiliates