Developing Java Enterprise Applications
(Publisher: John Wiley & Sons, Inc.)
Author(s): Stephen Asbury ; Scott R. Weiner
ISBN: 0471327565
Publication Date: 02/01/99

Introduction
About the Author

CHAPTER 1—An Introduction to Java Enterprise Development
Supporting Concepts
HTTP
Java
Specialized Servers
Basic Enterprise Design
Security
Enterprise Technologies
Creating an Enterprise Application with Java
Why Use Java for Enterprise Development?
Summary

CHAPTER 2—What Is JDBC?
Goals for JDBC
Support Common Database Standards
Keep It Simple
JDBC Architecture
Typical Scenarios
Summary

CHAPTER 3—Basic JDBC Programming
About the Sample Database
JDBC Basics
A Simple JDBC Example
Connecting to a Data Source
Driver Types
Connection Example
Examining a Data Source
JDBCTest
Accessing the Database
Fetching Data
Working with a Result Set
Working with ResultSetMetaData
Handling Data
Prepared Statements
Managing Transactions
Exception–Handling /SQL Warning
Putting It Together
JDBC 2.0 Features
Database Enhancements
Design Changes
Summary

CHAPTER 4—What Is JNDI?
Terminology
Naming Service
Directory Services
Goals for JNDI
JNDI Architecture
Summary

CHAPTER 5—Using JNDI
Setup Requirements
About the Sample Service Provider
The Naming Package
Access a Context
Object Bindings
Storing Java Objects as References
The Directory Package
Search for Objects
Configure the Search with SearchControls
Modify Attributes
Schema
Exception Handling
Summary

CHAPTER 6—What Are Servlets?
Server-Side Programming Technologies
Processing Forms with CGI
Processing Forms with Servlets
Creating a Servlet
Example Servlet
Running the Servlet
Other Server-Side Features
Server-Side Includes
Servlet Chaining
Summary

CHAPTER 7—Programming Servlets
A Basic Servlet
Handling a Request
SingleThreadModel
ServletRequest
ServletResponse
ServletConfig
ServletContext
GenericServlet
HTTP Servlets
HttpServletRequest
HttpServletResponse
HttpSession
Cookies
Multithreaded Servlets
Servlets and Applets
Designing Servlets
Running and Hosting Servlets
Debugging Servlets
Performance Tuning
Summary

CHAPTER 8—A Servlet-Based Search Engine
HTMLSearchServlet
PathInfo and Query Initialization
Handling Non-Query Requests
Handling Queries
IndexManager
SearchTester.html
Summary

CHAPTER 9—What Is Server-Side Scripting?
Web-Based Application Structure
Server-Side Scripting
JavaServer Pages
Using JHTML
JHTML and JSP
Summary

CHAPTER 10—Creating JavaServer Pages
How JavaServer Pages Work
PageCompileServlet
When to Use JavaServer Pages
Basic Java in a JSP
Scoping
Conditionals and Looping
Accessing Servlet Information
Using Backquotes
Printing Values
Changing a Page’s Servlet Class Definition
Accessing Other Servlets
Handling Interrupts
A Preview of the New JSP Standard
Summary

CHAPTER 11—A JavaServer Page Online Store
How the Store Works
The Main Page
Category Pages
The Shopping Cart
Using the Shopping Cart
Summary

CHAPTER 12—Overview of Distributed Objects
Distributed Computing
Distributed Objects
Creating a Solution
Current Solutions
Summary

CHAPTER 13—Introduction to Java RMI
What Is RMI?
RMI on the Client
RMI on the Server
Connecting the Client and Server
Creating an RMI Application
A Simple Client/Server Application
Creating the Remote Interface
Implementing the Server
Compiling and Installing the Server
Implementing the Client
Compiling and Running the Client
Example with Bidirectional Messaging
Implementing MessageReceiver
Updating MessageServer
Updating the Server
Updating the Client
Class Loading
Garbage Collection
RMI and Firewalls
Remote Object Activation
Modifying Server
Creating ConfigureServer
Summary

CHAPTER 14—A Network File-Locking Server
Local Shared Locks
FileLock Interface
NetworkLockServer Interface
NLS: The Lock Server
SharedFileLock: The FileLock Implementation
A Test Program
Global Locks
The LockServer
GlobalFileLock
A Test Program
Summary

