Author: jeff.yuchang
Date: 2010-11-05 04:14:46 -0400 (Fri, 05 Nov 2010)
New Revision: 1083
Added:
trunk/distribution/src/main/release/db/cache/
trunk/distribution/src/main/release/db/cache/default.properties
trunk/distribution/src/main/release/db/cache/jbosscache.properties
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCache.java
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCacheProvider.java
trunk/runtime/clustering/src/main/resources/META-INF/riftsaw-cache-manager-jboss-beans.xml
Modified:
trunk/distribution/src/main/release/db/bpel.properties
trunk/distribution/src/main/release/install/build.xml
trunk/runtime/clustering/pom.xml
trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
Log:
*RIFTSAW-282, deployed jboss cache based implementation in clustering environment.
Modified: trunk/distribution/src/main/release/db/bpel.properties
===================================================================
--- trunk/distribution/src/main/release/db/bpel.properties 2010-11-05 04:12:41 UTC (rev
1082)
+++ trunk/distribution/src/main/release/db/bpel.properties 2010-11-05 08:14:46 UTC (rev
1083)
@@ -57,6 +57,7 @@
bpel.dao.factory=org.apache.ode.dao.jpa.hibernate.BpelDAOConnectionFactoryImpl
bpel.dao.factory.store=org.apache.ode.dao.jpa.hibernate.ConfStoreDAOConnectionFactoryImpl
bpel.dao.factory.scheduler=org.apache.ode.dao.jpa.hibernate.SchedulerDAOConnectionFactoryImpl
+bpel.cache.provider=(a)cache.provider@
## Transaction Factory
## default is org.apache.ode.il.EmbeddedGeronimoFactory
Added: trunk/distribution/src/main/release/db/cache/default.properties
===================================================================
--- trunk/distribution/src/main/release/db/cache/default.properties
(rev 0)
+++ trunk/distribution/src/main/release/db/cache/default.properties 2010-11-05 08:14:46
UTC (rev 1083)
@@ -0,0 +1 @@
+cache.provider=org.apache.ode.il.cache.DefaultCacheProvider
\ No newline at end of file
Added: trunk/distribution/src/main/release/db/cache/jbosscache.properties
===================================================================
--- trunk/distribution/src/main/release/db/cache/jbosscache.properties
(rev 0)
+++ trunk/distribution/src/main/release/db/cache/jbosscache.properties 2010-11-05 08:14:46
UTC (rev 1083)
@@ -0,0 +1 @@
+cache.provider=org.jboss.soa.bpel.cache.JBossCacheProvider
\ No newline at end of file
Modified: trunk/distribution/src/main/release/install/build.xml
===================================================================
--- trunk/distribution/src/main/release/install/build.xml 2010-11-05 04:12:41 UTC (rev
1082)
+++ trunk/distribution/src/main/release/install/build.xml 2010-11-05 08:14:46 UTC (rev
1083)
@@ -43,6 +43,14 @@
<property name="modules" value="../modules" />
<property name="samples" value="../samples" />
+ <condition property="cache.provider" value="jbosscache">
+ <istrue value="${clustering.support}"/>
+ </condition>
+
+ <condition property="cache.provider" value="default">
+ <isfalse value="${clustering.support}" />
+ </condition>
+
<target name="check.deploy.props">
<condition property="as.configured">
<and>
@@ -85,6 +93,7 @@
overwrite="true">
<filterset filtersfile="../db/jdbc/${database}.properties" />
<filterset filtersfile="../db/wsstack/${ws.stack}.properties" />
+ <filterset filtersfile="../db/cache/${cache.provider}.properties" />
</copy>
<copy file="../db/datasource/bpel-${database}-ds.xml"
@@ -137,6 +146,8 @@
<delete dir="${deploy.dir}/bpel-console" />
<delete
file="${server.lib.dir}/gwt-console-server-integration.jar"/>
<delete file="${server.lib.dir}/gwt-console-rpc.jar"/>
+
+ <antcall target="undeploy-clustering" />
</target>
@@ -230,8 +241,28 @@
<include name="riftsaw-clustering-*.jar"/>
</fileset>
</copy>
+
+ <move
file="${deploy.dir}/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml"
+
toFile="${deploy.dir}/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml.old"
>
+ </move>
+
+ <copy
file="../modules/clustering/META-INF/riftsaw-cache-manager-jboss-beans.xml"
+
toFile="${deploy.dir}/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml"
+ overwrite="true">
+ </copy>
+
+
</target>
+ <!-- undeploy clustering specific configuration.-->
+ <target name="undeploy-clustering" if="clustering.support">
+ <move
file="${deploy.dir}/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml.old"
+
toFile="${deploy.dir}/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml"
overwrite="true">
+ </move>
+ </target>
+
+
+
<target name="check.juddi">
<condition property="is.juddi.duplicated">
<available file="${deploy.dir}/juddi-service.sar" />
Modified: trunk/runtime/clustering/pom.xml
===================================================================
--- trunk/runtime/clustering/pom.xml 2010-11-05 04:12:41 UTC (rev 1082)
+++ trunk/runtime/clustering/pom.xml 2010-11-05 08:14:46 UTC (rev 1083)
@@ -16,6 +16,7 @@
<properties>
<jboss.clustering.version>5.1.0.GA</jboss.clustering.version>
+ <jboss.cache.version>3.1.0.GA</jboss.cache.version>
</properties>
<dependencies>
@@ -31,8 +32,16 @@
<dependency>
<groupId>org.jboss.soa.bpel.runtime</groupId>
<artifactId>riftsaw-engine</artifactId>
- </dependency>
+ </dependency>
+
<dependency>
+ <groupId>org.jboss.cache</groupId>
+ <artifactId>jbosscache-core</artifactId>
+ <version>${jboss.cache.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
@@ -47,7 +56,7 @@
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
- <exclude>**/jboss-beans.xml</exclude>
+ <exclude>**/*jboss-beans.xml</exclude>
</excludes>
</configuration>
</plugin>
Added: trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCache.java
===================================================================
--- trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCache.java
(rev 0)
+++
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCache.java 2010-11-05
08:14:46 UTC (rev 1083)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+
+package org.jboss.soa.bpel.cache;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.ode.bpel.iapi.Cache;
+import org.jboss.cache.Fqn;
+
+/**
+ * JBossCache implementation of {@Cache} API.
+ *
+ * @author jeffyu
+ *
+ */
+public class JBossCache<K, V> implements Cache<K, V> {
+
+ private final org.jboss.cache.Cache<K, V> cache;
+
+ private final Fqn<String> fqn;
+
+ public JBossCache(org.jboss.cache.Cache<K, V> cache, Fqn<String> fqn) {
+ this.cache = cache;
+ this.fqn = fqn;
+ }
+
+ public boolean containsKey(K key) {
+ if (cache.getData(fqn) == null || cache.getData(fqn).size() < 1) {
+ return false;
+ }
+ return cache.getData(fqn).containsKey(key);
+ }
+
+ public V get(K key) {
+ return cache.get(fqn, key);
+ }
+
+ public Set<K> keySet() {
+ Set<K> keyset = cache.getKeys(fqn);
+ if (keyset == null) {
+ keyset = new HashSet<K>();
+ }
+ return keyset;
+ }
+
+ public V put(K key, V value) {
+ return cache.put(fqn, key, value);
+ }
+
+ public V remove(K key) {
+ return cache.remove(fqn, key);
+ }
+
+ public Collection<V> values() {
+ return cache.getData(fqn).values();
+ }
+
+}
Added:
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCacheProvider.java
===================================================================
---
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCacheProvider.java
(rev 0)
+++
trunk/runtime/clustering/src/main/java/org/jboss/soa/bpel/cache/JBossCacheProvider.java 2010-11-05
08:14:46 UTC (rev 1083)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.cache;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.ode.bpel.iapi.Cache;
+import org.apache.ode.bpel.iapi.CacheProvider;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.ha.cachemanager.CacheManager;
+
+/**
+ *
+ *
+ * @author jeffyu
+ *
+ */
+public class JBossCacheProvider implements CacheProvider {
+
+ public static final String RIFTSAW_NODE_PREFIX = "jboss/riftsaw/";
+
+ private static int counter = 1;
+
+ private CacheManager cacheManager;
+
+ private org.jboss.cache.Cache cache;
+
+ public void start() throws Exception {
+ Context ctx = new InitialContext();
+ cacheManager = (CacheManager) ctx.lookup("java:CacheManager");
+ cache = cacheManager.getCache("riftsaw-cache", true);
+ cache.start();
+ }
+
+ public <K, V> Cache<K, V> createCache() {
+
+ String fqnString = RIFTSAW_NODE_PREFIX + String.valueOf(counter);
+ Fqn<String> theFqn = Fqn.fromString(fqnString);
+ Cache<K, V> result = new JBossCache<K, V>(cache, theFqn);
+ counter ++;
+ return result;
+ }
+
+ public void stop() throws Exception {
+ cacheManager.releaseCache("riftsaw-cache");
+ }
+
+}
Modified: trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml 2010-11-05
04:12:41 UTC (rev 1082)
+++ trunk/runtime/clustering/src/main/resources/META-INF/jboss-beans.xml 2010-11-05
08:14:46 UTC (rev 1083)
@@ -18,6 +18,7 @@
<depends>jboss:service=Naming</depends>
<depends>BPELDatabaseInitializer</depends>
<depends>BPELDeployer</depends>
+ <depends>CacheManager</depends>
</bean>
<!--
Added:
trunk/runtime/clustering/src/main/resources/META-INF/riftsaw-cache-manager-jboss-beans.xml
===================================================================
---
trunk/runtime/clustering/src/main/resources/META-INF/riftsaw-cache-manager-jboss-beans.xml
(rev 0)
+++
trunk/runtime/clustering/src/main/resources/META-INF/riftsaw-cache-manager-jboss-beans.xml 2010-11-05
08:14:46 UTC (rev 1083)
@@ -0,0 +1,1529 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <!-- Factory/registry for JBoss Cache and PojoCache instances used in the AS
-->
+ <bean name="CacheManager"
class="org.jboss.ha.cachemanager.CacheManager">
+
+
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.cache:service=CacheManager",
exposedInterface=org.jboss.ha.cachemanager.CacheManagerMBean.class,
registerDirectly=true)</annotation>
+
+ <!-- This doesn't seem to work, so the service binds itself for now
+
<annotation>@org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="java:CacheManager")</annotation>
+ -->
+ <property name="jndiName">java:CacheManager</property>
+
+ <property name="configurationRegistry"><inject
bean="CacheConfigurationRegistry"/></property>
+ <property name="channelFactory"><inject
bean="JChannelFactory"/></property>
+
+ <!-- Aliases for cache names. Allows caches to be shared across
+ services that may expect different cache config names. -->
+ <property name="configAliases">
+ <map keyClass="java.lang.String"
valueClass="java.lang.String">
+ <!-- Use the HAPartition cache for ClusteredSSO caching -->
+ <entry>
+ <key>clustered-sso</key>
+ <value>ha-partition</value>
+ </entry>
+ <!-- Handle the legacy name for the EJB3 SFSB cache -->
+ <entry>
+ <key>jboss.cache:service=EJB3SFSBClusteredCache</key>
+ <value>sfsb-cache</value>
+ </entry>
+ <!-- Handle the legacy name for the EJB3 Entity cache -->
+ <entry>
+ <key>jboss.cache:service=EJB3EntityTreeCache</key>
+ <value>mvcc-shared</value>
+ </entry>
+ </map>
+ </property>
+
+ <!-- Start these caches as part of the start of this CacheManager
+ <property name="eagerStartCaches">
+ <set>
+ <value>ha-partition</value>
+ </set>
+ </property>
+ -->
+
+ </bean>
+
+ <!--
+ | Registry of named JBoss Cache configurations. Users of the CacheManager
+ | request a cache with a particular configuration by providing the name
+ | of one of these configurations.
+ -->
+ <bean name="CacheConfigurationRegistry"
class="org.jboss.ha.cachemanager.DependencyInjectedConfigurationRegistry">
+
+ <!-- If users wish to add configs using a more familiar JBC config format
+ they can add them to a cache-configs.xml file specified by this property.
+ However, use of the microcontainer format used below is recommended.
+ <property
name="configResource">META-INF/jboss-cache-configs.xml</property>
+ -->
+
+ <!-- The configurations. A Map<String name, Configuration config> -->
+ <property name="newConfigurations">
+ <map keyClass="java.lang.String"
valueClass="org.jboss.cache.config.Configuration">
+
+ <!-- The standard configurations follow. You can add your own and/or edit these.
-->
+
+ <!-- Standard cache used for web sessions -->
+ <entry><key>standard-session-cache</key>
+ <value>
+ <bean name="StandardSessionCacheConfig"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Provides batching functionality for caches that don't want to
interact with regular JTA Transactions -->
+ <property
name="transactionManagerLookupClass">org.jboss.cache.transaction.BatchModeTransactionManagerLookup</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-SessionCache</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because we are using asynchronous replication. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="fetchInMemoryState">true</property>
+
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+ <property name="cacheMode">REPL_ASYNC</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. Make this longer
+ than lockAcquisitionTimeout.-->
+ <property name="syncReplTimeout">17500</property>
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Not needed for a web session cache that doesn't use FIELD -->
+ <property
name="useRegionBasedMarshalling">false</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">false</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property
name="exposeManagementStatistics">true</property>
+
+ <property name="buddyReplicationConfig">
+ <bean class="org.jboss.cache.config.BuddyReplicationConfig">
+
+ <!-- Just set to true to turn on buddy replication -->
+ <property name="enabled">false</property>
+
+ <!-- A way to specify a preferred replication group. We try
+ and pick a buddy who shares the same pool name (falling
+ back to other buddies if not available). -->
+ <property name="buddyPoolName">default</property>
+
+ <property
name="buddyCommunicationTimeout">17500</property>
+
+ <!-- Do not change these -->
+ <property
name="autoDataGravitation">false</property>
+ <property
name="dataGravitationRemoveOnFind">true</property>
+ <property
name="dataGravitationSearchBackupTrees">true</property>
+
+ <property name="buddyLocatorConfig">
+ <bean
class="org.jboss.cache.buddyreplication.NextMemberBuddyLocatorConfig">
+ <!-- The number of backup copies we maintain -->
+ <property name="numBuddies">1</property>
+ <!-- Means that each node will *try* to select a buddy on
+ a different physical host. If not able to do so
+ though, it will fall back to colocated nodes. -->
+ <property
name="ignoreColocatedBuddies">true</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="cacheLoaderConfig">
+ <bean class="org.jboss.cache.config.CacheLoaderConfig">
+ <!-- Do not change these -->
+ <property name="passivation">true</property>
+ <property name="shared">false</property>
+
+ <property name="individualCacheLoaderConfigs">
+ <list>
+ <bean
class="org.jboss.cache.loader.FileCacheLoaderConfig">
+ <!-- Where passivated sessions are stored -->
+ <property
name="location">${jboss.server.data.dir}${/}session</property>
+ <!-- Do not change these -->
+ <property name="async">false</property>
+ <property
name="fetchPersistentState">true</property>
+ <property
name="purgeOnStartup">true</property>
+ <property
name="ignoreModifications">false</property>
+ <property
name="checkCharacterPortability">false</property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Appropriate for web sessions with FIELD granularity -->
+ <entry><key>field-granularity-session-cache</key>
+ <value>
+
+ <bean name="FieldSessionCacheConfig"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Provides batching functionality for caches that don't want to
interact with regular JTA Transactions -->
+ <property
name="transactionManagerLookupClass">org.jboss.cache.transaction.BatchModeTransactionManagerLookup</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-FieldSessionCache</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because we are using asynchronous replication. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="fetchInMemoryState">true</property>
+
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+ <property name="cacheMode">REPL_ASYNC</property>
+
+ <property name="syncReplTimeout">17500</property>
+ <property name="lockAcquisitionTimeout">15000</property>
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Field granularity requires region-based marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property
name="exposeManagementStatistics">true</property>
+
+ <property name="buddyReplicationConfig">
+ <bean class="org.jboss.cache.config.BuddyReplicationConfig">
+
+ <!-- Just set to true to turn on buddy replication -->
+ <property name="enabled">false</property>
+ <!-- A way to specify a preferred replication group. We try
+ and pick a buddy who shares the same pool name (falling
+ back to other buddies if not available). -->
+ <property name="buddyPoolName">default</property>
+ <property
name="buddyCommunicationTimeout">17500</property>
+
+ <!-- Do not change these -->
+ <property
name="autoDataGravitation">false</property>
+ <property
name="dataGravitationRemoveOnFind">true</property>
+ <property
name="dataGravitationSearchBackupTrees">true</property>
+
+ <property name="buddyLocatorConfig">
+ <bean
class="org.jboss.cache.buddyreplication.NextMemberBuddyLocatorConfig">
+ <!-- The number of backup nodes we maintain -->
+ <property name="numBuddies">1</property>
+ <!-- Means that each node will *try* to select a buddy on
+ a different physical host. If not able to do so
+ though, it will fall back to colocated nodes. -->
+ <property
name="ignoreColocatedBuddies">true</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="cacheLoaderConfig">
+ <bean class="org.jboss.cache.config.CacheLoaderConfig">
+ <!-- Do not change these -->
+ <property name="passivation">true</property>
+ <property name="shared">false</property>
+
+ <property name="individualCacheLoaderConfigs">
+ <list>
+ <bean
class="org.jboss.cache.loader.FileCacheLoaderConfig">
+ <!-- Where passivated sessions are stored -->
+ <property
name="location">${jboss.server.data.dir}${/}field-session</property>
+ <!-- Do not change these -->
+ <property name="async">false</property>
+ <property
name="fetchPersistentState">true</property>
+ <property
name="purgeOnStartup">true</property>
+ <property
name="ignoreModifications">false</property>
+ <property
name="checkCharacterPortability">false</property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Standard cache used for EJB3 SFSB caching -->
+ <entry><key>sfsb-cache</key>
+ <value>
+ <bean name="StandardSFSBCacheConfig"
class="org.jboss.cache.config.Configuration">
+
+ <!-- No transaction manager lookup -->
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-SFSBCache</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because we are using asynchronous replication. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="fetchInMemoryState">true</property>
+
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+ <property name="cacheMode">REPL_ASYNC</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. Make this longer
+ than lockAcquisitionTimeout.-->
+ <property name="syncReplTimeout">17500</property>
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!--
+ SFSBs use region-based marshalling to provide for partial state
+ transfer during deployment/undeployment.
+ -->
+ <property
name="useRegionBasedMarshalling">false</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">false</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property
name="exposeManagementStatistics">true</property>
+
+ <property name="buddyReplicationConfig">
+ <bean class="org.jboss.cache.config.BuddyReplicationConfig">
+
+ <!-- Just set to true to turn on buddy replication -->
+ <property name="enabled">false</property>
+
+ <!-- A way to specify a preferred replication group. We try
+ and pick a buddy who shares the same pool name (falling
+ back to other buddies if not available). -->
+ <property name="buddyPoolName">default</property>
+
+ <property
name="buddyCommunicationTimeout">17500</property>
+
+ <!-- Do not change these -->
+ <property
name="autoDataGravitation">false</property>
+ <property
name="dataGravitationRemoveOnFind">true</property>
+ <property
name="dataGravitationSearchBackupTrees">true</property>
+
+ <property name="buddyLocatorConfig">
+ <bean
class="org.jboss.cache.buddyreplication.NextMemberBuddyLocatorConfig">
+ <!-- The number of backup nodes we maintain -->
+ <property name="numBuddies">1</property>
+ <!-- Means that each node will *try* to select a buddy on
+ a different physical host. If not able to do so
+ though, it will fall back to colocated nodes. -->
+ <property
name="ignoreColocatedBuddies">true</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="cacheLoaderConfig">
+ <bean class="org.jboss.cache.config.CacheLoaderConfig">
+ <!-- Do not change these -->
+ <property name="passivation">true</property>
+ <property name="shared">false</property>
+
+ <property name="individualCacheLoaderConfigs">
+ <list>
+ <bean
class="org.jboss.cache.loader.FileCacheLoaderConfig">
+ <!-- Where passivated sessions are stored -->
+ <property
name="location">${jboss.server.data.dir}${/}sfsb</property>
+ <!-- Do not change these -->
+ <property name="async">false</property>
+ <property
name="fetchPersistentState">true</property>
+ <property
name="purgeOnStartup">true</property>
+ <property
name="ignoreModifications">false</property>
+ <property
name="checkCharacterPortability">false</property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+
+ <!-- EJBs use JBoss Cache eviction -->
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </property>
+ <!-- EJB3 integration code will programatically create
+ other regions as beans are deployed -->
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!--
+ Appropriate for the HAPartition-based services, e.g. DistributedState,
+ HA-JNDI. Also valid for use by the JBossWeb ClusteredSingleSignOn valve.
+ -->
+ <entry><key>ha-partition</key>
+ <value>
+
+ <bean name="HAPartitionCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Provides batching functionality for caches that don't want to
interact with regular JTA Transactions -->
+ <property
name="transactionManagerLookupClass">org.jboss.cache.transaction.BatchModeTransactionManagerLookup</property>
+
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-HAPartitionCache</property>
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="fetchInMemoryState">true</property>
+
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+ <property name="cacheModeString">REPL_SYNC</property>
+
+ <property name="syncReplTimeout">17500</property>
+ <property name="lockAcquisitionTimeout">15000</property>
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <property
name="useRegionBasedMarshalling">false</property>
+ <property name="inactiveOnStartup">false</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property
name="exposeManagementStatistics">true</property>
+ </bean>
+ </value>
+ </entry>
+
+ <!--
+ Following are JBoss Cache configurations suitable for different
+ Hibernate 2nd Level Cache uses (e.g. entities vs. queries).
+
+ In all cases, TransactionManager configuration not required.
+ Hibernate will plug in its own transaction manager integration.
+ -->
+
+ <!-- A config appropriate for entity/collection caching that uses MVCC locking
-->
+ <entry><key>mvcc-entity</key>
+ <value>
+ <bean name="MVCCEntityCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">MVCC</property>
+ <!-- READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases. -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Mode of communication with peer caches.
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches. -->
+ <property name="cacheMode">INVALIDATION_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-mvcc-entity</property>
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for entity/collection caching that uses optimistic
locking. -->
+ <entry><key>optimistic-entity</key>
+ <value>
+ <bean name="OptimisticEntityCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">OPTIMISTIC</property>
+
+ <!-- Mode of communication with peer caches.
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches. -->
+ <property name="cacheMode">INVALIDATION_SYNC</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-opt-entity</property>
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for entity/collection caching that uses pessimistic
locking -->
+ <entry><key>pessimistic-entity</key>
+ <value>
+ <bean name="PessimisticEntityCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <!-- READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases. -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Mode of communication with peer caches.
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches. -->
+ <property name="cacheMode">INVALIDATION_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-pess-entity</property>
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Same as "mvcc-entity" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. REPEATABLE_READ is only useful if the
+ application evicts/clears entities from the Hibernate Session and
+ then expects to repeatably re-read them in the same transaction.
+ Otherwise, the Session's internal cache provides a repeatable-read
+ semantic. Before choosing this config, carefully read the docs
+ and make sure you really need REPEATABLE_READ. -->
+ <entry><key>mvcc-entity-repeatable</key>
+ <value>
+ <bean name="MVCCEntityRepeatableCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">MVCC</property>
+ <!-- Here we use REPEATABLE_READ. -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Mode of communication with peer caches.
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches. -->
+ <property name="cacheMode">INVALIDATION_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-mvcc-entity-rr</property>
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Same as "pessimistic-entity" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. REPEATABLE_READ is only useful if the
+ application evicts/clears entities from the Hibernate Session and
+ then expects to repeatably re-read them in the same transaction.
+ Otherwise, the Session's internal cache provides a repeatable-read
+ semantic. Before choosing this config, carefully read the docs
+ and make sure you really need REPEATABLE_READ.
+ -->
+ <entry><key>pessimistic-entity-repeatable</key>
+ <value>
+ <bean name="PessimisticEntityRepeatableCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Mode of communication with peer caches.
+ INVALIDATION_SYNC is highly recommended as the mode for use
+ with entity and collection caches. -->
+ <property name="cacheMode">INVALIDATION_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-pess-entity-rr</property>
+ <!-- Use a UDP (multicast) based stack. A udp-sync stack might be
+ slightly better (no JGroups FC) but we stick with udp to
+ help ensure this cache and others like timestamps-cache
+ that require FC can use the same underlying JGroups resources. -->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for query caching. Does not replicate
+ queries. DO NOT STORE TIMESTAMPS IN THIS CACHE. -->
+ <entry><key>local-query</key>
+ <value>
+ <bean name="LocalQueryCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">OPTIMISTIC</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- LOCAL means don't communicate with other caches. -->
+ <property name="cacheMode">LOCAL</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A query cache that replicates querie results. Replication is asynchronous.
+ DO NOT STORE TIMESTAMPS IN THIS CACHE as no initial state transfer
+ is performed. -->
+ <entry><key>replicated-query</key>
+ <value>
+ <bean name="ReplicatedQueryCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">OPTIMISTIC</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Mode of communication with peer caches.
+ REPL_ASYNC means replicate but sender does not block waiting for
+ peers to acknowledge applying the change. Valid for queries as
+ the timestamp cache mechanism will allow Hibernate to discard
+ out-of-date queries. -->
+ <property name="cacheMode">REPL_ASYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-query</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Whether or not to fetch state on joining a cluster. -->
+ <property name="fetchInMemoryState">false</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Optimized for timestamp caching. A clustered timestamp cache
+ is required if query caching is used, even if the query cache
+ itself is configured with CacheMode=LOCAL.
+ -->
+ <entry><key>timestamps-cache</key>
+ <value>
+ <bean name="TimestampsCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">MVCC</property>
+ <!-- READ_COMMITTED is as strong as necessary -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Cannot be INVALIDATION. ASYNC for improved performance. -->
+ <property name="cacheMode">REPL_ASYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-timestamps</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <!-- We should never evict timestamps, so eviction is disabled -->
+
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for a cache that's shared for
+ entity, collection, query and timestamp caching. Not an advised
+ configuration, since it requires cache mode REPL_SYNC, which is the
+ least efficient mode. Also requires a full state transfer at startup,
+ which can be expensive. Uses mvcc locking. -->
+ <entry><key>mvcc-shared</key>
+ <value>
+ <bean name="MVCCSharedCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">MVCC</property>
+ <!-- READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases. -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities. -->
+ <property name="cacheMode">REPL_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-mvcc-shared</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for a cache that's shared for
+ entity, collection, query and timestamp caching. Not an advised
+ configuration, since it requires cache mode REPL_SYNC, which is the
+ least efficient mode. Also requires a full state transfer at startup,
+ which can be expensive. Uses optimistic locking -->
+ <entry><key>optimistic-shared</key>
+ <value>
+ <bean name="OptimisticSharedCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">OPTIMISTIC</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities. -->
+ <property name="cacheMode">REPL_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-opt-shared</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- A config appropriate for a cache that's shared for
+ entity, collection, query and timestamp caching. Not an advised
+ configuration, since it requires cache mode REPL_SYNC, which is the
+ least efficient mode. Also requires a full state transfer at startup,
+ which can be expensive. Uses pessmistic locking. -->
+ <entry><key>pessimistic-shared</key>
+ <value>
+ <bean name="PessimisticSharedCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <!-- READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases. -->
+ <property name="isolationLevel">READ_COMMITTED</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities. -->
+ <property name="cacheMode">REPL_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-pess-shared</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Same as "mvcc-shared" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. REPEATABLE_READ is only useful if the
+ application evicts/clears entities from the Hibernate Session and
+ then expects to repeatably re-read them in the same transaction.
+ Otherwise, the Session's internal cache provides a repeatable-read
+ semantic. Before choosing this config, carefully read the docs
+ and make sure you really need REPEATABLE_READ. -->
+ <entry><key>mvcc-shared-repeatable</key>
+ <value>
+ <bean name="MVCCSharedRepeatableCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">MVCC</property>
+ <!-- READ_COMMITTED is as strong as necessary for most
+ 2nd Level Cache use cases. -->
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities. -->
+ <property name="cacheMode">REPL_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-mvcc-shared-rr</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- Same as "pessimistic-shared" but here we use REPEATABLE_READ
+ instead of READ_COMMITTED. REPEATABLE_READ is only useful if the
+ application evicts/clears entities from the Hibernate Session and
+ then expects to repeatably re-read them in the same transaction.
+ Otherwise, the Session's internal cache provides a repeatable-read
+ semantic. Before choosing this config, carefully read the docs
+ and make sure you really need REPEATABLE_READ. -->
+ <entry><key>pessimistic-shared-repeatable</key>
+ <value>
+ <bean name="PessimisticSharedRepeatableCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Node locking scheme -->
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+
+ <!-- Must use REPL since used for timestamp caching.
+ Must use SYNC to maintain cache coherency for entities. -->
+ <property name="cacheMode">REPL_SYNC</property>
+
+ <!-- Name of cluster. Needs to be the same for all members -->
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-pess-shared-rr</property>
+ <!-- Use a UDP (multicast) based stack. Need JGroups flow control (FC)
+ because timestamp communication will not require a synchronous response.
-->
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <!-- Used for timestamps, so must fetch state. -->
+ <property name="fetchInMemoryState">true</property>
+
+ <!-- The max amount of time (in milliseconds) we wait until the
+ state (ie. the contents of the cache) are retrieved from
+ existing members at startup. Ignored if FetchInMemoryState=false. -->
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <!-- Number of milliseconds to wait until all responses for a
+ synchronous call have been received. -->
+ <property name="syncReplTimeout">17500</property>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <property name="lockAcquisitionTimeout">15000</property>
+
+ <!-- Hibernate 2LC can replicate custom types, so we use marshalling -->
+ <property
name="useRegionBasedMarshalling">true</property>
+ <!-- Must match the value of "useRegionBasedMarshalling" -->
+ <property name="inactiveOnStartup">true</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property name="evictionConfig">
+ <bean class="org.jboss.cache.config.EvictionConfig">
+ <property name="wakeupInterval">5000</property>
+ <!-- Overall default -->
+ <property name="defaultEvictionRegionConfig">
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.LRUAlgorithmConfig">
+ <!-- Evict LRU node once we have more than this number of
nodes -->
+ <property
name="maxNodes">10000</property>
+ <!-- And, evict any node that hasn't been accessed in
this many seconds -->
+ <property
name="timeToLiveSeconds">1000</property>
+ <!-- Don't evict a node that's been accessed within
this many seconds.
+ Set this to a value greater than your max expected
transaction length. -->
+ <property
name="minTimeToLiveSeconds">120</property>
+ </bean>
+ </property>
+ </bean>
+ </property>
+ <property name="evictionRegionConfigs">
+ <list>
+ <!-- Don't ever evict modification timestamps -->
+ <bean
class="org.jboss.cache.config.EvictionRegionConfig">
+ <property name="regionName">/TS</property>
+ <property name="evictionAlgorithmConfig">
+ <bean
class="org.jboss.cache.eviction.NullEvictionAlgorithmConfig"/>
+ </property>
+ </bean>
+ </list>
+ </property>
+ </bean>
+ </property>
+ </bean>
+ </value>
+ </entry>
+
+ <!-- RiftSaw ODE cache-->
+ <entry><key>riftsaw-cache</key>
+ <value>
+
+ <bean name="RiftSawCache"
class="org.jboss.cache.config.Configuration">
+
+ <!-- Provides batching functionality for caches that don't want to
interact with regular JTA Transactions -->
+ <property
name="transactionManagerLookupClass">org.jboss.cache.transaction.BatchModeTransactionManagerLookup</property>
+
+ <property
name="clusterName">${jboss.partition.name:DefaultPartition}-RiftsawCache</property>
+ <property
name="multiplexerStack">${jboss.default.jgroups.stack:udp}</property>
+ <property name="fetchInMemoryState">true</property>
+
+ <property name="nodeLockingScheme">PESSIMISTIC</property>
+ <property
name="isolationLevel">REPEATABLE_READ</property>
+ <property name="useLockStriping">false</property>
+ <property name="cacheModeString">REPL_SYNC</property>
+
+ <property name="syncReplTimeout">17500</property>
+ <property name="lockAcquisitionTimeout">15000</property>
+ <property name="stateRetrievalTimeout">60000</property>
+
+ <property
name="useRegionBasedMarshalling">false</property>
+ <property name="inactiveOnStartup">false</property>
+
+ <!-- Disable asynchronous RPC marshalling/sending -->
+ <property
name="serializationExecutorPoolSize">0</property>
+ <!-- We have no asynchronous notification listeners -->
+ <property name="listenerAsyncPoolSize">0</property>
+
+ <property
name="exposeManagementStatistics">true</property>
+ </bean>
+ </value>
+ </entry>
+
+ </map>
+ </property>
+ </bean>
+
+</deployment>
\ No newline at end of file
Modified:
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java 2010-11-05
04:12:41 UTC (rev 1082)
+++
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java 2010-11-05
08:14:46 UTC (rev 1083)
@@ -28,6 +28,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.compiler.api.CompilationException;
+import org.apache.ode.bpel.iapi.CacheProvider;
import org.apache.ode.bpel.iapi.ContextException;
import org.apache.ode.bpel.iapi.EndpointReferenceContext;
import org.apache.ode.bpel.iapi.ProcessState;
@@ -44,8 +45,9 @@
private static final Log __log = LogFactory.getLog(RiftSawProcessStore.class);
private DeployScheduler m_deployScheduler=new DeployScheduler();
- public RiftSawProcessStore(EndpointReferenceContext eprContext, TransactionManager txm,
ConfStoreDAOConnectionFactory cf) {
- super(eprContext, txm, cf);
+ public RiftSawProcessStore(EndpointReferenceContext eprContext, TransactionManager txm,
+ ConfStoreDAOConnectionFactory cf, CacheProvider cacheProvider) {
+ super(eprContext, txm, cf, cacheProvider);
}
public void loadAll() {
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-05
04:12:41 UTC (rev 1082)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/bpel/runtime/engine/ode/BPELEngineImpl.java 2010-11-05
08:14:46 UTC (rev 1083)
@@ -31,6 +31,7 @@
import org.apache.ode.dao.bpel.BpelDAOConnectionFactory;
import org.apache.ode.dao.scheduler.SchedulerDAOConnectionFactory;
import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
+import org.apache.ode.il.cache.CacheProviderFactory;
import org.apache.ode.il.config.OdeConfigProperties;
import org.apache.ode.il.dbutil.Database;
import org.apache.ode.scheduler.simple.SimpleScheduler;
@@ -74,6 +75,7 @@
protected Database _db;
protected ExecutorService _executorService;
protected CronScheduler _cronScheduler;
+ protected CacheProvider _cacheProvider;
/**
* The default constructor.
@@ -293,6 +295,7 @@
__log.debug("Starting DAO.");
initDAO();
EndpointReferenceContextImpl eprContext = new EndpointReferenceContextImpl(this);
+ initCacheProvider();
__log.debug("Initializing BPEL process store.");
initProcessStore(eprContext);
__log.debug("Initializing BPEL server.");
@@ -320,7 +323,17 @@
}
- public void close() throws Exception {
+ private void initCacheProvider() {
+ _cacheProvider = CacheProviderFactory.getCacheProvider(_odeConfig);
+ try {
+ _cacheProvider.start();
+ } catch (Exception e) {
+ __log.error("Error in starting cache provider");
+ throw new RuntimeException("Error in initCacheProvider.", e);
+ }
+ }
+
+public void close() throws Exception {
ClassLoader old = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
@@ -333,6 +346,8 @@
} catch (Throwable ex) {
__log.debug("Error stopping services.", ex);
}
+
+ _cacheProvider.stop();
if( _cronScheduler != null ) {
try {
@@ -464,7 +479,7 @@
}
protected ProcessStoreImpl createProcessStore(EndpointReferenceContext eprContext,
TransactionManager txm, ConfStoreDAOConnectionFactory cf) {
- return new RiftSawProcessStore(eprContext, txm, cf);
+ return new RiftSawProcessStore(eprContext, txm, cf, _cacheProvider);
}
protected Scheduler createScheduler() {