4 Tomcat Native Session Integration

If you are using Tomcat 10.0.x (Servlet 5.0), Tomcat 10.1.x (Servlet 6.0) or Tomcat 11.0.x (Servlet 6.1) , then you may opt to use Coherence*Web’s native session integration instead of using the installer, simplifying the development and deployment process of Coherence*Web applications.

This chapter includes the following sections:

Tomcat Configuration

Before deploying a Coherence*Web application to Tomcat, first copy the coherence.jar and coherence-web.jar files to CATALINA_HOME/lib on *nix or %TOMCAT_HOME%\lib on Windows. The JARs must not be included with the web application.

Each web application that will be using Coherence*Web will need to include a Tomcat-specific configuration file, META-INF/context.xml. The file must minimally include the following:
<Context>
    <Manager className="com.tangosol.coherence.web.tomcat.Manager"/>
    <Valve className="com.tangosol.coherence.web.tomcat.RequestValve"/>
</Context>

Those familiar with previous releases of Coherence*Web are familiar with configuring Coherence*Web using context initialization parameters. When using the Tomcat native session integration, these context attributes are not needed, and if present, will be ignored. Instead, Coherence*Web is configured using attributes on the Manager element from the preceding example. It should be noted that the available configuration options are a subset of those that are available when using the installer, as the native session integration’s scope is much narrower. For example, when using the installer, there are various options to configure how sessions are handled, such as http-only cookies, the name of the session cookie, and such. Those configuration options, in the native integration case, are configured and handled by Tomcat and not by Coherence*Web.

Manager Configuration Options

In addition to the standard manager options documented by Tomcat, the following configuration options are available when using the native session integration. See Table 4-1.

Table 4-1 Coherence Manager Configuration Options

Attribute Name Description
applicationName

See coherence-application-name.

configurationConsistency

See coherence-configuration-consistency.

collectionClass

See coherence-sessioncollection-class.

coordinatedReaper

See coherence-reaperdaemon-cluster-coordinated.

reaperSweepModulo

See coherence-reaperdaemon-sweep-modulo.

reaperLocality

See coherence-reaperdaemon-assume-locality.

reaperCycleSeconds

See coherence-reaperdaemon-cycle-seconds.

reaperPriority

See coherence-reaperdaemon-priority.

readInParallel

See coherence-reaperdaemon-parallel.

reapThreadsMin

See coherence-reaperdaemon-min-threads.

reapThreadsMax

See coherence-reaperdaemon-max-threads.

reapMechanism

See coherence-session-reaping-mechanism.

sessionCache

See coherence-session-cachename.

managementCache

See coherence-session-management-cachename.

sessionLocking

See coherence-session-locking.

memberLocking

See coherence-session-member-locking.

applicationLocking

See coherence-session-app-locking.

threadLocking

See coherence-session-thread-locking.

sessionGetLockTimeout

See coherence-session-get-lock-timeout.

logThreads

See coherence-session-log-threads-holding-lock.

logLevel

See coherence-session-logger-level.

scopeControllerClass

See coherence-scopecontroller-class.

overflowCache

See coherence-session-overflow-cachename.

overflowThreshold

See coherence-attribute-overflow-threshold.

suspectAttributes

See coherence-enable-suspect-attributes.

distributionControllerClass

See coherence-distributioncontroller-class.

preserveAttributes

See coherence-preserve-attributes.

localSessionCache

See coherence-local-session-cachename.

localAttributeCache

See coherence-local-attribute-cachename.

configurationPath

See coherence-cache-configuration-path.

federated

See coherence-session-cache-federated.

logInvalidationExceptions

See coherence-session-log-invalidation-exceptions.

clusterOwned

See coherence-cluster-owned.

shutdownDelaySeconds

See coherence-shutdown-delay-seconds.