Home Page Icon
Home Page
Table of Contents for
IX. Appendixes
Close
IX. Appendixes
by Bernard Ciconte, Scott Dunbar, Peter Go, Manish Devgan, Jatinder Prem
BEA® WebLogic Platform 7
Copyright
Dedication
About the Author
About the Co-Authors
Acknowledgments
We Want to Hear from You!
Introduction
About This Book
Who Should Read This Book?
How This Book Is Organized
Part I: J2EE Application Development Essentials
Part II: Introducing the BEA WebLogic Platform 7
Part III: WebLogic and J2EE Services Support
Part IV: Developing Presentation Logic—JSPs and Servlets
Part V: Developing Business Logic—Enterprise JavaBeans
Part VI: BEA WebLogic Server Administration
Part VII: Web Services
Part VIII: Integration Services Provided by WebLogic Server 7
Case Study: A Sample End-to-End Example Using The WebLogic Platform
Source Code for This Book
I. J2EE Application Development Essentials
1. Understanding the Java 2 Platform, Enterprise Edition
Overview
Java Technology Today
The Challenges of Today’s eSystems
The Java 2 Platform, Enterprise Edition
The J2EE Platform—Technology Component and Service APIs
Java Servlet Technology 2.3
JavaServer Pages Technology 1.2
Enterprise JavaBeans Technology 2.0
JDBC 2.0 API
Java Message Service 1.0
Java Transaction API 1.0
JavaMail Technology 1.2
JavaBeans Activation Framework 1.0
J2EE Java Connector Architecture API 1.0
Java Naming and Directory Services API
Java API for XML 1.1
Java Authentication and Authorization Service 1.0
J2EE Application Programming Model
The Benefits of J2EE Components
Multi-Tiered Architecture
J2EE Compatibility Test Suite
J2EE Reference Implementation (RI)
J2EE Application Development Roles
Presentation Content Developers
Web Component Developers
Business Component Developers
EIS Integrators
J2EE Application Deployment Roles
J2EE Product Provider
J2EE Tool Provider
Application Component Provider
Application Assembler
Application Deployer
System Administrator
2. J2EE Software Development Methodologies
(Not) Gaining a Competitive Edge in Internet Time
Why J2EE Projects Fail
Recognizing Mission Impossible Projects
Lack of Executive Sponsorship
Lack of User Involvement in the Project
The Initial Project Objectives Are Wrong
Changing Project Requirements and Specifications—“Scope Creep”
Lack of or Excessive Planning
Lack of IT Management and Technical Direction
Object-Oriented Analysis, Design, and Development Illiteracy
The Warning Signs of a Failing J2EE Project
Missed Milestones
Miscommunication
Too Many Decision Makers
The Top Ten Checklist for Initiating J2EE Projects
Organizational Frameworks for Supporting Enterprise J2EE Projects
Communities of Practice
Non-Technical (End-User) Communities
Technical Communities
Technical Centers of Excellence—The J2EE Architecture Group
J2EE Architectural Guidance to IT Projects
Software Development Methodologies
What Is an Object-Oriented (OO) Methodology?
Major Motivations for Using OO Methodologies in J2EE System Developments
Object-Oriented Approaches Produce Solutions Which Closely Resemble Their Problem Domains
Object-Oriented Approaches Promote OO Thinking
Objects and Components Are “Black Boxes”
Abstraction
Encapsulation
Concurrency
Object-Oriented Approaches Promote Reusability
Object-Oriented Approaches Support Interoperability
Object-Oriented Approaches Possess Traceability Capabilities
The Challenges of Using OO Methodologies—“Object Blindness”
The Traditional Waterfall Methodology
Feedback Failure Between the Phases
Requirements, Analysis, and Design Milestones
J2EE Software Development Methodologies Unveiled
Selecting a Software Development Methodology
BEA Systems Accelerated Process (Project Initiation Phase)
The Participators of the Accelerated Process
Accelerated Project Initiation
Accelerated Requirements Method
Accelerated Technical Feasibility Assessment
Customer Validation Meeting
Accelerated Risk Reduction Planning
Risk Validation Meeting
Accelerated Project Planning
Refactoring the Project Plan into Binary Deliverables
Iterative and Incremental Software Development Practices
Continuous Project Control Through Feedback
Realistic Deadlines on Milestones
Project Commitment Meeting
BEA Systems SteelThread (Architectural Prototyping)
SteelThread Prerequisites
eXtreme Programming
The 12 Core Practices of eXtreme Programming
The Planning Game
Initial Release Planning
Iteration Planning
Small Releases
Customer Tests (Acceptance Testing)
Simple Design
Pair Programming
Test-First Development (Unit Testing)
Design Improvement (Refactoring)
Continuous Integration
Collective Code Ownership
Coding Standard
Metaphors
Sustainable Pace
eXtreme Programming Resources
The Rational Unified Process
The Rational Unified Process Product
The Principles of the Rational Unified Process
The Organization of the Unified Process
The Phases of a Rational Unified Process
Inception
Elaboration
Construction Phase
Transition Phase
The Process Workflows of a Rational Unified Process
Rational Unified Process Resources
3. A Developer’s Guide to the Unified Modeling Language (UML)
The Challenge of Object-Oriented Analysis and Design
What Is the Unified Modeling Language?
The Relationship Between UML and Software Development Methodologies
UML Modeling Tools
The Elements of the Unified Modeling Language
The Structural Elements of UML
The Behavioral Elements of UML
The Grouping Elements of UML
The Annotational Elements of UML
Developing Use Case Diagrams (Analysis Phase)
The Features of a Use Case Diagram
Linking UML Diagrams
Developing Class Diagrams (Analysis)
The Features of a Conceptual Model
Developing Class Diagrams (Design)
The Features of a Class Diagram
Association Relationships
Generalization Relationships
Developing Interaction Diagrams (Design)
The Features of a Sequence Diagram
Developing Statechart Diagrams (Design)
The Features of a Statechart diagram
Developing Activity Diagrams (Analysis and Design)
The Features of an Activity Diagram
Developing Component and Deployment Diagrams (Design)
Component Diagrams
Deployment Diagrams
UML By Example—The Book Store
Deriving the Book Store Use Case Diagram
Deriving the Book Store Activity Diagram
Deriving the Book Store Class Diagram
Deriving the Book Store Interaction Diagrams
4. Best Practices for Java Development
Project Standards
Delivery Expectations
Java-Oriented Software Products
Source Code Control and Software Build Systems
Directory Structures and Environment Variables
The Runtime Environment for Java Software Development
Java Namespaces and Directory Structure
Java Style Guidelines
Naming rules
Formatting
Comments and Documentation
Using Javadoc Comments
Java Source File Layout
Java Programming Guidelines
General Coding Practices
Performance and Optimization Guidelines
Collections
Synchronization
Memory Allocation
Storage Efficiency
Methods
Objects
Arrays
Loops
Strings
String Are Immutable
Creating a String Using Literals
Pre-Allocate Your String Buffers
Switch Statements for Strings
Synchronization
Serialization
Garbage Collection
Java Compiler and JVM Optimizations
The Java Development Process
Introduction to Incremental Development
Preparing for Java Development
Creating the Common Components
What the Developer Should Do First
Application Development
Getting Started
The Design-Coding-Testing-Delivery Cycle
Program Design
Philosophy
Design Versus Coding
Coding
Write the Code Correctly the First Time
Use Examples
Refactoring
Coding Practice
Testing
Delivery
Reference
Endnotes
5. The J2EE Architecture and APIs
Understanding the Java 2 Platform, Enterprise Edition
The Logical Tiers of the J2EE Architecture
The J2EE Application Programming Model
The J2EE Application Server Layer
The Operating System Layer
Java Virtual Machine (JVM) Layer
The J2EE Application Server Execution Environment
The J2EE Services Layer
The Remote Method Invocation (RMI) Service
Where Is RMI Used in J2EE?
How Is RMI Used in J2EE?
The Details of an RMI Method Call
The Java Naming and Directory Interface (JNDI) API
Where Is JNDI Used in J2EE?
How Is JNDI Used in J2EE?
The Java Database Connection (JDBC) API
Where Is JDBC Used in J2EE?
How Is JDBC Used in J2EE?
The Java Transaction (JTA) API
Where Are Transactions Used in J2EE?
The Java Messaging Service (JMS)
Where JMS Is Used in J2EE?
How JMS Is Used in J2EE?
J2EE Security
The JavaMail API
Java Connector Architecture (J2C)
How Connectors Are Used in J2EE
The EJB Container
Enterprise JavaBeans (EJB)
Session Beans
The Session Bean Class
Entity Beans
Bean-Managed Persistence (BMP)
Container-Managed Persistence (CMP)
The Entity Bean Class
Message-Driven Beans (MDB)
The Message-Driven Bean Class
The Web Container
Servlets
Servlet Session Management
Servlet Context Information
Servlet Lifecycle
Servlet Request Filtering
Servlet Dispatch Control
Servlet Security
Servlets and Persistent Client Information (Cookies)
Invoking Servlets Through URL Query Strings
Declaring and Configuring Servlets
JavaServer Pages (JSP)
JavaServer Page Request Processing
The JSP Language Syntax
6. Transitioning from Software Design to J2EE Technology Components and Services
Specifying and Visualizing J2EE Components with UML
The Need for J2EE Software Design
Analyzing Requirements for a J2EE Solution with UML
Identifying and Applying Design Patterns
The Model-View-Controller Architecture (MVC)
The Gang of Four Design Patterns
Designing for Enterprise Java Beans
Stateful and Stateless Session Beans
Container Managed Persistence (CMP) and Bean Managed Persistence (BMP) Entity Beans
J2EE Deployment to WebLogic Server 7.0
From Design to J2EE By Example: A Truck Rental Business
Truck Rental Business Requirements
Truck Rental Use Cases
Use Case 1: Edit Request
Use Case 2: Search for Vehicle
Use Case 3: View Search Results
Use Case 4: Update Inventory
Truck Rental Activity Diagrams
Truck Rental Class Diagrams
Truck Rental Sequence Diagrams
Truck Rental Java Implementation
Summary
7. An Introduction to Web Services
The Message and Medium Paradigm
What Is a Web Service?
The Characteristics of Web Services
Web Services Standard Protocols
Simple Object Access Protocol (SOAP)
The Web Services Description Language (WSDL)
Universal Discovery Description and Integration
A Service-Oriented Architecture of Web Services
The Value Proposition of Web Services
II. Introducing the BEA WebLogic Platform 7
8. Deriving Application Infrastructure
Introducing Application Infrastructure
Understanding the Need for Application Infrastructure
Examining an Organization’s Application Infrastructure Reality
Deriving an Application Infrastructure Strategy
Recognizing Infrastructure Patterns
Cataloging Organizational Infrastructure Patterns
The Advantages of Cataloging Infrastructure Patterns
Developing a Technology Taxonomy
Identifying Enterprise Application Integration (EAI) Types
Implementing the Software Platform Solution to Application Infrastructure
Employing BEA’s Unified, Simplified, and Extensible Formula for Application Infrastructure: WebLogic Platform 7.0
Summary
9. Introducing BEA WebLogic Platform 7
What Is Technical Agility?
The WebLogic Platform—A Single, Unified, and Extensible Application Infrastructure
The Featured Benefits of WebLogic Platform
Introducing BEA WebLogic Server 7
WebLogic Server’s Competitive Edge
The Technical Architecture of WebLogic Server
The Presentation Layer
The Business Layer
The Integration Layer
Database Connectivity
J2EE Connector Architecture
Interoperability with Microsoft Software Components
BEA Tuxedo Interoperability
Enterprise Messaging
Web Services
Interoperability with Mainframes
Introducing WebLogic Workshop
The Primary WebLogic Workshop Components
A High-Level Architecture of WebLogic Workshop
Introducing BEA WebLogic Portal
A High-Level Architecture of WebLogic Portal
Personalization Services
Portal Services
Commerce Services
The EBusiness Control Center (EBCC)
Introducing WebLogic Integration
WLI Functional Areas
Summary
10. Installing and Configuring WebLogic Server 7
WebLogic Server 7 Editions
The WebLogic Express
The WebLogic Server Advantage Edition
The WebLogic Server Premium Edition
Preliminary WebLogic Server Installation Considerations
System and Software Requirements for Installing WebLogic Server
The New WebLogic Server Development Licensing Model
Installing WebLogic Server
Step 1: Download and Execute the Net Installer Program
Step 2: Select the BEA Home Directory
Step 3: Select the Installation Type
Step 4: Select the WebLogic Platform Products and Components
Step 5: Select the Download Option
Step 6: The Auto Installation Option
Step 7: Select the WebLogic Server Product Directory
Step 8: The Domain Configuration Wizard
Step 9: Create Your WebLogic Domain
Step 10: Select the WebLogic Server Type
Step 11: Select Your Domain Container Directory
Step 12: Configure Your Single Server
Step 13: Create Your System User Name and Password
Step 14: Create the WebLogic Server As a Windows Service
Step 14: Create a Start Menu Entry for Your WebLogic Server
Step 15: Review and Create Your Specified WebLogic Server Configuration
Validate Your CLASSPATH and PATH Environmental Variables
Navigating the WebLogic Platform Directory Structure
The BEA Home Directory
The Domain Container Directory
The WebLogic Home Directory
Startup Methods for WebLogic Server in Windows 2000
The startWebLogic Script File
Important startWebLogic Script Options
Dweblogic.management.discover
Dweblogic.ProductionModeEnabled
-Xms and -Xmx
Starting the Default WebLogic Server
Bypassing the Username and Password Prompt Using the Boot Identity File
Starting the Pet Store Sample Application
Shutdown Methods for WebLogic Server in Windows 2000
Shutting Down WebLogic Server Using the Administration Console
Shutting Down WebLogic Server Using the weblogic.Admin Utility
Understanding the New WebLogic Server Lifecycle States
Using WebLogic Server with the WebLogic JRockit JVM
The Benefits of Using the JRockit JVM
Installing and Using JRockit with WebLogic Server
Using the JRockit Management Console
Summary
11. Working with the WebLogic Server Tools
The WebLogic Server System Administration Tools
The WebLogic Administration Console
Starting the Administration Console
Navigating the Administration Console
A Simple Example of Using the Administration Console
The weblogic.Admin Command-Line Utility
The weblogic.Admin Utility Commands
PING
The WebLogic Server Deployment Tools
The WebLogic Builder
The EJBGen Utility
The weblogic.Deployer Utility
The WebLogic Server Administration Console
Deploying Your First Web Application Using WebLogic Builder
Step 1: Creating the Web Application Directory Structure
Step 2: Creating Your Welcome Page
Step 3: Creating and Compiling Your Hello World Servlet
Step 4: Starting the WebLogic Builder
Step 5: Assembling the HelloWorldApp Web Application
Step 6: Deploying Your Web Application
Step 7: Testing Your Web Application
Summary
III. WebLogic and J2EE Services Support
12. Distributed Processing Using RMI
Understanding Distributed Processing
The RMI Design Model
RMI Package Names
Creating an RMI Application
RMI Registry Naming Service
RMI Registry API
Java 2 Standard Edition RMI Registry
WebLogic RMI Registry
The Remote Interface
Java 2 Standard Edition Remote Interface
WebLogic Remote Interface
Remote Object
Java 2 Standard Edition Remote Object
WebLogic Remote Object
RMI Client Application
Generating Stubs and Skeletons Using rmic
Java 2 Standard Edition rmic
WebLogic rmic
Sample RMI Application
WebLogic Optimizations for RMI
WebLogic RMI over IIOP
Summary
13. Accessing Data Repositories Using JDBC
The Java Database Connectivity API
The Basics of Database Programming in Java
Understanding Relational Databases
Designing the Data Model
Understanding SQL
SQL Datatypes
SQL Commands
SQL Transactions
Understanding JDBC
Using the DriverManager
JDBC Drivers from BEA WebLogic
Third-Party Drivers for WebLogic Server
The Connection Object
The Statement Object
The PreparedStatement Object
The ResultSet Object
Working with BLOB and CLOB Data Types
The Bookstore JDBC Example
JDBC and BEA WebLogic Server
Configuring and Using Connection Pools
Configuring and Using MultiPools
Configuring and Using Data Sources
Configuring and Using TxDataSources
Configuring and Using JDBC DataSource Factories
Using JDBC in a BMP Entity Bean
Advanced JDBC Topics
Stored Procedures
Batch Processing
Meta-Data
Summary
14. Locating Named Services through JNDI
An Introduction to the Java Naming and Directory Interface
The JNDI Architectural Framework
Understanding Naming and Directory Services
LDAP Server
RMI Registry
COS Name Server
The WebLogic Naming Service
The Structure of the WebLogic Naming Service—The JNDI Tree
Using JNDI in a WebLogic Server Cluster
The JNDI Service Provider Interface
Using the LDAP SPI
LDAP Security Considerations
Using the RMI SPI
RMI Security Considerations
Using the COS SPI
COS Security Considerations
Using the WebLogic SPI
WebLogic Security Considerations
Creating the Context Environment for WebLogic
The JNDI Application Programming Interface
Looking Up an Object Using the JNDI Context
Closing the JNDI Context
Binding an Object Using the JNDI Context
Examples of Using JNDI in J2EE Applications
Looking Up the EJB Home Interface
Looking Up JMS Connection Factories and Distributed Destinations
Looking Up JDBC DataSources
Looking Up JTA UserTransactions
Summary
15. The Java Messaging Service (JMS)
What Is the Java Message Service API?
JMS Messaging Versus Tightly Coupled Communication APIs
An Overview of the JMS Architecture and Messaging
Messaging Domains
The Point-to-Point Messaging Domain
The Publish/Subscribe Messaging Domain
Messaging Consumption and Delivery
Messaging Domain Interfaces
The Structure of a JMS Message
Message Header Fields
Message Property Fields (Optional)
Message Body
The JMS API Programming Model
ConnectionFactory
Connections
Sessions
Destinations
MessageProducer
MessageConsumer
The WebLogic JMS Server
The Basic Configuration of WebLogic JMS
Configuring Persistent Messaging
Configuring a JMS Server
Creating a JMS Destination—Queue or a Topic
Using JMS Templates
Configuring JMS Server and Destination Thresholds
Implementing Messaging Service Continuity with Distributed Destinations
Configuring Connection Factories
Monitoring Your JMS Server
Developing a WebLogic JMS Application
Point-to-Point Client
A Point-to-Point Producer
A Point-to-Point Consumer
A Point-to-Point Client with an Asynchronous Listener
A Publish/Subscribe Producer
A Publish/Subscribe Consumer
Message Selectors
Summary
16. Managing Java Transactions Using JTA
The Java Transaction API
Using Transactions to Ensure Data Integrity
Understanding Distributed Transactions
ACID-Compliant Databases
The JDBC Optional Package and JTA
Using the DataSource Interface
Using Connection Pools
Using a DataSource for Distributed Transactions
Using the RowSet Interface
Using the UserTransaction Interface
Configuring WebLogic JDBC Connection Pools
Configuring WebLogic JDBC Tx DataSources
Performing Distributed Transactions with a Transaction Manager
XA-Compliant Resources
Two-Phase Commit (2PC)
Transaction Isolation Levels
Using the WebLogic JTA Driver
The BookStore Servlet Example
Summary
IV. Developing Presentation Logic—JSPs and Servlets
17. Introduction to Servlets
CGI—The First Generation of Dynamic Content Generation Tools
A Better Way—Servlets
What Is a Servlet?
Handling HTTP Clients—The HttpServlet Class
Servlet Technologies
The Servlet API—Commonly Used Methods
The Servlet Container
The Servlet Lifecycle
Servlets and Threads
Creating Your First Servlet
A doGet() Servlet Example
Adding doPost() to the Servlet
J2EE Packaging for Servlets—Web Applications
Web Application Hierarchy
Running Your First Servlet in WebLogic 7.0
Servlet Advanced Features
Initialization Parameters for Servlets
Database Access Using WebLogic Server 7.0 Services
Using WebLogic 7.0 Connection Pools
Using a DataSource for Database Connections
Servlet Implementation Limitations
Summary
18. JavaServer Pages and Tag Libraries
Understanding JavaServer Pages (JSPs)
JSP Elements
Predefined Variables
Expressions
Declarations
Scriptlets
Other Scripting Elements
Using JavaBeans
Instantiating JavaBeans in JSP
Manipulating JavaBean Properties in a JSP
Setting Bean Properties from the Request
Creating the JavaBean Class
JavaBean Example
Tag Libraries
Parts of a Tag Library
Implementing a Custom Tag Library
Using the Custom Tag in a JSP
Putting It All Together: Using the Tag Library in WebLogic
Summary
19. Servlets and JavaServer Pages—Best Practices
What Is the MVC Pattern?
The MVC Model with Servlets and JSPs
A Simple MVC Example: Login Management
JSP Login Handler
Servlet Login Handler
Servlet Login Handler with a JSP Front End
Implementing the Model
The EJB-to-JSP Integration Tool
Managing Page-to-Page Relationships and Transitions
Summary
V. Developing Business Logic—Enterprise JavaBeans
20. Developing Business Logic—Session Beans
Introducing Session Beans
The Value Proposition of Session Beans
Session Bean Types
Stateless Session Beans
When to Use Stateless Session Beans
Stateful Session Beans
When to Use Stateful Session Beans
Differences Between Stateless and Stateful Session Beans
A Practitioner’s Approach to Understanding Session Beans
The Development Elements of a Session Bean
The Remote Interface
The Home Interface
The Implementation Class
The Stubs and Skeletons of Session Bean Interfaces
Using a Local View to Access a Session Bean
Developing a Test Java Client for Your Session Bean
Developing Deployment Descriptors
The ejb-jar.xml File
The weblogic-ejb-jar.xml File
Building a Session Bean Deployment Unit
Deploying Your Session Bean
The Life Cycle of Stateless Session Beans
The Does Not Exist State
The Method Ready Pool State
The Busy or Active State
The Life Cycle of Stateful Session Beans
The Does Not Exist State
The Method Ready State
The Passivated State
Testing the Life Cycle of Stateful Session Beans
Programming Transactions in Session Beans
Container-Managed Transactions
Bean-Managed Transactions
Summary
21. Managing Persistence—Entity Beans
Persistence: The Final Tier
What Are Entity Beans?
Using the EJB Container
Container-Managed Persistence Versus Bean-Managed Persistence
Container-Managed Relationships
Container-Managed Transactions
Rolling Back Container-Managed Transactions
The Lifecycle of Entity Beans
Developing the Components of Entity EJBs
EJB Remote Interface
EJB Local Interface
Using the EJB Value Object
EJB Remote Home Interface
EJB Local Home Interface
Writing the Entity EJB Class
Writing the Primary Key Class
Creating the BookEntityPK Primary Key Class
Deployment Descriptors
EJB Name Tag
Additional XML Tags in the Deployment Descriptor
EJB Home Interface Tag
EJB Remote Interface Tag
EJB Class Tag
Persistence Type Tag
CMP Field Tags
EJB Primary Key Field
Query Tag
Writing Finder Methods
Enterprise JavaBean Query Language
Bean-Managed Persistence Example
Creating a Connection with a Data Source
Creating the BookEntityBMPBean
Creating the BMP Style Deployment Descriptor
Container-Managed Persistence Example
Creating the BookEntityCMPBean
Container-Managed Relationship Example
Creating the ShoppingCart Remote Interface
Creating the ShoppingCart Home Interface
Creating the ShoppingCart CMP Entity Bean
The ShoppingCart Primary Key
Testing the Book Store
Creating the Deployment Descriptor
Deployment on WebLogic Server
The weblogic-ejb-jar.xml Deployment Descriptor
The weblogic-cmp-rdbms-jar.xml Persistence Descriptor
Deploying Entity Beans to WebLogic Server
Step 1: Start and Configure Your Target Database
Step 2: Configure the JDBC Connection Pools Tx DataSource in Your WebLogic Server
Step 3: Deploying the ShoppingCart EJB Example to Your WebLogic Server
Testing the Deployment of the ShoppingCart Module
Summary
22. Asynchronous Message Processing—Message-Driven Beans
What Is a Message-Driven Bean?
The Characteristics of Message-Driven Beans
The Value Proposition of Message-Driven Beans
Differences Between MDBs and Other Bean Types
The Message-Driven Bean Class
The ejbCreate() Method
The setMessageDrivenContext() Method
The onMessage() Method
The ejbRemove() Method
Handling Exceptions
The Life Cycle of a Message-Driven Bean
Developing a Simple Message-Driven Bean Example
Step 1: Writing the Message-Driven Bean Code
Step 2: Writing the Associated Deployment Descriptors
The ejb-jar.xml Deployment Descriptor
The weblogic-ejb-jar.xml Deployment Descriptor
Step 3: Building Your MDB Example
Step 4: Configuring the JMS Destination for the MDB Example
Step 5: Deploying the MDB Example to Your WebLogic Server
Step 6: Testing Your Message-Driven Bean
An Overview of Message-Driven Bean Transactions
Specifying an MDB’s Transaction Demarcation Type
Container-Managed Transactions
Avoiding Poison Messages with Container-Managed MDBs
Bean-Managed Transactions
Summary
23. EJB Best Practices
Best Practices for Session Beans
Optimizing JNDI Lookups
When Not to Use Stateful Session Beans
Scalability Issues with Stateful Session Beans
The SessionSynchronization Interface
Session Beans As a Facade to Entity Beans
Best Practices for Entity Beans
Consider Writing CMP Entity Beans Instead of BMP Entity Beans
Debug Flags to Instrument BMP Code
Writing an Efficient Primary Key Class
Implementing the hashCode Method
Implementing the equals() Method
Choose the Right Concurrency Strategy
Optimize Database Access Calls
Loading Related CMP Fields
Optimizing Finders
Optimizing CMP Entity Beans
Optimizing BMP Entity Beans
Optimizing Database Writes for BMP Entity Beans
Consider Using Tuned Updates for CMP 1.1 Beans
Consider Using Read-Only/Read-Mostly Entity Beans
Handling Transactions in EJBs
Use Container Managed Transactions Instead of Bean Managed Transactions
Do Not Use the Supports Transaction Attribute
Consider Using the Mandatory Transaction Attribute
Consider Using Transactional DataSources for Entity Beans
Always Demarcate Transactions at the WLS or Database Level
Best Practices for EJB Security
Best Practices for Coding Standard Interfaces
MDB Best Practices
Exception Handling in MDBs
Consider Using a Separate JMS Destination to Handle Poison Messages
Consider Using DUPS_OK_ACKNOWLEDGE Mode
Summary
VI. BEA WebLogic Server Administration
24. Administering and Monitoring Your WebLogic Domain
Understanding WebLogic Domains
The Relationship Between Administration and Managed Servers
Administering a WebLogic Domain from an Infrastructure Perspective
Creating and Extending WebLogic Domains
Creating a WebLogic Domain and Standalone WebLogic Server Using the Configuration Wizard
Extending a WebLogic Domain with a Remote Managed Server Using the Configuration Wizard
Configuring a New Machine Definition within a WebLogic Domain
Configuring a New Server Definition within a WebLogic Domain
Configuring the Network Resources for a WebLogic Domain
An Introduction to Network Channels
Viewing Your Default Network Configuration
Enabling the Administration Port
Configuring a Network Channel
Understanding Network Access Points
Leveraging Network Access Points in Your Network Channel
Managing Your WebLogic Servers Using the Node Manager
Configuring the Node Manager on a Machine Node
Step 1: Configuring Your Trusted Hosts
Step 2: Configuring SSL Communication Between the Administration Server and Managed Servers
Step 3: Configuring the Node Manager Machines
Step 4: Specifying the Managed Server’s Startup Information
Starting the Node Manager Process
Starting the Node Manager Using a Startup Script
Creating a Node Manager Windows Service
Remotely Starting the Managed Servers
Reviewing the Node Manager–Associated Log Files
The Node Manager Startup Log Files
The Managed Server Log Files
Monitoring the Health of Your WebLogic Domain Using the Node Manager
Understanding the WebLogic Server Logs
Modifying the Logging Behavior of the Local Log File
The General Tab
The Rotation Tab
Modifying the Logging Behavior of the Domainwide Log File
Summary
25. Implementing Highly Available and Scalable Solutions Using the WebLogic Cluster
The Motivations for Clustered Infrastructure Solutions: Scalability and High Availability
Scalability
High Availability
Additional Factors Affecting High Availability
Load Balancing
Understanding WebLogic Clusters
Understanding Which Objects Can Be Clustered
Examining Deployment Restrictions to the WebLogic Cluster
Understanding How WebLogic Servers Communicate Within a Cluster
IP Multicast Communication
IP Socket Communication (Peer-to-Peer)
Designing the Architecture of a WebLogic Cluster
Understanding a Typical Clustering Environment
The Load Balancer
The Web Proxy Server
WebLogic Server
The DeMilitarized Zone (DMZ)
Recommended WebLogic Clustering Architectures
The Combined-Tier Architecture
The Multi-Tier Architecture
Creating and Configuring a WebLogic Cluster
The Tools for Creating and Configuring a WebLogic Cluster
Guidelines for Configuring Your WebLogic Cluster
Configuring a Cluster Using the Administration Console
Starting Your WebLogic Cluster
Starting a WebLogic Cluster Using the Command Shell
Starting a WebLogic Cluster Using the Administration Console
Monitoring Server Participation in Your WebLogic Cluster
Implementing a Load-Balancing Mechanism for Your Clustered Servlets and JSPs
Using a WebLogic Proxy Plug-in Load-Balancing Solution
Configuring the HttpClusterServlet As a Load-Balancing Solution
Using a Hardware Appliance Load-Balancing Solution
Implementing a Failover Mechanism for Your Clustered Servlets and JSPs
In-Memory Replication
Configuring In-Memory Replication
Configuring Replication Groups to Specify Replica Object Servers
Demonstrating the In-Memory Replication of Session State
File-Based Persistent Storage
JDBC-Based Persistent Storage
Clustering Enterprise JavaBeans
The Replica-Aware Home and Remote Stubs
The Load-Balancing and Failover Algorithms Employed by the Replica-Aware Stubs
The Load-Balancing and Failover Mechanisms of Stateless Session Beans
The Load-Balancing and Failover Mechanisms of Stateful Session Beans
The Load-Balancing and Failover Mechanisms of Entity Beans
Summary
26. Managing the WebLogic Security Service
The Challenges of Web Application Security
The Formation of Social Infrastructures to Support a Security Ecosystem
The Functional Abstraction of Security from Application Code
An Introduction to the WebLogic Server Security Service
A Basic Security Setup Using the WebLogic Server Security Service
The Demilitarized Zone
The Firewall
The Web Server
Connection Filters
Lightweight Directory Access Protocol
The Architecture of the WebLogic Security Service
The WebLogic Security Framework
The Security Service Provider Interfaces
The Security Provider Database
Security Providers
Authentication Providers
The Authentication Process
The LoginModule
The PrincipalValidator
The IdentityAsserter
Role Mapping Providers
Authorization Providers
Auditing Provider
Credential Mapping Provider
Keystore Providers
Realm Adapter Providers
Understanding Your WebLogic Security Realm
Managing Your Security Realm
The General Tab
The User Lockout Tab
The Contents Tab
The Providers Tab
Configuring New User Accounts
The Guest and Anonymous Users
Configuring New Groups
Adding Users to Groups
Configuring Roles
Creating a Global Role
Creating a Scoped Role
Configuring Security Policies
Securing Your WebLogic Applications
Securing a Web Application Through the Administration Console
Summary
27. Packaging, Assembling, and Deploying J2EE Applications
Introducing the WebLogic Server ClassLoaders
What Are Java ClassLoaders?
J2EE Application Classloading in WebLogic Server
Understanding the WebLogic Server ClassLoader Hierarchy
Making Use of the PreferWebInfClasses Element
Application Classloading Optimization in WebLogic Server
Best Practices for Packaging Shared Utility Classes
Making Use of the Manifest Class-Path
Packaging Applications Targeted for WebLogic Server
Web Applications
The Web Application Directory Structure
Web Application Deployment Descriptors
Generating Web Application Deployment Descriptors Automatically
Packaging Web Applications
Enterprise JavaBean Applications
The Enterprise JavaBean Application Directory Structure
EJB Application Deployment Descriptors
Generating EJB Application Deployment Descriptors Automatically
Packaging EJB Applications
Enterprise Applications
The Enterprise Application Directory Structure
Enterprise Application Deployment Descriptors
Packaging Enterprise Applications
Deploying Applications to WebLogic Server
Two-Phase Deployment
Application Staging
Setting the Staging Mode and Staging Directory
The Deployment Order for Services and Applications in WebLogic Server
The WebLogic Server Deployment Tools
Using the Administration Console to Deploy Applications
Configuring and Deploying J2EE Applications Using the Administration Console
Undeploying Components with the Administration Console
Deleting Applications and Components with the Administration Console
Viewing a List of Components Through the Administration Console
Using the weblogic.Deployer Utility to Deploy Applications
Deploying a New Application to the Administration Server
Deploying a New Application to Managed Servers
Redeploying an Application to Targeted WebLogic Servers
Deploying a New Module to a Deployed EAR Application
Deactivating an Application on Active Targets
Deactivating an Application on All Deployed WebLogic Servers
Reactivating a Deactivated Application
Removing a Deployed Application
Refreshing Parts of an Exploded Application
Listing All Deployment Tasks
Canceling a Deployment Task
Using WebLogic Builder to Build and Deploy J2EE Applications
Starting WebLogic Builder
Opening a J2EE Application Using WebLogic Builder
Editing Web Application Deployment Descriptors with WebLogic Builder
Editing EJB Deployment Descriptors with WebLogic Builder
Other Useful Features Provided by WebLogic Builder
Connecting to WebLogic Server
Validating a Component
Viewing Deployment Descriptor XML Files
Deploying an Application Using WebLogic Builder
Using Auto-Deployment
Development Mode
Production Mode
Deploying Applications in the Auto-Deployment Mode
Undeploying Applications in Auto-Deployment Mode
Redeploying Archived Applications in Auto-Deployment Mode
Redeploying Exploded Applications in Auto-Deployment Mode
Using Ant for Building J2EE Applications
Ant Basic Concepts
Understanding the Ant Build File
Built-in Ant Tasks
javac
java
jar
The File and Directory Manipulation Ant Tasks
Creating a Web Application Archive Using the war Ant Task
Creating an Enterprise Application Archive Using the ear Ant Task
Deployment Best Practices
28. Performance Tuning WebLogic Server
Performance Tuning Goals for WebLogic Server
A WebLogic Server Performance Tuning Roadmap
Step 1: Understand Your WebLogic Server Environment
Step 2: Document Your WebLogic Server Environment
Step 3: Develop Test Scenarios for Your WebLogic Server Environment
Step 4: Benchmark Your Test Scenarios
Step 5: Identify the Potential Bottlenecks Affecting the Performance of Your Test Scenarios
Step 6: Resolve the Performance Bottlenecks in Your Test Scenarios
Tuning the Core Server Performance: The Thread Pool
The Socket Reader Implementation in WebLogic Server
Tuning the Java Socket Reader Threads
WebLogic Server Execute Queues
Determining the Appropriate Thread Count for an Execute Queue
Step 1: Start the Administration Server
Step 2: Run and Monitor a Load Test Against Your WebLogic Server Application
Step 3: Modifying the Thread Count in the Default Execute Queue
Tuning Execute Queues for Overflow Conditions
Determining Stuck Threads
Configuring Custom Execute Queues
Assigning Applications to Specific Execute Queues
Assigning Servlets and JSPs to Execute Queues
Assigning RMI Objects and EJBs to Execute Queues
Monitoring Execute Queues and Execute Threads
Tuning the Connection Backlog
Tuning JDBC Connection Pools in WebLogic Server
Caching Prepared SQL Statements
Tuning EJB Applications
Stateless Session Beans
Stateful Session Beans
Entity Beans
Tuning Pool Size for Entity Beans
Using the Appropriate Concurrency Strategy
Using the Appropriate Transaction Isolation Level
Using Delay-Database-Insert-Until
Optimizing HTTP Sessions
Tuning the Java Virtual Machine (JVM)
Tuning the JVM Heap Size
Determining Heap Size for the WebLogic Server
Setting the JVM Heap Size Options
Monitoring the WebLogic Server Heap and Forcing Garbage Collection
Detecting Low Memory Conditions in WebLogic Server
Summary
VII. Web Services
29. Web Services and the WebLogic Platform
Introduction
The Architectural Framework of Web Services
Supported Standards
Why WebLogic Web Services?
Roadmap to WebLogic Web Services
Creating Local Web Services
Through WebLogic Server
Through WebLogic Workshop
Web Service Runtime Environments
Local Web Service Advertised with UDDI
The Portlet Wizard
Web Services Included with WebLogic Commerce
Web Service Examples in WebLogic
Web Service Design Questions
Web Service Types
Synchronous Web Services
Asynchronous Web Services
Synchronous or Asynchronous?
Back-End Provider Components
EJBs
Java Classes
Security
Anatomy of a WebLogic Web Service
The JAX-RPC Model
Serializers and Deserializers
Supported or Built-in Types
SOAP Handlers
Inside a Synchronous (RPC) Web Service
Inside an Asynchronous Web Service
WebLogic Web Service Clients
Web Service Client Models
Static
Dynamic (with WSDL)
More on QNames
Dynamic (Without WSDL)
InOut Parameters
Summary
30. Developing Web Services for WebLogic Server
Introduction to Web Service Development
Understanding Design Considerations
Introducing the WebLogic Build Tools
The Web Service Home Page
Anatomy of an Assembled Web Service
The Client JAR File
Developing Your Own Web Service
WebLogic Ant Tasks
ServiceGen
Letting ClientGen Generate UDTs for You
Command-Line Utilities
Understanding Web Service Packaging Considerations
Building WebLogic Web Services Manually
The Web Service Deployment Descriptor
A Sample web-services.xml File
Using User-Defined Data Types
Specifying XML Schema for UDTs
Defining Types in web-services.xml
Writing Serializers and Deserializers
Defining Type Mappings in web-services.xml
Writing Back-End Components
Stateless Session EJBs
Java Classes
Using Output Parameters
The Holder Interface
InOut Back-End Component
InOut in WSDL and web-services.xml
Running the InOut Sample
InOut User-Defined Types
Writing Message Handlers
Handlers
The GenericHandler Class
Handler Chains
Flow of Control
Shared Context
Configuring Handlers into web-services.xml
Defining Your Handlers and Handler Chains
Specifying Handler Use
Understanding Exception Handling
Writing Asynchronous Web Services
JMS and Message-Driven Beans Example
The ProcessorMDB Bean
Setting Up JMS Factory and Destinations
Running the Asynchronous Web Service Sample
Examining How the Asynchronous Sample Is Built
Using the Asynchronous Web Service with Multiple Operations
Securing Your Web Services
Using SSL
Restricting Your Web Service to Use HTTPS
Securing Your Web Service URL
Securing Your EJB Back-End Component
ejb-jar.xml
weblogic-ejb-jar.xml
Debugging Your WebLogic Web Services
Checking Out the Web Service Home Page
Examining the Web Service Through the WebLogic Administration Console
Looking at the Generated web-services.xml File
Runtime Diagnostics
WebLogic Log Files
Best Practices
Employing Coarse-Grained Interactions
Promoting Loose Coupling
Deciding What Service Mode Is Important
Avoiding Method Overloading
Knowing That Web Services Are Not Always the Answer
New Features in WLS 7.0 Service Packs
Summary
31. Discovering Web Services
Introduction
What Is UDDI?
How Does UDDI Work?
The UDDI API at a Glance
UDDI Usage Patterns
A Sample Use Case
The Inquiry API
The Publish API
What a UDDI SOAP Call Looks Like
UDDI Features in WebLogic Server
The WebLogic UDDI Client Proxy
UDDI Data Structures Implementation: weblogic.uddi.client.structures.datatypes
API Request Data Objects: weblogic.uddi.client.structures.request
API Response Data Objects: weblogic.uddi.client.structures.response
The Inquiry Class: weblogic.uddi.client.service.Inquiry
The Publish Class: weblogic.uddi.client.service.Publish
Sample Client Code (Tasks)
Finding a Business
Finding a Service
Creating a New Business
The WebLogic UDDI Directory Explorer
Running UDDI Explorer
Creating Entries in a Private Registry
Summary
32. Web Services Made Easy—WebLogic Workshop
Overview
The Need for WebLogic Workshop
Simplify J2EE for the Application Developer
Solve Integration Problems with Enterprise-Class Web Services
What Is a Framework?
Why WebLogic Workshop?
WebLogic Workshop Architecture
JWS Files
JWS Syntax
Asynchrony: Conversations, Callbacks, and Buffering
Conversations
Callbacks
Client Callback
Control Handler
Buffering
JWS Controls
XML Maps
How to Map
Simple Mapping
Script Mapping
Mapping from XML to Java
Mapping from Java to XML
ECMAScript
Where to Map
Controls—A Closer Look
Database Control
Web Service Deployment
The Visual Development Environment
Project Tree
Operations
Main Work Area—The Canvas
The Test Harness
Overview Page
Console Page
Test Form Page
Test XML Page
Warnings Page
A Short Tutorial
Preliminaries
Create the creditCheck Web Service
Create the Bankruptcies Database Control
Create the Validate Credit EJB Control
Make Investigate.jws Call These Controls
Test the Service
Summary
VIII. Integration Services Provided by WebLogic Server 7
33. Introducing WebLogic Integration (WLI)
Introducing Integration
Challenges in Application Integration
Standards in Application Integration
BEA WebLogic Integration: A Platform for Application Integration
BEA WebLogic Integration Functional Areas
Business Process Management
Application Integration
B2B and Data Integration
34. Business and Workflow Process Management Using WLI
Introduction
Business Process Management (BPM)
Process Types
Stages in Business Process Management
Process Design
Process Execution
Process Monitoring
HelloWorld Workflow: A Workflow Which Triggers on an XML Event
Designing Business Processes
BPM Tools
Studio
Worklist
Programming Using BPM APIs
An Example of Using BPM APIs
BPM Plug-in Framework
Workflow Patterns
Parallel Execution
Choice of Events
Event with Timeout
Cancellation via Event
Execution Timeout
Summary
35. Understanding J2CA Through the WLI Application Integration Framework
Introduction to Application Integration
What Is J2EE Connector Architecture (J2CA)?
Resource Adapter
Connection Management Contract
Transaction Management Contract
Security Management Contract
Common Client Interface (CCI)
Components of Application Integration
Integration Framework
Adapter Development
Application Views
Defining an Application View
Using Application Views in Workflows
Using Application Views Programmatically
Deploying Application Views
Adapter Development Kit (ADK)
Service Adapters
Event Adapters
ADK Frameworks
Design-Time Framework
Runtime Framework
Logging Framework
Packaging Framework
Summary
36. Data Integration and B2Bi
Introduction to Integration
Data Integration
Translation
Transformation
Data Integration Support in WebLogic Integration
The Design-Time Component
The Runtime Component
Plug-in to BPM
Data Integration Tools
XML Instance Editor
XML Repository
XPath Wizard
Format Builder
Converting Binary Data to XML Using Format Builder
Contivo Analyst
Data Integration and BPM
Advanced Data Integration Using the Data Integration Plug-in
Business-to-Business Integration (B2Bi)
B2B Integration Support in WLI
B2Bi Configurations
Peer-to-Peer
Hub-and-Spoke
Business Protocols
Conversation
Collaboration Agreement
Using Workflows for B2Bi
ebXML Workflow Example
The B2Bi Plug-in for BPM
Administration Using the B2Bi Console
Business Connect
Summary
IX. Appendixes
A. Platform End-to-End Example
Introduction
Installation
Restrictions
Starting the Server
Use Case One: WebLogic Portal Features
Capturing the Sale
Adding a Web Service–Based Portlet
Use Case Two: WebLogic Workshop Features
Under the Covers of the Order-Tracking Web Service
Using the New Web Service
Use Case Three: WebLogic Integration Features
Under the Covers of the Third Use Case
Summary
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
36. Data Integration and B2Bi
Next
Next Chapter
A. Platform End-to-End Example
Part IX. Appendixes
In This Part
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset