The JBoss 4 Application Server Guide

JBoss AS 4.0.2

Release 3

Table of Contents

What this Book Covers
About JBoss
About Open Source
About Professional Open Source
What's new in JBoss 4
1. J2EE Certification and Standards Compliance
2. Server Configurations
2.1. JBoss AS 4.0.1 and above
2.2. JBoss AS 4.0.0
3. New Services Types
4. JBoss AOP Support
5. Hibernate Integration
6. Clustering and Caching
1. Installing and Building the JBoss Server
1.1. Getting Started
1.2. Directory Structure
1.3. The Default Server Configuration File Set
1.4. Basic Installation Testing
1.5. Booting from a Network Server
2. The JBoss JMX Microkernel
2.1. JMX
2.1.1. An Introduction to JMX Instrumentation Level Agent Level Distributed Services Level JMX Component Overview
2.2. JBoss JMX Implementation Architecture
2.2.1. The JBoss ClassLoader Architecture
2.2.2. Class Loading and Types in Java ClassCastExceptions - I'm Not Your Type IllegalAccessException - Doing what you should not LinkageErrors - Making Sure You Are Who You Say You Are Inside the JBoss Class Loading Architecture
2.2.3. JBoss XMBeans Descriptors The Management Class The Constructors The Attributes The Operations Notifications
2.3. Connecting to the JMX Server
2.3.1. Inspecting the Server - the JMX Console Web Application Securing the JMX Console
2.3.2. Connecting to JMX Using RMI
2.3.3. Command Line Access to JMX Connecting twiddle to a Remote Server Sample twiddle Command Usage
2.3.4. Connecting to JMX Using Any Protocol
2.4. Using JMX as a Microkernel
2.4.1. The Startup Process
2.4.2. JBoss MBean Services The SARDeployer MBean The Service Life Cycle Interface The ServiceController MBean Specifying Service Dependencies Identifying Unsatisfied Dependencies Hot Deployment of Components, the URLDeploymentScanner
2.4.3. Writing JBoss MBean Services A Standard MBean Example XMBean Examples
2.4.4. Deployment Ordering and Dependencies
2.5. JBoss Deployer Architecture
2.5.1. Deployers and ClassLoaders
2.6. Exposing MBean Events via SNMP
2.6.1. The Event to Trap Service
2.7. Remote Access to Services, Detached Invokers
2.7.1. A Detached Invoker Example, the MBeanServer Invoker Adaptor Service
2.7.2. Detached Invoker Reference The JRMPInvoker - RMI/JRMP Transport The PooledInvoker - RMI/Socket Transport The IIOPInvoker - RMI/IIOP Transport The JRMPProxyFactory Service - Building Dynamic JRMP Proxies The HttpInvoker - RMI/HTTP Transport The HA JRMPInvoker - Clustered RMI/JRMP Transport The HA HttpInvoker - Clustered RMI/HTTP Transport HttpProxyFactory - Building Dynamic HTTP Proxies Steps to Expose Any RMI Interface via HTTP
3. Naming on JBoss
3.1. An Overview of JNDI
3.1.1. The JNDI API Names Contexts
3.1.2. J2EE and JNDI - The Application Component Environment ENC Usage Conventions
3.2. The JBossNS Architecture
3.2.1. The Naming InitialContext Factories Naming Discovery in Clustered Environments The HTTP InitialContext Factory Implementation The Login InitialContext Factory Implementation
3.2.2. Accessing JNDI over HTTP
3.2.3. Accessing JNDI over HTTPS
3.2.4. Securing Access to JNDI over HTTP
3.2.5. Securing Access to JNDI with a Read-Only Unsecured Context
3.2.6. Additional Naming MBeans org.jboss.naming.ExternalContext MBean The org.jboss.naming.NamingAlias MBean The org.jboss.naming.JNDIView MBean
4. Transactions on JBoss
4.1. Transaction/JTA Overview
4.1.1. Pessimistic and optimistic locking
4.1.2. The components of a distributed transaction
4.1.3. The two-phase XA protocol
4.1.4. Heuristic exceptions
4.1.5. Transaction IDs and branches
4.2. JBoss Transaction Internals
4.2.1. Adapting a Transaction Manager to JBoss
4.2.2. The Default Transaction Manager
4.2.3. UserTransaction Support
5. EJBs on JBoss
5.1. The EJB Client Side View
5.1.1. Specifying the EJB Proxy Configuration
5.2. The EJB Server Side View
5.2.1. Detached Invokers - The Transport Middlemen
5.2.2. The HA JRMPInvoker - Clustered RMI/JRMP Transport
5.2.3. The HA HttpInvoker - Clustered RMI/HTTP Transport
5.3. The EJB Container
5.3.1. EJBDeployer MBean Verifying EJB deployments Deploying EJBs Into Containers Container configuration information
5.3.2. Container Plug-in Framework org.jboss.ejb.ContainerPlugin org.jboss.ejb.Interceptor org.jboss.ejb.InstancePool org.jboss.ebj.InstanceCache org.jboss.ejb.EntityPersistenceManager The org.jboss.ejb.EntityPersistenceStore interface org.jboss.ejb.StatefulSessionPersistenceManager
5.4. Entity Bean Locking and Deadlock Detection
5.4.1. Why JBoss Needs Locking
5.4.2. Entity Bean Lifecycle
5.4.3. Default Locking Behavior
5.4.4. Pluggable Interceptors and Locking Policy
5.4.5. Deadlock Deadlock Detection Catching ApplicationDeadlockException Viewing Lock Information
5.4.6. Advanced Configurations and Optimizations Short-lived Transactions Ordered Access Read-Only Beans Explicitly Defining Read-Only Methods Instance Per Transaction Policy
5.4.7. Running Within a Cluster
5.4.8. Troubleshooting Locking Behavior Not Working IllegalStateException Hangs and Transaction Timeouts
6. Messaging on JBoss
6.1. JMS Examples
6.1.1. A Point-To-Point Example
6.1.2. A Pub-Sub Example
6.1.3. A Pub-Sub With Durable Topic Example
6.1.4. A Point-To-Point With MDB Example
6.2. JBoss Messaging Overview
6.2.1. Invocation Layer
6.2.2. Security Manager
6.2.3. Destination Manager
6.2.4. Message Cache
6.2.5. State Manager
6.2.6. Persistence Manager
6.2.7. Destinations Queues Topics
6.3. JBoss Messaging Configuration and MBeans
6.3.2. Configuring UIL2 for SSL JMS client properties for the UIL2 transport
6.3.11. Destination MBeans
6.4. Specifying the MDB JMS Provider
6.4.1. org.jboss.jms.jndi.JMSProviderLoader MBean
6.4.2. org.jboss.jms.asf.ServerSessionPoolLoader MBean
6.4.3. Integrating non-JBoss JMS Providers
7. Connectors on JBoss
7.1. JCA Overview
7.2. An Overview of the JBossCX Architecture
7.2.1. BaseConnectionManager2 MBean
7.2.2. RARDeployment MBean
7.2.3. JBossManagedConnectionPool MBean
7.2.4. CachedConnectionManager MBean
7.2.5. A Sample Skeleton JCA Resource Adaptor
7.3. Configuring JDBC DataSources
7.4. Configuring Generic JCA Adaptors
8. Security on JBoss
8.1. J2EE Declarative Security Overview
8.1.1. Security References
8.1.2. Security Identity
8.1.3. Security roles
8.1.4. EJB method permissions
8.1.5. Web Content Security Constraints
8.1.6. Enabling Declarative Security in JBoss
8.2. An Introduction to JAAS
8.2.1. What is JAAS? The JAAS Core Classes
8.3. The JBoss Security Model
8.3.1. Enabling Declarative Security in JBoss Revisited
8.4. The JBoss Security Extension Architecture
8.4.1. How the JaasSecurityManager Uses JAAS
8.4.2. The JaasSecurityManagerService MBean
8.4.3. The JaasSecurityDomain MBean
8.4.4. An XML JAAS Login Configuration MBean
8.4.5. The JAAS Login Configuration Management MBean
8.4.6. Using and Writing JBossSX Login Modules BaseCertLoginModule
8.4.7. Writing Custom Login Modules Support for the Subject Usage Pattern A Custom LoginModule Example
8.4.8. The DynamicLoginConfig service
8.5. The Secure Remote Password (SRP) Protocol
8.5.1. Providing Password Information for SRP
8.5.2. Inside of the SRP algorithm An SRP example
8.6. Running JBoss with a Java 2 security manager
8.7. Using SSL with JBoss using JSSE
8.8. Configuring JBoss for use Behind a Firewall
8.9. How to Secure the JBoss Server
8.9.1. The jmx-console.war
8.9.2. The web-console.war
8.9.3. The http-invoker.sar
8.9.4. The jmx-invoker-adaptor-server.sar
9. Web Applications
9.1. The Tomcat Service
9.2. The server.xml file
9.2.1. The Connector element
9.2.2. The Engine element
9.2.3. The Host element
9.2.4. The Valve element
9.3. The context.xml file
9.4. Using SSL with the JBoss/Tomcat bundle
9.5. Setting the context root of a web application
9.6. Setting up Virtual Hosts
9.7. Serving Static Content
9.8. Using Apache with Tomcat
9.9. Session Replication with JBoss Cache
9.9.1. Configuring session replication
9.9.2. Enabling session replication in your application
9.9.3. Monitoring session replication
9.10. Using Single Sign On
9.11. Integrating Third Party Servlet Containers
9.11.1. The AbstractWebContainer Class The AbstractWebContainer Contract Creating an AbstractWebContainer Subclass
10. MBean Services Miscellany
10.1. System Properties Management
10.2. Property Editor Management
10.3. Services Binding Management
10.4. Scheduling Tasks
10.4.1. org.jboss.varia.scheduler.Scheduler
10.5. The Log4j Service
10.6. RMI Dynamic Class Loading
11. The CMP Engine
11.1. Example Code
11.1.1. Enabling CMP Debug Logging
11.1.2. Running the examples
11.2. The jbosscmp-jdbc Structure
11.3. Entity Beans
11.3.1. Entity Mapping
11.4. CMP Fields
11.4.1. CMP Field Declaration
11.4.2. CMP Field Column Mapping
11.4.3. Read-only Fields
11.4.4. Auditing Entity Access
11.4.5. Dependent Value Classes (DVCs)
11.5. Container Managed Relationships
11.5.1. CMR-Field Abstract Accessors
11.5.2. Relationship Declaration
11.5.3. Relationship Mapping Relationship Role Mapping Foreign Key Mapping Relation table Mapping
11.6. Queries
11.6.1. Finder and select Declaration
11.6.2. EJB-QL Declaration
11.6.3. Overriding the EJB-QL to SQL Mapping
11.6.4. JBossQL
11.6.5. DynamicQL
11.6.6. DeclaredSQL Parameters
11.6.7. EJBQL 2.1 and SQL92 queries
11.6.8. BMP Custom Finders
11.7. Optimized Loading
11.7.1. Loading Scenario
11.7.2. Load Groups
11.7.3. Read-ahead on-find on-load none
11.8. Loading Process
11.8.1. Commit Options
11.8.2. Eager-loading Process
11.8.3. Lazy loading Process Relationships
11.8.4. Lazy loading result sets
11.9. Transactions
11.10. Optimistic Locking
11.11. Entity Commands and Primary Key Generation
11.11.1. Existing Entity Commands
11.12. Defaults
11.12.1. A sample jbosscmp-jdbc.xml defaults declaration
11.13. Datasource Customization
11.13.1. Type Mapping
11.13.2. Function Mapping
11.13.3. Mapping
11.13.4. User Type Mappings
12. Web Services
12.1. JAX-RPC Service Endpoints
12.2. EJB Endpoints
12.3. Web Services Clients
12.3.1. A JAX-RPC client
12.3.2. Service references
13. Hibernate
13.1. The Hibernate MBean
13.2. Hibernate archives
13.3. Using the hibernate objects
13.4. Using a HAR file inside of an EAR file
13.5. The HAR Deployer
14. Aspect Oriented Programming (AOP) Support
14.1. Why AOP
14.2. AOP Basic Concepts
14.2.1. Joinpoint and Invocation
14.2.2. Advice and Aspect
14.2.3. Pointcut Use XML configuration file Use annotations Use Annotation in Application Classes
14.2.4. Introduction and Mixin
14.3. Build JBoss AOP Applications
14.3.1. Compile to bytecode
14.3.2. Compile annotation
14.3.3. AOP Intrumentation
14.4. JBoss AOP Deployer
14.4.1. Install the latest jboss-aop.deployer
14.4.2. Configure the AOP service
14.4.3. Pre-packaged aspects library
14.5. Package and deploy AOP applications to JBoss
14.5.1. Use pre-packaged aspects
14.5.2. Develop your own aspects
14.5.3. Package and deploy custom aspects
A. The GNU Lesser General Public License (LGPL)
B. Book Example Installation
C. Building the Server from Source Code
C.1. Accessing the JBoss CVS Repositories at SourceForge
C.2. Understanding CVS
C.3. Anonymous CVS Access
C.4. Obtaining a CVS Client
C.5. Building the JBoss Distribution Using the Source Code
C.6. Building the JBoss Distribution Using the CVS Source Code
C.7. An Overview of the JBoss CVS Source Tree
C.8. Using the JBossTest unit testsuite