CHAPTER 15—What Are Enterprise JavaBeans?
Roles
Developers
Assemblers
Deployers
Server Providers
Container Providers
Administrators
When to Use EJBs
EJB and CORBA
Future Enhancements
Summary

CHAPTER 16—Programming Enterprise JavaBeans
An Enterprise JavaBean’s Environment
Expected Services
Possible Services
Container
Bean Context
Creating an Enterprise JavaBean
Define the Remote Interface
Define the Home Interface
Define the Enterprise Bean
Create Any Additional Classes You Need
Define Necessary Deployment Information
Compile the Bean
Package the Bean for Deployment
Deploy the Bean
Creating a Session Bean
An Example Stateless Session Bean
An Example Stateful Session Bean
Using a Session Bean
Other Session Bean Examples
Programming Rules for Session Beans
Container Responsibilities
Pros and Cons
Creating an Entity Bean
Example of Container Persistence
Example of Bean-Managed Persistence
Using an Entity Bean
Entity Bean Programming Rules
Container Responsibilities
Pros and Cons
Metadata, Handles, and Exceptions
Security and Enterprise JavaBeans
Summary

CHAPTER 17—Deploying Enterprise JavaBeans
The DeploymentDescriptor
Session– and Entity–Specific Descriptors
Control Descriptors
The Deployment Process
The CD–ROM Examples
Summary

CHAPTER 18—Enterprise JavaBean Business Rules Engine
The Rules Engine
An Example Rule
An Example Action
The Parser
An Example Script
Using the Example Script
Handling a Tag
Check Request Example
CheckRequest: The Interface
CheckRequestHome: The Home Interface
CheckRequest: The Bean
IdentityRule: A Custom Rule
IdentityRuleHandler: A Custom Handler
LogRequestAction: A Custom Action
An Example Rule Script
An Example Action Script
An Example Client
Summary

CHAPTER 19—What Are Messaging and the Java Messaging Service?
Messaging Domains
Request-Reply Messaging
Applications of Messaging
Java Messaging Service
Summary

CHAPTER 20—Programming with the Java Messaging Service
MiniJMS: The Example Provider
Running the Examples
JMS Fundamentals
Destinations
The Connection Factory
JMS and JNDI: Administered Objects
Connections
Sessions
Message Producers
Message Consumers
Messages
Message Selectors
Basic Steps for Programming JMS
Point-to-Point Messaging
Queue Connection Factory
Queue Connections
Queue Sessions
The Queue Sender
The Queue Receiver
The QueueRequester Utility Class
Publish-Subscribe Messaging with Topics
Topic Connection Factory
Topic Connections
Topic Sessions
The Topic Publisher
The Topic Subscriber
The TopicRequester Utility Class
Distributed Transactions and JMS Providers
Summary

CHAPTER 21—A JMS-Based Alarm System
Alarm
Alarm Server
PTimer
AlarmConfig
AlarmDaemon
Summary

CHAPTER 22—Transactions, JTA, and JTS
Transactions in Java
Summary

CHAPTER 23—Using Transactions with Enterprise JavaBeans
Transaction Options
Isolation Levels
Bean–Managed Transactions
An Example for Testing Transactions
TestBeanBean
Reentrant Beans
Summary

CHAPTER 24—Architecture Review
The Technologies
Example Designs
The Online Store
JMS Implementation
Guidelines
Summary

CHAPTER 25—A Four-Tier Online Store
Basic Design
The Shopping Cart EJB
ShoppingCart
ShoppingCartHome
ShoppingCartBean
JavaServer Pages and HTML
Servlets
AdRotator
Searching
ShoppingCart Servlet
Inventory Report
Building and Running the Store
Summary

CHAPTER 26—MiniJMS: A Java Messaging Service Provider
Basic Design
Client/Server Interface
The Client Library
MiniDestination
MiniMessage
MiniConnectionFactory
MiniConnection
MiniSession
MiniConsumer
MiniProducer
JNDI Support
The Server
The Message Store
The Remote Server Objects
The Server: MiniJMS
Building and Running MiniJMS
Summary
Appendix A
Appendix B
Index