More Books
JBoss 4.0 The Official Guide
JBoss® 4.0 The Official Guide
Table of Contents
Copyright
About the Authors
We Want to Hear from You!
Introduction
What This Book Covers
About JBoss
About Open Source
About Professional Open Source
What's New in JBoss 4.0
Chapter 1.  Installing and Building the JBoss Server
Getting the Binary Files
Installing the Binary Package
Basic Installation Testing
Booting from a Network Server
Building the Server from Source Code
Chapter 2.  The JBoss JMX Microkernel
JMX
The JBoss JMX Implementation Architecture
Connecting to the JMX Server
Using JMX as a Microkernel
The JBoss Deployer Architecture
Exposing MBean Events via SNMP
Remote Access to Services, Detached Invokers
Chapter 3.  Naming on JBoss
An Overview of JNDI
The JBossNS Architecture
Chapter 4.  Transactions on JBoss
Transaction and JTA Overview
JBoss Transaction Internals
Chapter 5.  EJBs on JBoss
The EJB Client-Side View
The EJB Server-Side View
The EJB Container
Entity Bean Locking and Deadlock Detection
Chapter 6.  Messaging on JBoss
JMS Examples
JBossMQ Overview
JBossMQ Configuration and MBeans
Specifying the MDB JMS Provider
Chapter 7.  Connectors on JBoss
JCA Overview
An Overview of the JBossCX Architecture
Configuring JDBC Datasources
Configuring Generic JCA Adaptors
Chapter 8.  Security on JBoss
J2EE Declarative Security Overview
An Introduction to JAAS
The JBoss Security Model
The JBossSX Architecture
The Secure Remote Password (SRP) Protocol
Running JBoss with a Java 2 Security Manager
Using SSL with JBoss and JSSE
Configuring JBoss for Use Behind a Firewall
Securing the JBoss Server
Chapter 9.  Web Applications
The Tomcat Service
The Tomcat server.xml File
The Engine Element
The Host Element
Using SSL with the JBoss/Tomcat Bundle
Setting the Context Root of a Web Application
Setting Up Virtual Hosts
Serving Static Content
Using Apache with Tomcat
Using Clustering
Integrating Third-Party Servlet Containers
Chapter 10.  MBean Services Miscellany
System Properties Management
Property Editor Management
Services Binding Management
Scheduling Tasks
The Log4j Service MBean
RMI Dynamic Class Loading
Chapter 11.  The CMP Engine
Example Code
The jbosscmp-jdbc Structure
Entity Beans
CMP Fields
Container-Managed Relationships
Declaring Queries
Optimized Loading
The Loading Process
Transactions
Optimistic Locking
Entity Commands and Primary Key Generation
JBoss Global Defaults
Datasource Customization
Chapter 12.  Web Services
JAX-RPC Service Endpoints
Enterprise JavaBean Endpoints
Web Services ClientsA JAX-RPC Client
Service References
Chapter 13.  Hibernate
The Hibernate MBean
Hibernate Archives
Using Hibernate Objects
Using a HAR File Inside an EAR File
The HAR Deployer
Chapter 14.  Aspect-Oriented Programming (AOP) Support
JBoss AOP: EJB-Style Services for Plain Java Objects
Why AOP?
Basic Concepts of AOP
Building JBoss AOP Applications
The JBoss AOP Deployer
Packaging and Deploying AOP Applications to JBoss
Appendix A.  The GNU Lesser General Public License (LGPL)
GNU General Public License
Appendix B.  Example Installation
Index
SYMBOL
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X

The Tomcat Service

Tomcat 5, the latest release of the Apache Java servlet container, supports the Servlet 2.4 and JSP 2.0 specifications. Tomcat is distributed as a deployable service in jbossweb-tomcat-5.0.sar in the deploy directory. It is shipped in exploded directory form, so it's easy to inspect and update the configuration of an embedded Tomcat instance.

The main service file is META-INF/jboss-service.xml. It configures the org.jboss.web.tomcat.tc5.Tomcat5 MBean, which controls Tomcat. Its configurable attributes include the following:

  • DefaultSecurityDomain This specifies the JAAS security domain to use in the absence of an explicit security-domain specification in the jboss-web.xml of a WAR file.

  • Java2ClassLoadingCompliance This enables the standard Java 2 parent delegation class-loading model rather than the servlet model, which loads from the WAR first. It is TRue by default because loading from WARs that include client JARs with classes used by EJBs causes class-loading conflicts. If you enable the servlet class-loading model by setting this flag to false, you need to organize your deployment package to avoid having duplicate classes in the deployment.

  • UseJBossWebLoader This flag indicates that Tomcat should use a JBoss unified class loader as the web application class loader. The default is TRue, which means that the classes inside the WEB-INF/classes and WEBINF/lib directories of the WAR file are incorporated into the default shared class loader repository described in Chapter 2, "The JBoss JMX Microkernel." This may not be what you want because it is contrary to the default servlet class-loading model and can result in sharing of classes/resources between web applications. You can disable this by setting this attribute to false.

  • LenientEjbLink This flag indicates that ejb-link errors should be ignored in favor of trying the jndi-name in the jboss-web.xml. The default is TRue.

  • ManagerClass This is the class to use as the session manager for replicating the state of web applications marked as distributable. The only provided implementation session manager is org.jboss.web.tomcat.tc5.session.JBossCacheManager, which uses JBossCache to track the distributed state.

  • SubjectAttributeName If set, this represents the request attribute name under which the JAAS subject will be stored. There is no default value, meaning that the subject is not set in the request.

  • SessionIdAlphabet This is the set of characters used to create a session's ID. It must be made up of exactly 65 unique characters.

  • SnapshotMode This sets the snapshot mode in a clustered environment. It must be either instant or interval. In instant mode, changes to a clustered session are instantly propagated whenever a modification is made. In interval mode, all modifications are periodically propagated according to the SnapshotInterval.

  • SnapshotInterval This sets the snapshot interval, in milliseconds, for the interval snapshot mode. The default is 1000ms, which is 1 second.

  • UseLocalCache This flag indicates whether the local HTTP session value should be used if it exists. When it is true, the existing local HTTP session values are used, and updates are replicated, but updates to the same session on other nodes do not update the local session value. This mode is useful only for failover. When it is false, the session value is obtained from the distributed cache. This mode can be used with load balancing. The default is TRue.

  • UseJK This specifies that you are using MOD_JK(2) for load balancing with sticky session combined with JvmRoute. If set to true, it will insert a JvmRouteFilter to intercept every request and replace the JvmRoute if it detects a failover. This additionally requires the JvmRoute to be set inside the engine definition in the Tomcat server.xml file. The default is false.

  • Domain This is the JMX domain under which Tomcat will register additional MBeans. The default is jboss.web.

  • SecurityManagerService This is a reference to the JAAS security manager for Tomcat to use. It defaults to jboss.security:service=JaasSecurityManager.

  • CacheName This is a reference to the JBossCache to be used for HTTP session replication, if session replication is being used. The default is jboss.cache:service=TomcatClusteringCache.