52 Resource Adapters and Contracts
This chapter examines resource adapters and explains how communications between Java EE servers and EIS systems are mediated by them.
The following topics are addressed here:
Table of Contents
Java Platform, Enterprise Edition: The Java EE Tutorial
Expand | Collapse- Title and Copyright Information
- Preface
- Part I Introduction
- 1 Overview
- 1.1 Java EE 7 Platform Highlights
- 1.2 Java EE Application Model
- 1.3 Distributed Multitiered Applications
- 1.4 Java EE Containers
- 1.5 Web Services Support
- 1.6 Java EE Application Assembly and Deployment
- 1.7 Java EE 7 APIs
- 1.7.1 Enterprise JavaBeans Technology
- 1.7.2 Java Servlet Technology
- 1.7.3 JavaServer Faces Technology
- 1.7.4 JavaServer Pages Technology
- 1.7.5 JavaServer Pages Standard Tag Library
- 1.7.6 Java Persistence API
- 1.7.7 Java Transaction API
- 1.7.8 Java API for RESTful Web Services
- 1.7.9 Managed Beans
- 1.7.10 Contexts and Dependency Injection for Java EE
- 1.7.11 Dependency Injection for Java
- 1.7.12 Bean Validation
- 1.7.13 Java Message Service API
- 1.7.14 Java EE Connector Architecture
- 1.7.15 JavaMail API
- 1.7.16 Java Authorization Contract for Containers
- 1.7.17 Java Authentication Service Provider Interface for Containers
- 1.7.18 Java API for WebSocket
- 1.7.19 Java API for JSON Processing
- 1.7.20 Concurrency Utilities for Java EE
- 1.7.21 Batch Applications for the Java Platform
- 1.8 Java EE 7 APIs in the Java Platform, Standard Edition 7
- 1.8.1 Java Database Connectivity API
- 1.8.2 Java Naming and Directory Interface API
- 1.8.3 JavaBeans Activation Framework
- 1.8.4 Java API for XML Processing
- 1.8.5 Java Architecture for XML Binding
- 1.8.6 Java API for XML Web Services
- 1.8.7 SOAP with Attachments API for Java
- 1.8.8 Java Authentication and Authorization Service
- 1.8.9 Common Annotations for the Java Platform
- 1.9 GlassFish Server Tools
- 2 Using the Tutorial Examples
- 2.1 Required Software
- 2.2 Starting and Stopping GlassFish Server
- 2.3 Starting the Administration Console
- 2.4 Starting and Stopping the Java DB Server
- 2.5 Building the Examples
- 2.6 Tutorial Example Directory Structure
- 2.7 Java EE 7 Maven Archetypes in the Tutorial
- 2.8 Getting the Latest Updates to the Tutorial
- 2.9 Debugging Java EE Applications
- 1 Overview
- Part II Platform Basics
- Part III The Web Tier
- 6 Getting Started with Web Applications
- 6.1 Web Applications
- 6.2 Web Application Lifecycle
- 6.3 A Web Module That Uses JavaServer Faces Technology: The hello1 Example
- 6.4 A Web Module That Uses Java Servlet Technology: The hello2 Example
- 6.5 Configuring Web Applications
- 6.6 Further Information about Web Applications
- 7 JavaServer Faces Technology
- 7.1 What Is a JavaServer Faces Application?
- 7.2 JavaServer Faces Technology Benefits
- 7.3 A Simple JavaServer Faces Application
- 7.4 User Interface Component Model
- 7.5 Navigation Model
- 7.6 The Lifecycle of a JavaServer Faces Application
- 7.7 Partial Processing and Partial Rendering
- 7.8 Further Information about JavaServer Faces Technology
- 8 Introduction to Facelets
- 8.1 What Is Facelets?
- 8.2 The Lifecycle of a Facelets Application
- 8.3 Developing a Simple Facelets Application: The guessnumber-jsf Example Application
- 8.4 Using Facelets Templates
- 8.5 Composite Components
- 8.6 Web Resources
- 8.7 Relocatable Resources
- 8.8 Resource Library Contracts
- 8.9 HTML5-Friendly Markup
- 8.9.1 Using Pass-Through Elements
- 8.9.2 Using Pass-Through Attributes
- 8.9.3 The reservation Example Application
- 8.9.3.1 The Facelets Pages for the reservation Application
- 8.9.3.2 The Managed Bean for the reservation Application
- 8.9.3.3 To Build, Package, and Deploy the reservation Example Using NetBeans IDE
- 8.9.3.4 To Build, Package, and Deploy the reservation Example Using Maven
- 8.9.3.5 To Run the reservation Example
- 9 Expression Language
- 10 Using JavaServer Faces Technology in Web Pages
- 10.1 Setting Up a Page
- 10.2 Adding Components to a Page Using HTML Tag Library Tags
- 10.2.1 Common Component Tag Attributes
- 10.2.2 Adding HTML Head and Body Tags
- 10.2.3 Adding a Form Component
- 10.2.4 Using Text Components
- 10.2.5 Using Command Component Tags for Performing Actions and Navigation
- 10.2.6 Adding Graphics and Images with the h:graphicImage Tag
- 10.2.7 Laying Out Components with the h:panelGrid and h:panelGroup Tags
- 10.2.8 Displaying Components for Selecting One Value
- 10.2.9 Displaying Components for Selecting Multiple Values
- 10.2.10 Using the f:selectItem and f:selectItems Tags
- 10.2.11 Displaying the Results from Selection Components
- 10.2.12 Using Data-Bound Table Components
- 10.2.13 Displaying Error Messages with the h:message and h:messages Tags
- 10.2.14 Creating Bookmarkable URLs with the h:button and h:link Tags
- 10.2.15 Using View Parameters to Configure Bookmarkable URLs
- 10.2.16 The bookmarks Example Application
- 10.2.17 Resource Relocation Using h:outputScript and h:outputStylesheet Tags
- 10.3 Using Core Tags
- 11 Using Converters, Listeners, and Validators
- 12 Developing with JavaServer Faces Technology
- 13 Using Ajax with JavaServer Faces Technology
- 13.1 Overview of Ajax
- 13.2 Using Ajax Functionality with JavaServer Faces Technology
- 13.3 Using Ajax with Facelets
- 13.4 Sending an Ajax Request
- 13.5 Monitoring Events on the Client
- 13.6 Handling Errors
- 13.7 Receiving an Ajax Response
- 13.8 Ajax Request Lifecycle
- 13.9 Grouping of Components
- 13.10 Loading JavaScript as a Resource
- 13.11 The ajaxguessnumber Example Application
- 13.12 Further Information about Ajax in JavaServer Faces Technology
- 14 Composite Components: Advanced Topics and an Example
- 14.1 Attributes of a Composite Component
- 14.2 Invoking a Managed Bean
- 14.3 Validating Composite Component Values
- 14.4 The compositecomponentexample Example Application
- 15 Creating Custom UI Components and Other Custom Objects
- 15.1 Determining Whether You Need a Custom Component or Renderer
- 15.2 Understanding the Image Map Example
- 15.3 Steps for Creating a Custom Component
- 15.4 Creating Custom Component Classes
- 15.5 Delegating Rendering to a Renderer
- 15.6 Implementing an Event Listener
- 15.7 Handling Events for Custom Components
- 15.8 Defining the Custom Component Tag in a Tag Library Descriptor
- 15.9 Using a Custom Component
- 15.10 Creating and Using a Custom Converter
- 15.11 Creating and Using a Custom Validator
- 15.12 Binding Component Values and Instances to Managed Bean Properties
- 15.13 Binding Converters, Listeners, and Validators to Managed Bean Properties
- 16 Configuring JavaServer Faces Applications
- 16.1 Using Annotations to Configure Managed Beans
- 16.2 Application Configuration Resource File
- 16.3 Using Faces Flows
- 16.3.1 Packaging Flows in an Application
- 16.3.2 The Simplest Possible Flow: The simple-flow Example Application
- 16.3.3 The checkout-module Example Application
- 16.3.3.1 The Facelets Pages for the checkout-module Example
- 16.3.3.2 Using a Configuration File to Configure a Flow
- 16.3.3.3 Using a Java Class to Configure a Flow
- 16.3.3.4 The Flow-Scoped Managed Beans
- 16.3.3.5 To Build, Package, and Deploy the checkout-module Example Using NetBeans IDE
- 16.3.3.6 To Build, Package, and Deploy the checkout-module Example Using Maven
- 16.3.3.7 To Run the checkout-module Example
- 16.4 Configuring Managed Beans
- 16.5 Registering Application Messages
- 16.6 Using Default Validators
- 16.7 Registering a Custom Validator
- 16.8 Registering a Custom Converter
- 16.9 Configuring Navigation Rules
- 16.10 Registering a Custom Renderer with a Render Kit
- 16.11 Registering a Custom Component
- 16.12 Basic Requirements of a JavaServer Faces Application
- 17 Java Servlet Technology
- 17.1 What Is a Servlet?
- 17.2 Servlet Lifecycle
- 17.3 Sharing Information
- 17.4 Creating and Initializing a Servlet
- 17.5 Writing Service Methods
- 17.6 Filtering Requests and Responses
- 17.7 Invoking Other Web Resources
- 17.8 Accessing the Web Context
- 17.9 Maintaining Client State
- 17.10 Finalizing a Servlet
- 17.11 Uploading Files with Java Servlet Technology
- 17.12 Asynchronous Processing
- 17.13 Nonblocking I/O
- 17.14 Protocol Upgrade Processing
- 17.15 The mood Example Application
- 17.16 The fileupload Example Application
- 17.17 The dukeetf Example Application
- 17.18 Further Information about Java Servlet Technology
- 18 Java API for WebSocket
- 18.1 Introduction to WebSocket
- 18.2 Creating WebSocket Applications in the Java EE Platform
- 18.3 Programmatic Endpoints
- 18.4 Annotated Endpoints
- 18.5 Sending and Receiving Messages
- 18.6 Maintaining Client State
- 18.7 Using Encoders and Decoders
- 18.8 Path Parameters
- 18.9 Handling Errors
- 18.10 Specifying an Endpoint Configurator Class
- 18.11 The dukeetf2 Example Application
- 18.12 The websocketbot Example Application
- 18.13 Further Information about WebSocket
- 19 JSON Processing
- 19.1 Introduction to JSON
- 19.2 JSON Processing in the Java EE Platform
- 19.3 Using the Object Model API
- 19.4 Using the Streaming API
- 19.5 JSON in Java EE RESTful Web Services
- 19.6 The jsonpmodel Example Application
- 19.7 The jsonpstreaming Example Application
- 19.8 Further Information about the Java API for JSON Processing
- 20 Internationalizing and Localizing Web Applications
- 6 Getting Started with Web Applications
- Part IV Bean Validation
- 21 Introduction to Bean Validation
- 22 Bean Validation: Advanced Topics
- Part V Contexts and Dependency Injection for Java EE
- 23 Introduction to Contexts and Dependency Injection for Java EE
- 23.1 Getting Started
- 23.2 Overview of CDI
- 23.3 About Beans
- 23.4 About CDI Managed Beans
- 23.5 Beans as Injectable Objects
- 23.6 Using Qualifiers
- 23.7 Injecting Beans
- 23.8 Using Scopes
- 23.9 Giving Beans EL Names
- 23.10 Adding Setter and Getter Methods
- 23.11 Using a Managed Bean in a Facelets Page
- 23.12 Injecting Objects by Using Producer Methods
- 23.13 Configuring a CDI Application
- 23.14 Using the @PostConstruct and @PreDestroy Annotations with CDI Managed Bean Classes
- 23.15 Further Information about CDI
- 24 Running the Basic Contexts and Dependency Injection Examples
- 25 Contexts and Dependency Injection for Java EE: Advanced Topics
- 25.1 Packaging CDI Applications
- 25.2 Using Alternatives in CDI Applications
- 25.3 Using Producer Methods, Producer Fields, and Disposer Methods in CDI Applications
- 25.4 Using Predefined Beans in CDI Applications
- 25.5 Using Events in CDI Applications
- 25.6 Using Interceptors in CDI Applications
- 25.7 Using Decorators in CDI Applications
- 25.8 Using Stereotypes in CDI Applications
- 26 Running the Advanced Contexts and Dependency Injection Examples
- 26.1 The encoder Example: Using Alternatives
- 26.2 The producermethods Example: Using a Producer Method to Choose a Bean Implementation
- 26.3 The producerfields Example: Using Producer Fields to Generate Resources
- 26.4 The billpayment Example: Using Events and Interceptors
- 23 Introduction to Contexts and Dependency Injection for Java EE
