[jbosscache-commits] JBoss Cache SVN: r7281 - in core/branches/flat/src: main/docbook/userguide/en/modules and 26 other directories.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Thu Dec 11 09:44:13 EST 2008
Author: manik.surtani at jboss.com
Date: 2008-12-11 09:44:12 -0500 (Thu, 11 Dec 2008)
New Revision: 7281
Added:
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/BatchModeTransactionManager.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyBaseTransactionManager.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransaction.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManager.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyUserTransaction.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/GenericTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossStandaloneJTAManagerLookup.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/starobrno/transaction/TransactionManagerLookup.java
Removed:
core/branches/flat/src/main/java/org/jboss/cache/transaction/BatchModeTransactionManager.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContext.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContextFactory.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManager.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/GlobalTransaction.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossStandaloneJTAManagerLookup.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossTransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionManagerLookup.java
core/branches/flat/src/main/java/org/jboss/cache/util/Caches.java
Modified:
core/branches/flat/src/main/docbook/faq/en/master.xml
core/branches/flat/src/main/docbook/userguide/en/modules/configuration.xml
core/branches/flat/src/main/docbook/userguide/en/modules/configuration_reference.xml
core/branches/flat/src/main/java/org/jboss/cache/AbstractNode.java
core/branches/flat/src/main/java/org/jboss/cache/CacheSPI_Legacy.java
core/branches/flat/src/main/java/org/jboss/cache/InternalNode.java
core/branches/flat/src/main/java/org/jboss/cache/InvocationContext.java
core/branches/flat/src/main/java/org/jboss/cache/NodeSPI.java
core/branches/flat/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactory.java
core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java
core/branches/flat/src/main/java/org/jboss/cache/commands/WriteCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutForExternalReadCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor_Legacy.java
core/branches/flat/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java
core/branches/flat/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/branches/flat/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
core/branches/flat/src/main/java/org/jboss/cache/lock/LockUtil.java
core/branches/flat/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java
core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionTable.java
core/branches/flat/src/main/java/org/jboss/starobrno/factories/TransactionManagerFactory.java
core/branches/flat/src/main/resources/config-samples/all.xml
core/branches/flat/src/main/resources/config-samples/buddy-replication.xml
core/branches/flat/src/main/resources/config-samples/cacheloader-enabled.xml
core/branches/flat/src/main/resources/config-samples/eviction-enabled.xml
core/branches/flat/src/main/resources/config-samples/external-jgroups-file.xml
core/branches/flat/src/main/resources/config-samples/invalidation-async.xml
core/branches/flat/src/main/resources/config-samples/local.xml
core/branches/flat/src/main/resources/config-samples/multiplexer-enabled.xml
core/branches/flat/src/main/resources/config-samples/total-replication.xml
core/branches/flat/src/test/java/org/jboss/starobrno/api/CacheAPITest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/batch/BatchWithTM.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/LockTestBase.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/PutForExternalReadTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/repeatable_read/WriteSkewTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeAPITest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeReplicatedMoveTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/SyncReplTxTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/TreeCacheAPITest.java
core/branches/flat/src/test/java/org/jboss/starobrno/atomic/APITest.java
core/branches/flat/src/test/java/org/jboss/starobrno/eviction/FIFOPolicyTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/notifications/CacheListenerTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/profiling/TreeProfileTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/replication/AsyncReplTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/replication/ExceptionTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/replication/ReplicationExceptionTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/replication/SyncCacheListenerTest.java
core/branches/flat/src/test/java/org/jboss/starobrno/tx/LocalModeTxTest.java
core/branches/flat/src/test/resources/configs/buddy-replication-cache.xml
core/branches/flat/src/test/resources/configs/clonable-config.xml
core/branches/flat/src/test/resources/configs/local-lru-eviction.xml
core/branches/flat/src/test/resources/configs/local-passivation.xml
core/branches/flat/src/test/resources/configs/local-tx.xml
core/branches/flat/src/test/resources/configs/mixedPolicy-eviction.xml
core/branches/flat/src/test/resources/configs/mux.xml
core/branches/flat/src/test/resources/configs/mvcc-repl-sync-br.xml
core/branches/flat/src/test/resources/configs/parser-test-async.xml
core/branches/flat/src/test/resources/configs/parser-test.xml
core/branches/flat/src/test/resources/configs/policyPerRegion-eviction.xml
core/branches/flat/src/test/resources/configs/replSync.xml
core/branches/flat/src/test/resources/jbc3-registry-configs.xml
core/branches/flat/src/test/resources/unit-test-cache-service.xml
Log:
Moved transaction stuff to Starobrno
Modified: core/branches/flat/src/main/docbook/faq/en/master.xml
===================================================================
--- core/branches/flat/src/main/docbook/faq/en/master.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/docbook/faq/en/master.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,352 +1,369 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "../../../../docbook-support/support/docbook-dtd/docbookx.dtd"
- >
+ "../../../../docbook-support/support/docbook-dtd/docbookx.dtd"
+ >
<book lang="en">
- <bookinfo>
- <title>Frequently Asked Questions about JBoss Cache</title>
- <!-- Release version and date -->
- <releaseinfo>Release 3.0.0 Naga</releaseinfo>
- <pubdate>October 2008</pubdate>
+ <bookinfo>
+ <title>Frequently Asked Questions about JBoss Cache</title>
+ <!-- Release version and date -->
+ <releaseinfo>Release 3.0.0 Naga</releaseinfo>
+ <pubdate>October 2008</pubdate>
- <author>
- <firstname>Manik</firstname>
- <surname>Surtani</surname>
- <email>manik at jboss.org</email>
- </author>
+ <author>
+ <firstname>Manik</firstname>
+ <surname>Surtani</surname>
+ <email>manik at jboss.org</email>
+ </author>
- <author>
- <firstname>Ben</firstname>
- <surname>Wang</surname>
- <email>ben.wang at jboss.com</email>
- </author>
+ <author>
+ <firstname>Ben</firstname>
+ <surname>Wang</surname>
+ <email>ben.wang at jboss.com</email>
+ </author>
- <author>
- <firstname>Bela</firstname>
- <surname>Ban</surname>
- <email>bela at jboss.com</email>
- </author>
+ <author>
+ <firstname>Bela</firstname>
+ <surname>Ban</surname>
+ <email>bela at jboss.com</email>
+ </author>
- <author>
- <firstname>Scott</firstname>
- <surname>Marlow</surname>
- <email>smarlow at novell.com</email>
- </author>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Marlow</surname>
+ <email>smarlow at novell.com</email>
+ </author>
- <author>
- <firstname>Galder</firstname>
- <surname>Zamarreño</surname>
- <email>galder.zamarreno at jboss.com</email>
- </author>
+ <author>
+ <firstname>Galder</firstname>
+ <surname>Zamarreño</surname>
+ <email>galder.zamarreno at jboss.com</email>
+ </author>
- <abstract>
- <para>This is a compilation of the most frequently asked
- questions about JBoss Cache. Please report any bugs,
- inconsistencies, or omissions you find in this FAQ on the
- <ulink url="http://jboss.org/index.html?module=bb&op=main&c=29">JBoss Cache User Form
- </ulink>
- .
- </para>
- <para>
- This FAQ is divided into specific sections, all pertaining to the core JBoss Cache library. PojoCache has a
- separate FAQ
- document pertaining to PojoCache specifics.
- </para>
- </abstract>
+ <abstract>
+ <para>This is a compilation of the most frequently asked
+ questions about JBoss Cache. Please report any bugs,
+ inconsistencies, or omissions you find in this FAQ on the
+ <ulink url="http://jboss.org/index.html?module=bb&op=main&c=29">JBoss Cache User Form
+ </ulink>
+ .
+ </para>
+ <para>
+ This FAQ is divided into specific sections, all pertaining to the core JBoss Cache library. PojoCache
+ has a
+ separate FAQ
+ document pertaining to PojoCache specifics.
+ </para>
+ </abstract>
- <!-- copyright info -->
- <copyright>
- <year>2005</year>
- <year>2006</year>
- <year>2007</year>
- <year>2008</year>
- <holder>JBoss, a division of Red Hat Inc.</holder>
- </copyright>
- </bookinfo>
+ <!-- copyright info -->
+ <copyright>
+ <year>2005</year>
+ <year>2006</year>
+ <year>2007</year>
+ <year>2008</year>
+ <holder>JBoss, a division of Red Hat Inc.</holder>
+ </copyright>
+ </bookinfo>
- <chapter id="general">
- <title>General Information</title>
- <qandaset>
+ <chapter id="general">
+ <title>General Information</title>
+ <qandaset>
- <qandaentry>
- <question>
- <para>What is JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What is JBoss Cache?</para>
+ </question>
- <answer>
- <para>JBoss Cache is a replicated and transactional cache. It is
- replicated since multiple JBoss Cache instances can be distributed
- (either within the same JVM or across several JVMs whether they reside on
- the same machine or on different machines on a network) and data is
- replicated across the whole group. It is transactional because a
- user can configure a
- <ulink url="http://java.sun.com/products/jta/">JTA</ulink>
- compliant transaction
- manager and make any cache
- interaction transactional. Note that the cache can also be run without
- any replication; this is the local mode.
- </para>
+ <answer>
+ <para>JBoss Cache is a replicated and transactional cache. It is
+ replicated since multiple JBoss Cache instances can be distributed
+ (either within the same JVM or across several JVMs whether they reside on
+ the same machine or on different machines on a network) and data is
+ replicated across the whole group. It is transactional because a
+ user can configure a
+ <ulink url="http://java.sun.com/products/jta/">JTA</ulink>
+ compliant transaction
+ manager and make any cache
+ interaction transactional. Note that the cache can also be run without
+ any replication; this is the local mode.
+ </para>
- <para>JBoss Cache comes in two flavours: Core and Pojo versions. The core library
- (using the
- <literal>org.jboss.cache.Cache_Legacy</literal>
- interface
- ) is the underlying library that organises data in a tree-like structure and handles all locking,
- passivation,
- eviction and replication characteristics of data in the cache. The pojo library (using the
- <literal>org.jboss.cache.pojo.PojoCache</literal>
- interface) is built atop the core library and allows introspection
- of objects in the cache providing transparent coherence by using JBoss AOP. Note that the Pojo version
- of JBoss Cache
- (referred to as PojoCache) comes with a separate set of documentation (user guide, FAQ, etc.)
- available on the
- <ulink url="http://labs.jboss.com/portal/jbosscache/docs/index.html">JBoss Cache documentation site
- </ulink>
- .
- </para>
+ <para>JBoss Cache comes in two flavours: Core and Pojo versions. The core library
+ (using the
+ <literal>org.jboss.cache.Cache_Legacy</literal>
+ interface
+ ) is the underlying library that organises data in a tree-like structure and handles all
+ locking,
+ passivation,
+ eviction and replication characteristics of data in the cache. The pojo library (using the
+ <literal>org.jboss.cache.pojo.PojoCache</literal>
+ interface) is built atop the core library and allows introspection
+ of objects in the cache providing transparent coherence by using JBoss AOP. Note that the Pojo
+ version
+ of JBoss Cache
+ (referred to as PojoCache) comes with a separate set of documentation (user guide, FAQ, etc.)
+ available on the
+ <ulink url="http://labs.jboss.com/portal/jbosscache/docs/index.html">JBoss Cache documentation
+ site
+ </ulink>
+ .
+ </para>
- <para>
- JBoss Cache is made available in one of four different packages:
- <itemizedlist>
- <listitem>
- <para>
- <literal>jboss-cache-core</literal>
- </para>
- contains the core Cache library for users who do not wish to use the additional functionality
- offered by PojoCache.
- </listitem>
- <listitem>
- <para>
- <literal>jboss-cache-pojo</literal>
- </para>
- contains the core Cache library as well as the PojoCache extensions and dependencies.
- </listitem>
- <listitem>
- <para>
- <literal>jboss-cache-all</literal>
- </para>
- contains all of the above, including unit tests and source code.
- </listitem>
- <listitem>
- <para>
- <literal>jboss-cache-core-JDK140</literal>
- </para>
- contains a JDK 1.4 compatible version of the core Cache library. Note that PojoCache is only
- available for JDK 5.0.
- </listitem>
- </itemizedlist>
- </para>
- </answer>
- </qandaentry>
+ <para>
+ JBoss Cache is made available in one of four different packages:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>jboss-cache-core</literal>
+ </para>
+ contains the core Cache library for users who do not wish to use the additional
+ functionality
+ offered by PojoCache.
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-cache-pojo</literal>
+ </para>
+ contains the core Cache library as well as the PojoCache extensions and dependencies.
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-cache-all</literal>
+ </para>
+ contains all of the above, including unit tests and source code.
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-cache-core-JDK140</literal>
+ </para>
+ contains a JDK 1.4 compatible version of the core Cache library. Note that PojoCache is
+ only
+ available for JDK 5.0.
+ </listitem>
+ </itemizedlist>
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Who are the JBoss Cache developers?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Who are the JBoss Cache developers?</para>
+ </question>
- <answer>
- <para>
- JBoss Cache has an active community of developers and contributors. The project was founded by Bela
- Ban
- and is currently led by Manik Surtani. Jason Greene is the lead for the PojoCache subsystem, and other
- contributors both past and present include Ben Wang, Harald Gliebe, Brian Stansberry, Vladimir
- Blagojevic,
- Mircea Markus, Jimmy Wilson, Galder Zamarreño and Elias Ross.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ JBoss Cache has an active community of developers and contributors. The project was founded by
+ Bela
+ Ban
+ and is currently led by Manik Surtani. Jason Greene is the lead for the PojoCache subsystem, and
+ other
+ contributors both past and present include Ben Wang, Harald Gliebe, Brian Stansberry, Vladimir
+ Blagojevic,
+ Mircea Markus, Jimmy Wilson, Galder Zamarreño and Elias Ross.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>What is the license for JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What is the license for JBoss Cache?</para>
+ </question>
- <answer>
- <para>JBoss Cache is licensed under
- <ulink url="http://www.gnu.org/licenses/lgpl.html">LGPL</ulink>
- .
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>JBoss Cache is licensed under
+ <ulink url="http://www.gnu.org/licenses/lgpl.html">LGPL</ulink>
+ .
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Where can I download JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Where can I download JBoss Cache?</para>
+ </question>
- <answer>
- <para>The JBoss Cache
- <ulink url="http://www.jboss.com/products/jbosscache/downloads">product download page</ulink>
- has prebuilt binaries as well as source distributions. You can also grab snapshots from the JBoss CVS
- repository (see
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CVSRepository">this wiki page</ulink>
- ) - the module name is
- <emphasis role="bold">JBossCache</emphasis>
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>The JBoss Cache
+ <ulink url="http://www.jboss.com/products/jbosscache/downloads">product download page</ulink>
+ has prebuilt binaries as well as source distributions. You can also grab snapshots from the
+ JBoss CVS
+ repository (see
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=CVSRepository">this wiki page</ulink>
+ ) - the module name is
+ <emphasis role="bold">JBossCache</emphasis>
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I build JBoss Cache from CVS sources?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I build JBoss Cache from CVS sources?</para>
+ </question>
- <answer>
- <para>To build, do
- <literal>sh build.sh
- jar
- </literal>
- . This will produce
- <literal>jboss-cache.jar</literal>
- and
- <literal>pojocache.jar</literal>
- in the
- <literal>dist/lib</literal>
- directory. Note that you will need to
- use JDK 5 to build the distribution.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>To build, do
+ <literal>sh build.sh
+ jar
+ </literal>
+ . This will produce
+ <literal>jboss-cache.jar</literal>
+ and
+ <literal>pojocache.jar</literal>
+ in the
+ <literal>dist/lib</literal>
+ directory. Note that you will need to
+ use JDK 5 to build the distribution.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Which versions of the JDK are supported by JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Which versions of the JDK are supported by JBoss Cache?</para>
+ </question>
- <answer>
- <para>
- JBoss Cache is baselined on Java 5.0 and this is the platform on which JBoss Cache is most thoroughly
- tested.
- If, for whatever reason you have to use Java 1.4, you could build a retroweaved version of the core
- cache
- library that is Java 1.4 compatible, using the simple instructions on this wiki page
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHabaneroJava1.4">on building and
- running JBoss Cache on Java 1.4.
- </ulink>
- . Note that Red Hat Inc. does not offer commercial support for retroweaved binaries at this stage.
- </para>
- <para>
- Java 6 should work as well, and we haven't heard of any specific problems of JBoss Cache run under
- Java 6.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ JBoss Cache is baselined on Java 5.0 and this is the platform on which JBoss Cache is most
+ thoroughly
+ tested.
+ If, for whatever reason you have to use Java 1.4, you could build a retroweaved version of the
+ core
+ cache
+ library that is Java 1.4 compatible, using the simple instructions on this wiki page
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHabaneroJava1.4">on building and
+ running JBoss Cache on Java 1.4.
+ </ulink>
+ . Note that Red Hat Inc. does not offer commercial support for retroweaved binaries at this
+ stage.
+ </para>
+ <para>
+ Java 6 should work as well, and we haven't heard of any specific problems of JBoss Cache run
+ under
+ Java 6.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I know the version of JBoss Cache that I am using?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I know the version of JBoss Cache that I am using?</para>
+ </question>
- <answer>
- <para>
- <code>java -jar jbosscache.jar</code>
- will spit out version details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ <code>java -jar jbosscache.jar</code>
+ will spit out version details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I run JBoss Cache outside of JBoss Application
- Server?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I run JBoss Cache outside of JBoss Application
+ Server?
+ </para>
+ </question>
- <answer>
- <para>
- Of course! Even though JBoss Cache comes integrated with JBoss Application Server as an MBean service,
- it
- can also be run standalone, in any Java EE server such as BEA WebLogic, IBM Websphere or Tomcat. It
- can also run in
- a standalone Java process, completely outside of an application server. See the user guide for more
- details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ Of course! Even though JBoss Cache comes integrated with JBoss Application Server as an MBean
+ service,
+ it
+ can also be run standalone, in any Java EE server such as BEA WebLogic, IBM Websphere or Tomcat.
+ It
+ can also run in
+ a standalone Java process, completely outside of an application server. See the user guide for
+ more
+ details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How can I migrate my application and configuration from using JBoss Cache 1.x to 2.x?</para>
- </question>
- <answer>
- <para>Look at
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCache200Migration">this wiki page</ulink>
- for help.
- </para>
- </answer>
- </qandaentry>
+ <qandaentry>
+ <question>
+ <para>How can I migrate my application and configuration from using JBoss Cache 1.x to 2.x?</para>
+ </question>
+ <answer>
+ <para>Look at
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCache200Migration">this wiki page
+ </ulink>
+ for help.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Where can I report bugs or problems?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Where can I report bugs or problems?</para>
+ </question>
- <answer>
- <para>Please report any bugs or problems to
- <ulink
- url="http://jboss.org/index.html?module=bb&op=main&c=29">JBoss Cache
- User Forum
- </ulink>
- .
- </para>
- </answer>
- </qandaentry>
- </qandaset>
- </chapter>
+ <answer>
+ <para>Please report any bugs or problems to
+ <ulink
+ url="http://jboss.org/index.html?module=bb&op=main&c=29">JBoss Cache
+ User Forum
+ </ulink>
+ .
+ </para>
+ </answer>
+ </qandaentry>
+ </qandaset>
+ </chapter>
- <chapter id="TreeCache">
- <title>JBoss Cache - Core</title>
+ <chapter id="TreeCache">
+ <title>JBoss Cache - Core</title>
- <qandaset>
+ <qandaset>
- <qandaentry>
- <question>
- <para>How do I deploy JBoss Cache as a MBean service?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I deploy JBoss Cache as a MBean service?</para>
+ </question>
- <answer>
- <para>To deploy JBoss Cache as an MBean inside JBoss, you can copy the
- configuration xml file over to the
- <literal>deploy</literal>
- directory (from
- <literal>all</literal>
- configuration whereby the
- necessary jars are present). Under the standalone package
- <literal>etc/config-samples</literal>
- directory, there are example
- configuration files for different cache modes that can be used to
- deploy JBoss Cache as well.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>To deploy JBoss Cache as an MBean inside JBoss, you can copy the
+ configuration xml file over to the
+ <literal>deploy</literal>
+ directory (from
+ <literal>all</literal>
+ configuration whereby the
+ necessary jars are present). Under the standalone package
+ <literal>etc/config-samples</literal>
+ directory, there are example
+ configuration files for different cache modes that can be used to
+ deploy JBoss Cache as well.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I know if my JBoss Cache MBean has been deployed?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I know if my JBoss Cache MBean has been deployed?</para>
+ </question>
- <answer>
- <para>To verify that your JBoss Cache MBean is deployed correctly,
- you can first check the log output under the command console. Next
- you can verify it from JBoss JMX console. Look for
- <literal>jboss.cache</literal>
- domain.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>To verify that your JBoss Cache MBean is deployed correctly,
+ you can first check the log output under the command console. Next
+ you can verify it from JBoss JMX console. Look for
+ <literal>jboss.cache</literal>
+ domain.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I access the JBoss Cache MBean?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I access the JBoss Cache MBean?</para>
+ </question>
- <answer>
- <para>Accessing the JBoss Cache MBean is just like accessing any
- JBoss MBean. Here is a code snippet:
- </para>
+ <answer>
+ <para>Accessing the JBoss Cache MBean is just like accessing any
+ JBoss MBean. Here is a code snippet:
+ </para>
- <programlisting role="JAVA"><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.mx.util.MBeanProxyExt;
@@ -388,686 +405,698 @@
}
]]></programlisting>
- </answer>
- </qandaentry>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I run multiple JBoss Cache instances on the same VM?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I run multiple JBoss Cache instances on the same VM?</para>
+ </question>
- <answer>
- <para>Yes. There are some scenarios where you may want to run
- multiple instances of JBoss Cache. For example, you want to run
- multiple local cache instances with each instance having its own
- configuration (e.g., different cache policy). In this case, you will
- need multiple xml configuration files.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. There are some scenarios where you may want to run
+ multiple instances of JBoss Cache. For example, you want to run
+ multiple local cache instances with each instance having its own
+ configuration (e.g., different cache policy). In this case, you will
+ need multiple xml configuration files.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can JBoss Cache run as a second level cache inside
- Hibernate?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can JBoss Cache run as a second level cache inside
+ Hibernate?
+ </para>
+ </question>
- <answer>
- <para>Yes. Since Hibernate 3.0 release, you can configure it to use
- JBoss Cache as a second level cache. For details,
- see Hibernate documentation, and also see
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate">
- http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate
- </ulink>
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. Since Hibernate 3.0 release, you can configure it to use
+ JBoss Cache as a second level cache. For details,
+ see Hibernate documentation, and also see
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate">
+ http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheHibernate
+ </ulink>
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>What about using Pojo Cache as a Hibernate cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What about using Pojo Cache as a Hibernate cache?</para>
+ </question>
- <answer>
- <para>It is not necessary to use PojoCache for second level
- cache inside Hibernate because Hibernate
- manages fine-grained fields in Java objects. Using PojoCache won't
- provide any advantage.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>It is not necessary to use PojoCache for second level
+ cache inside Hibernate because Hibernate
+ manages fine-grained fields in Java objects. Using PojoCache won't
+ provide any advantage.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How can I configure JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How can I configure JBoss Cache?</para>
+ </question>
- <answer>
- <para>You can configure the JBoss Cache through a configuration xml
- file or programmatically using a
- <literal>org.jboss.cache.config.Configuration</literal>
- object, passed in to the
- <literal>org.jboss.cache.CacheFactory</literal>
- instance.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>You can configure the JBoss Cache through a configuration xml
+ file or programmatically using a
+ <literal>org.jboss.cache.config.Configuration</literal>
+ object, passed in to the
+ <literal>org.jboss.cache.CacheFactory</literal>
+ instance.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>In the configuration xml file, there are tags such as
- <literal>class</literal>
- ,
- <literal>MBean</literal>
- , etc. What are
- these?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>In the configuration xml file, there are tags such as
+ <literal>class</literal>
+ ,
+ <literal>MBean</literal>
+ , etc. What are
+ these?
+ </para>
+ </question>
- <answer>
- <para>These are tags for deploying JBoss Cache as a JBoss MBean
- service. For consistency, we have kept them in the
- standalone package as well, specifically, the
- <literal>MBean</literal>
- tag. If you run in standalone mode,
- JBoss Cache will ignore these elements.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>These are tags for deploying JBoss Cache as a JBoss MBean
+ service. For consistency, we have kept them in the
+ standalone package as well, specifically, the
+ <literal>MBean</literal>
+ tag. If you run in standalone mode,
+ JBoss Cache will ignore these elements.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>What is the difference between the different cache
- modes?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What is the difference between the different cache
+ modes?
+ </para>
+ </question>
- <answer>
- <para>JBossCache has five different cache modes, i.e.,
- <literal>LOCAL</literal>
- ,
- <literal>REPL_SYNC</literal>
- ,
- <literal>REPL_ASYNC</literal>
- ,
- <literal>INVALIDATION_SYNC</literal>
- and
- <literal>INVALIDATION_ASYNC</literal>
- . If you want to run JBoss Cache as a
- single instance, then you should set the cache mode to
- <literal>LOCAL</literal>
- so that it won't attempt to replicate anything.
- If you want to have synchronous replication among different
- JBoss Cache instances, you set it to
- <literal>REPL_SYNC</literal>
- .
- For asynchronous replication, use
- <literal>AYSNC_REPL</literal>
- . If you do not wish to replicate cached data but simply inform other caches in a cluster that data
- under
- specific addresses are now stale and should be evicted from memory, use
- <literal>INVALIDATION_SYNC</literal>
- or
- <literal>INVALIDTAION_ASYNC</literal>
- . Synchronous and asynchronous behavior applies to invalidation as well as replication.
- </para>
+ <answer>
+ <para>JBossCache has five different cache modes, i.e.,
+ <literal>LOCAL</literal>
+ ,
+ <literal>REPL_SYNC</literal>
+ ,
+ <literal>REPL_ASYNC</literal>
+ ,
+ <literal>INVALIDATION_SYNC</literal>
+ and
+ <literal>INVALIDATION_ASYNC</literal>
+ . If you want to run JBoss Cache as a
+ single instance, then you should set the cache mode to
+ <literal>LOCAL</literal>
+ so that it won't attempt to replicate anything.
+ If you want to have synchronous replication among different
+ JBoss Cache instances, you set it to
+ <literal>REPL_SYNC</literal>
+ .
+ For asynchronous replication, use
+ <literal>AYSNC_REPL</literal>
+ . If you do not wish to replicate cached data but simply inform other caches in a cluster that
+ data
+ under
+ specific addresses are now stale and should be evicted from memory, use
+ <literal>INVALIDATION_SYNC</literal>
+ or
+ <literal>INVALIDTAION_ASYNC</literal>
+ . Synchronous and asynchronous behavior applies to invalidation as well as replication.
+ </para>
- <para>Note that
- <literal>ASYNC_REPL</literal>
- and
- <literal>INVALIDATION_ASYNC</literal>
- are non-blocking. This
- can be useful when you want to have another JBoss Cache serving as a
- mirror or backup and you don't want to wait for confirmation that this mirror has received your
- messages.
- </para>
- </answer>
- </qandaentry>
+ <para>Note that
+ <literal>ASYNC_REPL</literal>
+ and
+ <literal>INVALIDATION_ASYNC</literal>
+ are non-blocking. This
+ can be useful when you want to have another JBoss Cache serving as a
+ mirror or backup and you don't want to wait for confirmation that this mirror has received your
+ messages.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How does JBoss Cache's replication mechanism work?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How does JBoss Cache's replication mechanism work?</para>
+ </question>
- <answer>
- <para>JBoss Cache leverages
- <ulink url="http://www.jgroups.org">JGroups</ulink>
- as a replication layer. A user
- can configure the cluster of JBoss Cache instances by sharing the
- same cluster name (
- <literal>cluster name</literal>
- ). There is also
- an option of whether to populate the cache data upon starting a new
- instance in the
- <literal>ClusterConfig</literal>
- attribute.
- </para>
+ <answer>
+ <para>JBoss Cache leverages
+ <ulink url="http://www.jgroups.org">JGroups</ulink>
+ as a replication layer. A user
+ can configure the cluster of JBoss Cache instances by sharing the
+ same cluster name (
+ <literal>cluster name</literal>
+ ). There is also
+ an option of whether to populate the cache data upon starting a new
+ instance in the
+ <literal>ClusterConfig</literal>
+ attribute.
+ </para>
- <para>Note that once all instances join the same replication group,
- every replication change is propagated to all participating members.
- There is no mechanism for sub-partitioning where some replication
- can be done within only a subset of members, unless you use the Buddy Replication features. See the
- user guide for more details on this.
- </para>
- </answer>
- </qandaentry>
+ <para>Note that once all instances join the same replication group,
+ every replication change is propagated to all participating members.
+ There is no mechanism for sub-partitioning where some replication
+ can be done within only a subset of members, unless you use the Buddy Replication features. See
+ the
+ user guide for more details on this.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>I run a 2 node cluster. If the network dies, do the caches continue to run?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>I run a 2 node cluster. If the network dies, do the caches continue to run?</para>
+ </question>
- <answer>
- <para>Yes, both will continue to run, but depending on your replication mode, all transactions or
- operations may not complete. If
- <literal>REPL_SYNC</literal>
- is used, operations will fail while if
- <literal>REPL_ASYNC</literal>
- is used they will succeed. Even if they succeed though, caches will be out of sync.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes, both will continue to run, but depending on your replication mode, all transactions or
+ operations may not complete. If
+ <literal>REPL_SYNC</literal>
+ is used, operations will fail while if
+ <literal>REPL_ASYNC</literal>
+ is used they will succeed. Even if they succeed though, caches will be out of sync.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I plug in library X instead of JGroups to handle remote calls and group communications?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I plug in library X instead of JGroups to handle remote calls and group communications?
+ </para>
+ </question>
- <answer>
- <para>At this stage the answer is no. We do have an abstraction layer between the
- communication suite and JBoss Cache in the pipelines, and this may appear as a feature at some stage
- in
- the future.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>At this stage the answer is no. We do have an abstraction layer between the
+ communication suite and JBoss Cache in the pipelines, and this may appear as a feature at some
+ stage
+ in
+ the future.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does the cache need to replicate to every other instance in the cluster? Isn't this slow if the
- cluster is large?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does the cache need to replicate to every other instance in the cluster? Isn't this slow if
+ the
+ cluster is large?
+ </para>
+ </question>
- <answer>
- <para>Replication need not occur to every node in the cluster. This feature -
- called Buddy Replication -
- allows each node to pick one or more 'buddies' in the cluster and only replicate to its buddies. This
- allows a cluster to scale
- very easily with no extra impact on memory or network traffic with each node added.
- </para>
- <para>
- See the User Guide for more information on Buddy Replication, and how it can be used to achieve very
- high
- scalability.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Replication need not occur to every node in the cluster. This feature -
+ called Buddy Replication -
+ allows each node to pick one or more 'buddies' in the cluster and only replicate to its buddies.
+ This
+ allows a cluster to scale
+ very easily with no extra impact on memory or network traffic with each node added.
+ </para>
+ <para>
+ See the User Guide for more information on Buddy Replication, and how it can be used to achieve
+ very
+ high
+ scalability.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>If I have the need for different configuration properties (e.g.,
- <literal>CacheMode</literal>
- and
- <literal>IsolationLevel</literal>
- ), do I simply need to create multiple
- <literal>org.jboss.cache.Cache_Legacy</literal>
- instances with the appropriate configuration?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>If I have the need for different configuration properties (e.g.,
+ <literal>CacheMode</literal>
+ and
+ <literal>IsolationLevel</literal>
+ ), do I simply need to create multiple
+ <literal>org.jboss.cache.Cache_Legacy</literal>
+ instances with the appropriate configuration?
+ </para>
+ </question>
- <answer>
- <para>Yes. All the above mentioned properties are per cache
- instance. Therefore you will need separate
- <literal>org.jboss.cache.Cache_Legacy</literal>
- instances.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. All the above mentioned properties are per cache
+ instance. Therefore you will need separate
+ <literal>org.jboss.cache.Cache_Legacy</literal>
+ instances.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Isn't this expensive from a networking standpoint, i.e., needing to create sockets for each
- <literal>org.jboss.cache.Cache_Legacy</literal>
- instance?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Isn't this expensive from a networking standpoint, i.e., needing to create sockets for each
+ <literal>org.jboss.cache.Cache_Legacy</literal>
+ instance?
+ </para>
+ </question>
- <answer>
- <para>
- Yes, it can be. For such cases it is recommended that you configure your cache using the JGroups
- Multiplexer, which allows several caches to share
- a single JGroups channel. Please see the User Guide for details on how to configure the JGroups
- Multiplexer.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ Yes, it can be. For such cases it is recommended that you configure your cache using the JGroups
+ Multiplexer, which allows several caches to share
+ a single JGroups channel. Please see the User Guide for details on how to configure the JGroups
+ Multiplexer.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does the
- <literal>ClusterName</literal>
- configuration element have
- any relation to the JBoss AS cluster
- <literal>PartitionName</literal>
- ?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does the
+ <literal>ClusterName</literal>
+ configuration element have
+ any relation to the JBoss AS cluster
+ <literal>PartitionName</literal>
+ ?
+ </para>
+ </question>
- <answer>
- <para>Yes. They are both JGroups group names. Besides the notion of
- a channel in JGroups, it also can partition the channel into different
- group names.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. They are both JGroups group names. Besides the notion of
+ a channel in JGroups, it also can partition the channel into different
+ group names.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>When using multiple JGroups based components
- [cluster-service.xml, cache (multiple instances)], what is the
- correct/valid way to configure those components to make sure my
- multicast addresses don't conflict?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>When using multiple JGroups based components
+ [cluster-service.xml, cache (multiple instances)], what is the
+ correct/valid way to configure those components to make sure my
+ multicast addresses don't conflict?
+ </para>
+ </question>
- <answer>
- <para>There are two parameters to consider: multicast address (plus
- port) and the group name. At minimum, you will have to run
- components using a different group name. But whether to run them on
- the same channel depends upon whether the communication performance
- is critical for you or not. If it is, then it'd be best to run them
- on different channels.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>There are two parameters to consider: multicast address (plus
+ port) and the group name. At minimum, you will have to run
+ components using a different group name. But whether to run them on
+ the same channel depends upon whether the communication performance
+ is critical for you or not. If it is, then it'd be best to run them
+ on different channels.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support cache persistence
- storage?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support cache persistence
+ storage?
+ </para>
+ </question>
- <answer>
- <para>Yes. JBoss Cache has a cache loader
- interface that supports cache persistence. See below for more FAQs on cache loaders.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. JBoss Cache has a cache loader
+ interface that supports cache persistence. See below for more FAQs on cache loaders.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support cache passivation/ overflow
- to a data store?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support cache passivation/ overflow
+ to a data store?
+ </para>
+ </question>
- <answer>
- <para>Yes. JBoss Cache uses the
- cache loader to support cache passivation/ overflow. See
- documentation on how to configure and use this feature.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. JBoss Cache uses the
+ cache loader to support cache passivation/ overflow. See
+ documentation on how to configure and use this feature.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Is JBoss Cache thread safe?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Is JBoss Cache thread safe?</para>
+ </question>
- <answer>
- <para>Yes, it is thread safe.</para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes, it is thread safe.</para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support XA (2PC) transactions now?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support XA (2PC) transactions now?</para>
+ </question>
- <answer>
- <para>No, although it is also on our to do list. Our internal
- implementation does use a procedure similar to 2PC to coordinate a
- transactions among different instances, but JBoss Cache is not an XA resource.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>No, although it is also on our to do list. Our internal
+ implementation does use a procedure similar to 2PC to coordinate a
+ transactions among different instances, but JBoss Cache is not an XA resource.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Which transaction managers are supported by
- JBoss Cache?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Which transaction managers are supported by
+ JBoss Cache?
+ </para>
+ </question>
- <answer>
- <para>JBoss Cache supports any TransactionManager that is
- <ulink url="http://java.sun.com/products/jta/">JTA</ulink>
- compliant such as JBossTM or JBossTS. JBoss Cache ships with a
- dummy transaction manager
- (
- <literal>org.jboss.cache.transaction.DummyTransactionManager</literal>
- ) for
- testing purposes only. But note that
- <literal>DummyTransactionManager</literal>
- is not thread safe .i.e.,
- it does not support concurrent transactions. Instead, only one
- transaction is allowed at a time.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>JBoss Cache supports any TransactionManager that is
+ <ulink url="http://java.sun.com/products/jta/">JTA</ulink>
+ compliant such as JBossTM or JBossTS. JBoss Cache ships with a
+ dummy transaction manager
+ (
+ <literal>org.jboss.starobrno.transaction.DummyTransactionManager</literal>
+ ) for
+ testing purposes only. But note that
+ <literal>DummyTransactionManager</literal>
+ is not thread safe .i.e.,
+ it does not support concurrent transactions. Instead, only one
+ transaction is allowed at a time.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I set up the cache to be transactional?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I set up the cache to be transactional?</para>
+ </question>
- <answer>
- <para>You either use the default transaction manager that ships with JBoss AS
- or you have to implement the
- <literal>org.jboss.cache.transaction.TransactionManagerLookup</literal>
- interface, and return an
- instance of your
- <literal>javax.transaction.TransactionManager</literal>
- implementation. The
- configuration property
- <literal>TransactionManagerLookupClass</literal>
- defines the class
- to be used by the cache to fetch a reference to a
- transaction manager. It is trivial to implement this interface to support
- other transaction managers. Once this attribute is specified, the
- cache will look up the transaction context from this transaction
- manager.
- </para>
+ <answer>
+ <para>You either use the default transaction manager that ships with JBoss AS
+ or you have to implement the
+ <literal>org.jboss.starobrno.transaction.TransactionManagerLookup</literal>
+ interface, and return an
+ instance of your
+ <literal>javax.transaction.TransactionManager</literal>
+ implementation. The
+ configuration property
+ <literal>TransactionManagerLookupClass</literal>
+ defines the class
+ to be used by the cache to fetch a reference to a
+ transaction manager. It is trivial to implement this interface to support
+ other transaction managers. Once this attribute is specified, the
+ cache will look up the transaction context from this transaction
+ manager.
+ </para>
- </answer>
- </qandaentry>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I control the cache locking level?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I control the cache locking level?</para>
+ </question>
- <answer>
- <para>JBoss Cache lets you control the cache locking level through
- the transaction isolation level. This is configured through the
- attribute
- <literal>IsolationLevel</literal>
- . The transaction
- isolation levels correspond to database
- isolation levels, namely,
- <literal>NONE</literal>
- ,
- <literal>READ_UNCOMMITTED</literal>
- ,
- <literal>READ_COMMITTED</literal>
- ,
- <literal>REPEATABLE_READ</literal>
- , and
- <literal>SERIALIZABLE</literal>
- . Note that these isolation levels are ignored if optimistic locking is used. For details, please
- refer
- to the
- user manual.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>JBoss Cache lets you control the cache locking level through
+ the transaction isolation level. This is configured through the
+ attribute
+ <literal>IsolationLevel</literal>
+ . The transaction
+ isolation levels correspond to database
+ isolation levels, namely,
+ <literal>NONE</literal>
+ ,
+ <literal>READ_UNCOMMITTED</literal>
+ ,
+ <literal>READ_COMMITTED</literal>
+ ,
+ <literal>REPEATABLE_READ</literal>
+ , and
+ <literal>SERIALIZABLE</literal>
+ . Note that these isolation levels are ignored if optimistic locking is used. For details,
+ please
+ refer
+ to the
+ user manual.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How does JBoss Cache lock data for concurrent access?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How does JBoss Cache lock data for concurrent access?</para>
+ </question>
- <answer>
- <para>By default JBoss Cache uses pessimistic locking to lock data nodes, based on the isolation level
- configured. We also offer optimistic locking to allow for greater concurrency
- at
- the cost of slight processing overhead and performance. See the documentation for a more detailed
- discussion on concurrency and locking in JBoss Cache.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>By default JBoss Cache uses pessimistic locking to lock data nodes, based on the isolation
+ level
+ configured. We also offer optimistic locking to allow for greater concurrency
+ at
+ the cost of slight processing overhead and performance. See the documentation for a more
+ detailed
+ discussion on concurrency and locking in JBoss Cache.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I enable Optimistic Locking in JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I enable Optimistic Locking in JBoss Cache?</para>
+ </question>
- <answer>
- <para>Use the XMl attribute
- <code>NodeLockingScheme</code>
- . Note that
- <code>IsolationLevel</code>
- is ignored if
- <code>NodeLockingScheme</code>
- is set to
- <code>OPTIMISTIC</code>
- . Also note that
- <code>NodeLockingScheme</code>
- defaults to
- <code>PESSIMISTIC</code>
- if omitted.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Use the XMl attribute
+ <code>NodeLockingScheme</code>
+ . Note that
+ <code>IsolationLevel</code>
+ is ignored if
+ <code>NodeLockingScheme</code>
+ is set to
+ <code>OPTIMISTIC</code>
+ . Also note that
+ <code>NodeLockingScheme</code>
+ defaults to
+ <code>PESSIMISTIC</code>
+ if omitted.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How does the write lock apply to an Fqn node, say,
- "/org/jboss/test"?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How does the write lock apply to an Fqn node, say,
+ "/org/jboss/test"?
+ </para>
+ </question>
- <answer>
- <para>First of all, JBoss Cache has a notion of
- <literal>root</literal>
- that serves as a starting point for every navigational operation.
- The default is "/" (since the default separator is "/" for the fqn).
- The locking then is applied to the node under root, for example
- "/org" (no locking "/").
- </para>
+ <answer>
+ <para>First of all, JBoss Cache has a notion of
+ <literal>root</literal>
+ that serves as a starting point for every navigational operation.
+ The default is "/" (since the default separator is "/" for the fqn).
+ The locking then is applied to the node under root, for example
+ "/org" (no locking "/").
+ </para>
- <para>Furthermore, let's say when JBoss Cache needs to apply a write
- lock on node "/org/jboss/test", it will first try to obtain read
- lock from the parent nodes recursively (in this example, "/org", and
- "/org/jboss"). Only when it succeeds then it will try to obtain a
- write lock on "/org/jboss/test".
- </para>
- </answer>
- </qandaentry>
+ <para>Furthermore, let's say when JBoss Cache needs to apply a write
+ lock on node "/org/jboss/test", it will first try to obtain read
+ lock from the parent nodes recursively (in this example, "/org", and
+ "/org/jboss"). Only when it succeeds then it will try to obtain a
+ write lock on "/org/jboss/test".
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I use the cache locking level even without a transaction
- context?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I use the cache locking level even without a transaction
+ context?
+ </para>
+ </question>
- <answer>
- <para>Yes. JBoss Cache controls the individual node locking behavior
- through the isolation level semantics. This means even if you don't
- use a transaction, you can specify the lock level via isolation
- level. You can think of the node locking behavior outside of a
- transaction as if it is under transaction with
- <literal>auto_commit</literal>
- on.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. JBoss Cache controls the individual node locking behavior
+ through the isolation level semantics. This means even if you don't
+ use a transaction, you can specify the lock level via isolation
+ level. You can think of the node locking behavior outside of a
+ transaction as if it is under transaction with
+ <literal>auto_commit</literal>
+ on.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>With replication (REPL_SYNC/REPL_ASYNC) or invalidation (INVALIDATION_SYNC/INVALIDATION_ASYNC), how
- often does the cache broadcast messages over the network?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>With replication (REPL_SYNC/REPL_ASYNC) or invalidation
+ (INVALIDATION_SYNC/INVALIDATION_ASYNC), how
+ often does the cache broadcast messages over the network?
+ </para>
+ </question>
- <answer>
- <para>If the updates are under transaction, then the broadcasts
- happen only when the transaction is about to commit (actually
- during the prepare stage internally). That is, it will be a batch
- update. However, if the operations are not under transaction
- context, then each update will trigger replication. Note that this
- has performance implication if network transport is heavy (it
- usually is).
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>If the updates are under transaction, then the broadcasts
+ happen only when the transaction is about to commit (actually
+ during the prepare stage internally). That is, it will be a batch
+ update. However, if the operations are not under transaction
+ context, then each update will trigger replication. Note that this
+ has performance implication if network transport is heavy (it
+ usually is).
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How can I do a mass removal?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How can I do a mass removal?</para>
+ </question>
- <answer>
- <para>If you do a cache.removeNode(Fqn.fromString("/myroot")), it will recursively remove
- all the entries under "/myroot".
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>If you do a cache.removeNode(Fqn.fromString("/myroot")), it will recursively remove
+ all the entries under "/myroot".
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I monitor and manage the JBoss Cache?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I monitor and manage the JBoss Cache?</para>
+ </question>
- <answer>
- <para>Yes, using a JMX console such as the one shipped with JBoss AS or Java 5's
- <literal>jconsole</literal>
- utility. See the chapter titled
- <emphasis role="bold">Management Information</emphasis>
- in the JBoss Cache user guide for more details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes, using a JMX console such as the one shipped with JBoss AS or Java 5's
+ <literal>jconsole</literal>
+ utility. See the chapter titled
+ <emphasis role="bold">Management Information</emphasis>
+ in the JBoss Cache user guide for more details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I disable JBoss Cache management attributes?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I disable JBoss Cache management attributes?</para>
+ </question>
- <answer>
- <para>Yes, you can. Set the
- <literal>UseInterceptorMbeans</literal>
- configuration attribute to
- <literal>false</literal>
- (this defaults to
- <literal>true</literal>
- ). See the chapter titled
- <emphasis role="bold">Management Information</emphasis>
- in the JBoss Cache user guide for more details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes, you can. Set the
+ <literal>UseInterceptorMbeans</literal>
+ configuration attribute to
+ <literal>false</literal>
+ (this defaults to
+ <literal>true</literal>
+ ). See the chapter titled
+ <emphasis role="bold">Management Information</emphasis>
+ in the JBoss Cache user guide for more details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>What happened to jboss-serialization.jar?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What happened to jboss-serialization.jar?</para>
+ </question>
- <answer>
- <para>
- As of JBoss Cache 2.0.0, the dependency on JBoss Serialization has been dropped since most of the
- benefits of JBoss Serialization are available in updated Java 5 VMs. Since JBoss Cache 2.0.0 is
- baselined on Java 5, there was no need to provide these benefits separately.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ As of JBoss Cache 2.0.0, the dependency on JBoss Serialization has been dropped since most of
+ the
+ benefits of JBoss Serialization are available in updated Java 5 VMs. Since JBoss Cache 2.0.0 is
+ baselined on Java 5, there was no need to provide these benefits separately.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support partitioning?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support partitioning?</para>
+ </question>
- <answer>
- <para>Not right now. JBoss Cache does not support partitioning that a
- user can configure to have different set of data residing on
- different cache instances while still participating as a replication
- group.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Not right now. JBoss Cache does not support partitioning that a
+ user can configure to have different set of data residing on
+ different cache instances while still participating as a replication
+ group.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache handle the concept of application classloading
- inside, say, a J2EE container?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache handle the concept of application classloading
+ inside, say, a J2EE container?
+ </para>
+ </question>
- <answer>
- <para>Application-specific classloading is used widely inside a Java EE
- container. For example, a web application may require a new
- classloader to scope a specific version of the user library.
- However, by default JBoss Cache is agnostic to the classloader. In
- general, this leads to two kinds of problems:
- </para>
+ <answer>
+ <para>Application-specific classloading is used widely inside a Java EE
+ container. For example, a web application may require a new
+ classloader to scope a specific version of the user library.
+ However, by default JBoss Cache is agnostic to the classloader. In
+ general, this leads to two kinds of problems:
+ </para>
- <itemizedlist>
- <listitem>
- <para>Object instance is stored in cache1 and replicated to
- cache2. As a result, the instance in cache2 is created by the
- system classloader. The replication may fail if the system
- classloader on cache2 does not have access to the required
- class. Even if replication doesn't fail, a user thread in cache2
- may not be able to access the object if the user thread is
- expecting a type defined by the application classloader.
- </para>
- </listitem>
+ <itemizedlist>
+ <listitem>
+ <para>Object instance is stored in cache1 and replicated to
+ cache2. As a result, the instance in cache2 is created by the
+ system classloader. The replication may fail if the system
+ classloader on cache2 does not have access to the required
+ class. Even if replication doesn't fail, a user thread in cache2
+ may not be able to access the object if the user thread is
+ expecting a type defined by the application classloader.
+ </para>
+ </listitem>
- <listitem>
- <para>Object instance is created by thread 1 and will be
- accessed by thread 2 (with two different classloaders).
- JBoss Cache has no notion of the different classloaders involved.
- As a result, you will have a
- <literal>ClassCastException</literal>
- . This is a standard
- problem in passing an object from one application space to
- another; JBoss Cache just adds a level of indirection in passing
- the object.
- </para>
- </listitem>
- </itemizedlist>
+ <listitem>
+ <para>Object instance is created by thread 1 and will be
+ accessed by thread 2 (with two different classloaders).
+ JBoss Cache has no notion of the different classloaders involved.
+ As a result, you will have a
+ <literal>ClassCastException</literal>
+ . This is a standard
+ problem in passing an object from one application space to
+ another; JBoss Cache just adds a level of indirection in passing
+ the object.
+ </para>
+ </listitem>
+ </itemizedlist>
- <para>To solve the first kind of issue JBoss Cache uses a
- <literal>CacheMarshaller</literal>
- .
- Basically, this allows application code to register a classloader
- with a portion of the cache tree for use in handling objects
- replicated to that portion. See the
- <literal>CacheMarshaller</literal>
- section of
- the user guide for more details.
- </para>
+ <para>To solve the first kind of issue JBoss Cache uses a
+ <literal>CacheMarshaller</literal>
+ .
+ Basically, this allows application code to register a classloader
+ with a portion of the cache tree for use in handling objects
+ replicated to that portion. See the
+ <literal>CacheMarshaller</literal>
+ section of
+ the user guide for more details.
+ </para>
- <para>To solve the second kind of issue, the only solution (that we
- know of) is to cache "serialized" byte code and only de-serialize it
- during every object get (and this will be expensive!). That is,
- during a put operation, the object instance will be serialized and
- therefore can be deserialized safely by a "foreign" classloader.
- However, the performance penalty of this approach is quite severe so
- in general another local in-vm version will need to be used as a
- "near-line" cache. Note also that each time the serialized bytes are
- deserialized, a new instance of the object is created.
- </para>
+ <para>To solve the second kind of issue, the only solution (that we
+ know of) is to cache "serialized" byte code and only de-serialize it
+ during every object get (and this will be expensive!). That is,
+ during a put operation, the object instance will be serialized and
+ therefore can be deserialized safely by a "foreign" classloader.
+ However, the performance penalty of this approach is quite severe so
+ in general another local in-vm version will need to be used as a
+ "near-line" cache. Note also that each time the serialized bytes are
+ deserialized, a new instance of the object is created.
+ </para>
- <para>To help with this kind of handling, JBoss has a utility class
- called
- <literal>MarshalledValue</literal>
- that wraps around the
- serialized object. Here is a code snippet that illustrates how you
- can create a wrapper around JBoss Cache to handle the classloader
- issue:
- </para>
+ <para>To help with this kind of handling, JBoss has a utility class
+ called
+ <literal>MarshalledValue</literal>
+ that wraps around the
+ serialized object. Here is a code snippet that illustrates how you
+ can create a wrapper around JBoss Cache to handle the classloader
+ issue:
+ </para>
- <programlisting role="JAVA">
- <![CDATA[
+ <programlisting role="JAVA">
+ <![CDATA[
import org.jboss.invocation.MarshalledValue;
public class CacheService
@@ -1099,553 +1128,577 @@
}
}
]]></programlisting>
- </answer>
- </qandaentry>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache currently support pre-event and post-event
- notification?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache currently support pre-event and post-event
+ notification?
+ </para>
+ </question>
- <answer>
- <para>Yes. A boolean is passed in to each notification callback identifying whether the callback is
- before
- or after the event. See the
- <literal>org.jboss.cache.CacheListener</literal>
- interface for details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. A boolean is passed in to each notification callback identifying whether the callback is
+ before
+ or after the event. See the
+ <literal>org.jboss.cache.CacheListener</literal>
+ interface for details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>How do I implement a custom listener to listen to
- cache events?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>How do I implement a custom listener to listen to
+ cache events?
+ </para>
+ </question>
- <answer>
- <para>
- Either implement
- <literal>org.jboss.cache.CacheListener</literal>
- or extend
- <literal>org.jboss.cache.AbstractCacheListener</literal>
- and override for the events you are interested in. You can then register the listener using the
- <literal>org.jboss.cache.Cache_Legacy.addCacheListener()</literal>
- API.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ Either implement
+ <literal>org.jboss.cache.CacheListener</literal>
+ or extend
+ <literal>org.jboss.cache.AbstractCacheListener</literal>
+ and override for the events you are interested in. You can then register the listener using the
+ <literal>org.jboss.cache.Cache_Legacy.addCacheListener()</literal>
+ API.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I use
- <literal>UseRegionBasedMarshalling</literal>
- attribute in JBoss Cache in order to get
- around ClassCastExceptions happening when accessing data in the cache that has just been redeployed?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I use
+ <literal>UseRegionBasedMarshalling</literal>
+ attribute in JBoss Cache in order to get
+ around ClassCastExceptions happening when accessing data in the cache that has just been
+ redeployed?
+ </para>
+ </question>
- <answer>
- <para>Yes, you can. Originally, cache Marshalling was designed as a
- workaround for those replicated caches that upon state transfer did not have access to the
- classloaders defining the objects in the cache.
- </para>
+ <answer>
+ <para>Yes, you can. Originally, cache Marshalling was designed as a
+ workaround for those replicated caches that upon state transfer did not have access to the
+ classloaders defining the objects in the cache.
+ </para>
- <para>On each deployment, JBoss creates a new classloader per the top level deployment artifact, for
- example an EAR. You also have to bear in mind that a class in an application server is defined not
- only by the class name but also its classloader. So, assuming that the cache is not deployed as part
- of your deployment, you could deploy an application and put instances of classes belonging to this
- deployment inside the cache. If you did a redeployment and try to do a get operation of the data
- previously put, this would result on a ClassCastException. This is because even though the class names
- are the same, the class definitions are not. The current classloader is different to the one when
- the classes were originally put.
- </para>
+ <para>On each deployment, JBoss creates a new classloader per the top level deployment artifact, for
+ example an EAR. You also have to bear in mind that a class in an application server is defined
+ not
+ only by the class name but also its classloader. So, assuming that the cache is not deployed as
+ part
+ of your deployment, you could deploy an application and put instances of classes belonging to
+ this
+ deployment inside the cache. If you did a redeployment and try to do a get operation of the data
+ previously put, this would result on a ClassCastException. This is because even though the class
+ names
+ are the same, the class definitions are not. The current classloader is different to the one
+ when
+ the classes were originally put.
+ </para>
- <para>By enabling marshalling, you can control the lifecycle of the data in the cache and if on
- undeployment, you deactivate the region and unregister the classloader that you'd have registered on
- deployment, you'd evict the data in the cache locally. That means that in the next deployment, the
- data won't be in the cache, therefore avoiding the problem. Obviously, using marshalling to get
- around this problem is only recommended when you have some kind of persistence backing where the data
- survives, for example using CacheLoaders, or when JBoss Cache is used as a second level cache in a
- persistence framework.
- </para>
+ <para>By enabling marshalling, you can control the lifecycle of the data in the cache and if on
+ undeployment, you deactivate the region and unregister the classloader that you'd have
+ registered on
+ deployment, you'd evict the data in the cache locally. That means that in the next deployment,
+ the
+ data won't be in the cache, therefore avoiding the problem. Obviously, using marshalling to get
+ around this problem is only recommended when you have some kind of persistence backing where the
+ data
+ survives, for example using CacheLoaders, or when JBoss Cache is used as a second level cache in
+ a
+ persistence framework.
+ </para>
- <para>To implement this feature, please follow the instructions indicated in the example located
- in the CacheMarshaller section of the user's guide. It's worth noting that instead of a
- <literal>ServletContextListener</literal>
- , you could add this code into an
- <literal>MBean</literal>
- that contained lifecycle methods, such as
- <literal>start()</literal>
- and
- <literal>stop()</literal>
- .
- The key would be for this MBean to depend on the target cache, so that it can operate as long as the
- cache is up and running.
- </para>
- </answer>
- </qandaentry>
+ <para>To implement this feature, please follow the instructions indicated in the example located
+ in the CacheMarshaller section of the user's guide. It's worth noting that instead of a
+ <literal>ServletContextListener</literal>
+ , you could add this code into an
+ <literal>MBean</literal>
+ that contained lifecycle methods, such as
+ <literal>start()</literal>
+ and
+ <literal>stop()</literal>
+ .
+ The key would be for this MBean to depend on the target cache, so that it can operate as long as
+ the
+ cache is up and running.
+ </para>
+ </answer>
+ </qandaentry>
- </qandaset>
- </chapter>
+ </qandaset>
+ </chapter>
- <chapter id="eviction">
- <title>Eviction Policies</title>
- <qandaset>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support eviction policies?</para>
- </question>
+ <chapter id="eviction">
+ <title>Eviction Policies</title>
+ <qandaset>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support eviction policies?</para>
+ </question>
- <answer>
- <para>Yes. JBoss Cache currently supports multiple eviction policies such as LRU, MRU, and FIFO.
- Users can also plug in their own eviction policy algorithms. See user
- manual for details.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. JBoss Cache currently supports multiple eviction policies such as LRU, MRU, and FIFO.
+ Users can also plug in their own eviction policy algorithms. See user
+ manual for details.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache's eviction policy operates in
- replication mode?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache's eviction policy operates in
+ replication mode?
+ </para>
+ </question>
- <answer>
- <para>Yes and no. :-)</para>
+ <answer>
+ <para>Yes and no. :-)</para>
- <para>The eviction policy only operates in local mode. That is, nodes are
- only evicted locally. This may cause the cache contents not to be
- synchronized temporarily. But when a user tries to obtain the cached
- contents of an evicted node and finds out that is null (e.g.,
- <literal>get</literal>
- returns null), it should get it from the
- other data source and re-populate the data in the cache. During this
- moment, the node content will be propagated and the cache content
- will be in sync.
- </para>
+ <para>The eviction policy only operates in local mode. That is, nodes are
+ only evicted locally. This may cause the cache contents not to be
+ synchronized temporarily. But when a user tries to obtain the cached
+ contents of an evicted node and finds out that is null (e.g.,
+ <literal>get</literal>
+ returns null), it should get it from the
+ other data source and re-populate the data in the cache. During this
+ moment, the node content will be propagated and the cache content
+ will be in sync.
+ </para>
- <para>However, you still can run eviction policies with cache mode
- set to either
- <literal>REPL_SYNC</literal>
- or
- <literal>REPL_ASYNC</literal>
- . Depending on your use case, you can
- set multiple cache instances to have their own eviction policy
- (which are applied locally) or just have selected instances with
- eviction policies activated.
- </para>
+ <para>However, you still can run eviction policies with cache mode
+ set to either
+ <literal>REPL_SYNC</literal>
+ or
+ <literal>REPL_ASYNC</literal>
+ . Depending on your use case, you can
+ set multiple cache instances to have their own eviction policy
+ (which are applied locally) or just have selected instances with
+ eviction policies activated.
+ </para>
- <para>Also note that, with cache loader option, a locally evicted
- node can also be persisted to the backend store and a user can
- retrieve it from the store later on.
- </para>
- </answer>
- </qandaentry>
+ <para>Also note that, with cache loader option, a locally evicted
+ node can also be persisted to the backend store and a user can
+ retrieve it from the store later on.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does JBoss Cache support
- <literal>Region</literal>
- ?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does JBoss Cache support
+ <literal>Region</literal>
+ ?
+ </para>
+ </question>
- <answer>
- <para>Yes. JBoss Cache has the notion of region where a user can
- configure the eviction policy parameters (e.g.,
- <literal>maxNodes</literal>
- or
- <literal>timeToIdleSeconds</literal>
- )
- </para>
+ <answer>
+ <para>Yes. JBoss Cache has the notion of region where a user can
+ configure the eviction policy parameters (e.g.,
+ <literal>maxNodes</literal>
+ or
+ <literal>timeToIdleSeconds</literal>
+ )
+ </para>
- <para>A region in JBoss Cache denotes a portion of tree hierarchy,
- e.g., a fully qualified name (
- <literal>org.jboss.cache.Fqn</literal>
- ). For example,
- a user can define
- <literal>/org/jboss</literal>
- and
- <literal>/org/foocom</literal>
- as two separate regions. But note
- that you can configure the region programmatically now, i.e.,
- everything has to be configured through the xml file.
- </para>
- </answer>
- </qandaentry>
+ <para>A region in JBoss Cache denotes a portion of tree hierarchy,
+ e.g., a fully qualified name (
+ <literal>org.jboss.cache.Fqn</literal>
+ ). For example,
+ a user can define
+ <literal>/org/jboss</literal>
+ and
+ <literal>/org/foocom</literal>
+ as two separate regions. But note
+ that you can configure the region programmatically now, i.e.,
+ everything has to be configured through the xml file.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>What are the
- <literal>EvictionPolicyConfig</literal>
- tag
- parameters for
- <literal>org.jboss.cache.eviction.LRUPolicy</literal>
- ?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What are the
+ <literal>EvictionPolicyConfig</literal>
+ tag
+ parameters for
+ <literal>org.jboss.cache.eviction.LRUPolicy</literal>
+ ?
+ </para>
+ </question>
- <answer>
- <para>They are:</para>
+ <answer>
+ <para>They are:</para>
- <table>
- <title>Parameters</title>
+ <table>
+ <title>Parameters</title>
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>eventQueueSize</entry>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>eventQueueSize</entry>
- <entry>A fine-tuning parameter where you can configure the size of the eviction notification
- event queue. Defaults to 200,000.
- </entry>
- </row>
+ <entry>A fine-tuning parameter where you can configure the size of the eviction
+ notification
+ event queue. Defaults to 200,000.
+ </entry>
+ </row>
- <row>
- <entry>wakeUpIntervalInSeconds</entry>
+ <row>
+ <entry>wakeUpIntervalInSeconds</entry>
- <entry>Interval where the clean up thread wakes to process
- the sitting queue and sweep away the old data.
- </entry>
- </row>
+ <entry>Interval where the clean up thread wakes to process
+ the sitting queue and sweep away the old data.
+ </entry>
+ </row>
- <row>
- <entry>region</entry>
+ <row>
+ <entry>region</entry>
- <entry>A area where each eviction policy parameters are
- specified. Note that it needs a minimum of
- <literal>/_default</literal>
- region.
- </entry>
- </row>
+ <entry>A area where each eviction policy parameters are
+ specified. Note that it needs a minimum of
+ <literal>/_default</literal>
+ region.
+ </entry>
+ </row>
- <row>
- <entry>maxNodes</entry>
+ <row>
+ <entry>maxNodes</entry>
- <entry>Max number of nodes allowed in the eviction queue. 0
- means no limit.
- </entry>
- </row>
+ <entry>Max number of nodes allowed in the eviction queue. 0
+ means no limit.
+ </entry>
+ </row>
- <row>
- <entry>timeToLiveInSeconds</entry>
+ <row>
+ <entry>timeToLiveInSeconds</entry>
- <entry>Age (in seconds) for the node to be evicted in the
- queue. 0 denotes no limit.
- </entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </answer>
- </qandaentry>
+ <entry>Age (in seconds) for the node to be evicted in the
+ queue. 0 denotes no limit.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>I have turned on the eviction policy, why do I still get "out
- of memory" (OOM) exception?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>I have turned on the eviction policy, why do I still get "out
+ of memory" (OOM) exception?
+ </para>
+ </question>
- <answer>
- <para>OOM can happen when the speed of cache access exceeds the
- speed of eviction policy handling timer. Eviction policy handler
- will wake up every
- <literal>wakeUpIntervalInSeconds</literal>
- seconds to process the eviction event queue. So when the queue size is full, it will create a
- backlog and cause out-of-memory exceptions to happen unless the eviction timer catches
- up. To address this problem, in addition to increase the VM heap
- size, you can also reduce the
- <literal>wakeUpIntervaleInSeconds</literal>
- so the timer thread
- processes the queue more frequently.
- </para>
+ <answer>
+ <para>OOM can happen when the speed of cache access exceeds the
+ speed of eviction policy handling timer. Eviction policy handler
+ will wake up every
+ <literal>wakeUpIntervalInSeconds</literal>
+ seconds to process the eviction event queue. So when the queue size is full, it will create a
+ backlog and cause out-of-memory exceptions to happen unless the eviction timer catches
+ up. To address this problem, in addition to increase the VM heap
+ size, you can also reduce the
+ <literal>wakeUpIntervaleInSeconds</literal>
+ so the timer thread
+ processes the queue more frequently.
+ </para>
- <para>The eviction queue size is configurable.
- </para>
- </answer>
- </qandaentry>
- </qandaset>
- </chapter>
- <chapter id="cacheloaders">
- <title>Cache Loaders</title>
- <qandaset>
+ <para>The eviction queue size is configurable.
+ </para>
+ </answer>
+ </qandaentry>
+ </qandaset>
+ </chapter>
+ <chapter id="cacheloaders">
+ <title>Cache Loaders</title>
+ <qandaset>
- <qandaentry>
- <question>
- <para>What is a cache loader?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>What is a cache loader?</para>
+ </question>
- <answer>
- <para>A cache loader is the connection of JBoss Cache to a
- (persistent) data store. The cache loader is called by JBoss Cache to
- fetch data from a store when that data is not in the cache, and when
- modifications are made to data in the cache the Cache Loader is
- called to store those modifications back to the store.
- </para>
+ <answer>
+ <para>A cache loader is the connection of JBoss Cache to a
+ (persistent) data store. The cache loader is called by JBoss Cache to
+ fetch data from a store when that data is not in the cache, and when
+ modifications are made to data in the cache the Cache Loader is
+ called to store those modifications back to the store.
+ </para>
- <para>In conjunction with eviction policies, JBoss Cache with a
- cache loader allows a user to maintain a bounded cache for a large
- backend datastore. Frequently used data is fetched from the
- datastore into the cache, and the least used data is evicted, in
- order to provide fast access to frequently accessed data. This is
- all configured through XML, and the programmer doesn't have to take
- care of loading and eviction.
- </para>
+ <para>In conjunction with eviction policies, JBoss Cache with a
+ cache loader allows a user to maintain a bounded cache for a large
+ backend datastore. Frequently used data is fetched from the
+ datastore into the cache, and the least used data is evicted, in
+ order to provide fast access to frequently accessed data. This is
+ all configured through XML, and the programmer doesn't have to take
+ care of loading and eviction.
+ </para>
- <para>JBoss Cache currently ships with several cache loader
- implementations, including:
- </para>
+ <para>JBoss Cache currently ships with several cache loader
+ implementations, including:
+ </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- <literal>org.jboss.cache.loader.FileCacheLoader</literal>
- : this implementation uses the file
- system to store and retrieve data. JBoss Cache nodes are mapped
- to directories, subnodes to subdirectories etc. Attributes of
- a node are mapped to a data file
- inside the
- directory.
- </para>
- </listitem>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.loader.FileCacheLoader</literal>
+ : this implementation uses the file
+ system to store and retrieve data. JBoss Cache nodes are mapped
+ to directories, subnodes to subdirectories etc. Attributes of
+ a node are mapped to a data file
+ inside the
+ directory.
+ </para>
+ </listitem>
- <listitem>
- <para>
- <literal>org.jboss.cache.loader.BdbjeCacheLoader</literal>
- : this implementation is based on the
- Oracle's Berkeley DB Java Edition database, a fast and efficient
- transactional database. It uses a single file for the entire
- store. Note that if you use the Berkeley DB cache loader with
- JBoss Cache and wish to ship your product, you will have to acquire a
- <ulink url="http://www.sleepycat.com/jeforjbosscache">commercial license from Oracle
- </ulink>
- .
- </para>
- </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.loader.BdbjeCacheLoader</literal>
+ : this implementation is based on the
+ Oracle's Berkeley DB Java Edition database, a fast and efficient
+ transactional database. It uses a single file for the entire
+ store. Note that if you use the Berkeley DB cache loader with
+ JBoss Cache and wish to ship your product, you will have to acquire a
+ <ulink url="http://www.sleepycat.com/jeforjbosscache">commercial license from Oracle
+ </ulink>
+ .
+ </para>
+ </listitem>
- <listitem>
- <para>
- <literal>org.jboss.cache.loader.JDBCCacheLoader</literal>
- : this implementation uses the relational database as the persistent
- storage.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ <literal>org.jboss.cache.loader.JDBCCacheLoader</literal>
+ : this implementation uses the relational database as the persistent
+ storage.
+ </para>
+ </listitem>
- <listitem>
- <para>And more. See the chapter on cache loaders in the User Guide for more details.</para>
- </listitem>
- </itemizedlist>
- </para>
- </answer>
- </qandaentry>
+ <listitem>
+ <para>And more. See the chapter on cache loaders in the User Guide for more details.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Is the FileCacheLoader recommended for production use?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Is the FileCacheLoader recommended for production use?</para>
+ </question>
- <answer>
- <para>
- No, it is not. The FileCacheLoader has some severe limitations which restrict it's use in a production
- environment, or if used in such an environment, it should be used with due care and sufficient
- understanding of these limitations.
- <itemizedlist>
- <listitem>Due to the way the FileCacheLoader represents a tree structure on disk (directories and
- files) traversal is inefficient for deep trees.
- </listitem>
- <listitem>Usage on shared filesystems like NFS, Windows shares, etc. should be avoided as these do
- not implement proper file locking and can cause data corruption.
- </listitem>
- <listitem>Usage with an isolation level of NONE can cause corrupt writes as multiple threads
- attempt to write to the same file.
- </listitem>
- <listitem>File systems are inherently not transactional, so when attempting to use your cache in a
- transactional context, failures when writing to the file (which happens during the commit phase)
- cannot be recovered.
- </listitem>
- </itemizedlist>
+ <answer>
+ <para>
+ No, it is not. The FileCacheLoader has some severe limitations which restrict it's use in a
+ production
+ environment, or if used in such an environment, it should be used with due care and sufficient
+ understanding of these limitations.
+ <itemizedlist>
+ <listitem>Due to the way the FileCacheLoader represents a tree structure on disk
+ (directories and
+ files) traversal is inefficient for deep trees.
+ </listitem>
+ <listitem>Usage on shared filesystems like NFS, Windows shares, etc. should be avoided as
+ these do
+ not implement proper file locking and can cause data corruption.
+ </listitem>
+ <listitem>Usage with an isolation level of NONE can cause corrupt writes as multiple threads
+ attempt to write to the same file.
+ </listitem>
+ <listitem>File systems are inherently not transactional, so when attempting to use your
+ cache in a
+ transactional context, failures when writing to the file (which happens during the
+ commit phase)
+ cannot be recovered.
+ </listitem>
+ </itemizedlist>
- As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly concurrent,
- transactional or stressful environment, and it's use is restricted to testing.
- </para>
- </answer>
- </qandaentry>
+ As a rule of thumb, it is recommended that the FileCacheLoader not be used in a highly
+ concurrent,
+ transactional or stressful environment, and it's use is restricted to testing.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can writing to cache loaders be asynchronous?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can writing to cache loaders be asynchronous?</para>
+ </question>
- <answer>
- <para>Yes. Set the
- <literal>async</literal>
- attrobute to true. See the JBoss Cache User Guide for a more
- detailed discussion. By default though, all cache loader writes are
- synchronous and will block.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. Set the
+ <literal>async</literal>
+ attrobute to true. See the JBoss Cache User Guide for a more
+ detailed discussion. By default though, all cache loader writes are
+ synchronous and will block.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I write my own cache loader ?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I write my own cache loader ?</para>
+ </question>
- <answer>
- <para>Yes. A cache loader is a class implementing
- <literal>org.jboss.cache.loader.CacheLoader</literal>
- or extending
- <literal>org.jboss.cache.loader.AbstractCacheLoader</literal>
- . It is
- configured via the XML file (see JBoss Cache User Guide).
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. A cache loader is a class implementing
+ <literal>org.jboss.cache.loader.CacheLoader</literal>
+ or extending
+ <literal>org.jboss.cache.loader.AbstractCacheLoader</literal>
+ . It is
+ configured via the XML file (see JBoss Cache User Guide).
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Does a cache loader have to use a persistent store ?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Does a cache loader have to use a persistent store ?</para>
+ </question>
- <answer>
- <para>No, a cache loader could for example fetch (and possibly store)
- its data from a webdav-capable webserver. Another example is a
- caching proxy server, which fetches contents from the web. Note that
- an implementation of CacheLoader may not implement the 'store'
- functionality in this case, but just the 'load'
- functionality.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>No, a cache loader could for example fetch (and possibly store)
+ its data from a webdav-capable webserver. Another example is a
+ caching proxy server, which fetches contents from the web. Note that
+ an implementation of CacheLoader may not implement the 'store'
+ functionality in this case, but just the 'load'
+ functionality.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Do I have to pay to use Oracle's Berkeley DB CacheLoader?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Do I have to pay to use Oracle's Berkeley DB CacheLoader?</para>
+ </question>
- <answer>
- <para>Not if you use it only for personal use. As soon as you
- distribute your product with BdbjeCacheLoader, you have to purchase
- a commercial license from Oracle. See details at
- <ulink
- url="http://www.sleepycat.com/jeforjbosscache">http://www.sleepycat.com/jeforjbosscache
- </ulink>
- .
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Not if you use it only for personal use. As soon as you
+ distribute your product with BdbjeCacheLoader, you have to purchase
+ a commercial license from Oracle. See details at
+ <ulink
+ url="http://www.sleepycat.com/jeforjbosscache">http://www.sleepycat.com/jeforjbosscache
+ </ulink>
+ .
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Are there any tools available to monitor the Berkeley DB instance?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Are there any tools available to monitor the Berkeley DB instance?</para>
+ </question>
- <answer>
- <para>
- Yes. Oracle ships a JMX-based monitoring tool, called
- <ulink
- url="http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/jmx/JEMonitor.html">
- JEMonitor
- </ulink>
- which can be downloaded from the Oracle website.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ Yes. Oracle ships a JMX-based monitoring tool, called
+ <ulink
+ url="http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/je/jmx/JEMonitor.html">
+ JEMonitor
+ </ulink>
+ which can be downloaded from the Oracle website.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>When tuning my Berkeley DB instance, where should I put my je.properties file?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>When tuning my Berkeley DB instance, where should I put my je.properties file?</para>
+ </question>
- <answer>
- <para>
- <literal>je.properties</literal>
- should reside in your Berkeley DB home directory. This is the directory you pass
- in to the BDBJECacheLoader's
- <literal>location</literal>
- configuration property.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ <literal>je.properties</literal>
+ should reside in your Berkeley DB home directory. This is the directory you pass
+ in to the BDBJECacheLoader's
+ <literal>location</literal>
+ configuration property.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I use more than one cache loader?</para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I use more than one cache loader?</para>
+ </question>
- <answer>
- <para>Yes. Within the CacheLoaderConfiguration XML
- element (see user guide chapter on cache loaders) you can
- describe several cache loaders. The impact is that the cache will
- look at all of the cache loaders in the order they've been
- configured, until it finds a valid, non-null element of data. When
- performing writes, all cache loaders are written to (except if the
- ignoreModifications element has been set to true for a specific
- cache loader.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. Within the CacheLoaderConfiguration XML
+ element (see user guide chapter on cache loaders) you can
+ describe several cache loaders. The impact is that the cache will
+ look at all of the cache loaders in the order they've been
+ configured, until it finds a valid, non-null element of data. When
+ performing writes, all cache loaders are written to (except if the
+ ignoreModifications element has been set to true for a specific
+ cache loader.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>Can I migrate a JDBCacheLoader or FileCacheLoader based cache store containing data formatted with
- JBoss Cache 1.x.x to JBoss Cache 2.0 format?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>Can I migrate a JDBCacheLoader or FileCacheLoader based cache store containing data formatted
+ with
+ JBoss Cache 1.x.x to JBoss Cache 2.0 format?
+ </para>
+ </question>
- <answer>
- <para>Yes. See "Transforming Cache Loaders" section within the "Cache Loaders" section located in the
- JBoss Cache users guide.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>Yes. See "Transforming Cache Loaders" section within the "Cache Loaders" section located in
+ the
+ JBoss Cache users guide.
+ </para>
+ </answer>
+ </qandaentry>
- <qandaentry>
- <question>
- <para>
- Is the TCPDelegatingCacheLoader resilient to TCPCacheServer restarts?
- </para>
- </question>
+ <qandaentry>
+ <question>
+ <para>
+ Is the TCPDelegatingCacheLoader resilient to TCPCacheServer restarts?
+ </para>
+ </question>
- <answer>
- <para>
- As of JBoss Cache 2.1.0, the answer is yes. See the User Guide for details on how to configure and
- tune
- your retries and wait period for reestablishing the TCP connection.
- </para>
- <para>
- Prior to that, restarting the TCPCacheServer would also mean
- restarting your application that uses the cache.
- </para>
- </answer>
- </qandaentry>
+ <answer>
+ <para>
+ As of JBoss Cache 2.1.0, the answer is yes. See the User Guide for details on how to configure
+ and
+ tune
+ your retries and wait period for reestablishing the TCP connection.
+ </para>
+ <para>
+ Prior to that, restarting the TCPCacheServer would also mean
+ restarting your application that uses the cache.
+ </para>
+ </answer>
+ </qandaentry>
- </qandaset>
- </chapter>
- <chapter id="troubleshooting">
- <title>Troubleshooting</title>
- <qandaset>
+ </qandaset>
+ </chapter>
+ <chapter id="troubleshooting">
+ <title>Troubleshooting</title>
+ <qandaset>
- <qandaentry>
- <question>
- <para>I am having problems getting JBoss Cache to work, where can I get information on troubleshooting?
- </para>
- </question>
- <answer>
- <para>Troubleshooting section can be found in the following
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheTroubleshooting">wiki link</ulink>
- .
- </para>
- </answer>
- </qandaentry>
- </qandaset>
- </chapter>
+ <qandaentry>
+ <question>
+ <para>I am having problems getting JBoss Cache to work, where can I get information on
+ troubleshooting?
+ </para>
+ </question>
+ <answer>
+ <para>Troubleshooting section can be found in the following
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheTroubleshooting">wiki link
+ </ulink>
+ .
+ </para>
+ </answer>
+ </qandaentry>
+ </qandaset>
+ </chapter>
</book>
Modified: core/branches/flat/src/main/docbook/userguide/en/modules/configuration.xml
===================================================================
--- core/branches/flat/src/main/docbook/userguide/en/modules/configuration.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/docbook/userguide/en/modules/configuration.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,70 +1,70 @@
<chapter id="configuration">
- <title>Configuration</title>
+ <title>Configuration</title>
- <section>
- <title>Configuration Overview</title>
+ <section>
+ <title>Configuration Overview</title>
- <para>
- The
- <literal>org.jboss.cache.config.Configuration</literal>
- class
- (along with its
- <link linkend="configuration.elements">component parts</link>
- )
- is a Java Bean that encapsulates the configuration of the
- <literal>Cache</literal>
- and all of its architectural elements
- (cache loaders, evictions policies, etc.)
- </para>
+ <para>
+ The
+ <literal>org.jboss.cache.config.Configuration</literal>
+ class
+ (along with its
+ <link linkend="configuration.elements">component parts</link>
+ )
+ is a Java Bean that encapsulates the configuration of the
+ <literal>Cache</literal>
+ and all of its architectural elements
+ (cache loaders, evictions policies, etc.)
+ </para>
- <para>
- The
- <literal>Configuration</literal>
- exposes numerous properties which
- are summarized in the
- <link linkend="configuration_reference">configuration reference</link>
- section of this book and many of which are discussed in later
- chapters. Any time you see a configuration option
- discussed in this book, you can assume that the
- <literal>Configuration</literal>
- class or one of its component parts exposes a simple property setter/getter for that configuration option.
- </para>
+ <para>
+ The
+ <literal>Configuration</literal>
+ exposes numerous properties which
+ are summarized in the
+ <link linkend="configuration_reference">configuration reference</link>
+ section of this book and many of which are discussed in later
+ chapters. Any time you see a configuration option
+ discussed in this book, you can assume that the
+ <literal>Configuration</literal>
+ class or one of its component parts exposes a simple property setter/getter for that configuration option.
+ </para>
- </section>
+ </section>
- <section id="configuration.creation">
- <title>Creating a
- <literal>Configuration</literal>
- </title>
+ <section id="configuration.creation">
+ <title>Creating a
+ <literal>Configuration</literal>
+ </title>
- <para>
- As discussed in the
- <link linkend="api.create_start">User API section</link>
- ,
- before a
- <literal>Cache</literal>
- can be created, the
- <literal>CacheFactory</literal>
- must be provided with a
- <literal>Configuration</literal>
- object or with a file name or
- input stream to use to parse a
- <literal>Configuration</literal>
- from XML. The following sections describe how to accomplish this.
- </para>
+ <para>
+ As discussed in the
+ <link linkend="api.create_start">User API section</link>
+ ,
+ before a
+ <literal>Cache</literal>
+ can be created, the
+ <literal>CacheFactory</literal>
+ must be provided with a
+ <literal>Configuration</literal>
+ object or with a file name or
+ input stream to use to parse a
+ <literal>Configuration</literal>
+ from XML. The following sections describe how to accomplish this.
+ </para>
- <section>
- <title>Parsing an XML-based Configuration File</title>
- <para>
- The most convenient way to configure JBoss Cache is via an XML file. The JBoss Cache distribution ships
- with a number of configuration files for common use cases. It is recommended that these files be used as
- a starting point, and tweaked to meet specific needs.
- </para>
+ <section>
+ <title>Parsing an XML-based Configuration File</title>
+ <para>
+ The most convenient way to configure JBoss Cache is via an XML file. The JBoss Cache distribution ships
+ with a number of configuration files for common use cases. It is recommended that these files be used as
+ a starting point, and tweaked to meet specific needs.
+ </para>
- <para>
- Here is a simple example configuration file:
- </para>
- <programlisting role="XML"><![CDATA[
+ <para>
+ Here is a simple example configuration file:
+ </para>
+ <programlisting role="XML"><![CDATA[<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
@@ -74,12 +74,12 @@
<!-- ===================================================================== -->
<server>
-
+
<mbean code="org.jboss.cache.jmx.CacheJmxWrapper" name="jboss.cache:service=Cache">
-
+
<!-- Configure the TransactionManager -->
<attribute name="TransactionManagerLookupClass">
- org.jboss.cache.transaction.GenericTransactionManagerLookup
+ org.jboss.starobrno.transaction.GenericTransactionManagerLookup
</attribute>
<!-- Node locking level : SERIALIZABLE
@@ -118,72 +118,73 @@
</attribute>
</mbean>
</server>
-]]></programlisting>
+]]>]]>
+ </programlisting>
- <para>
- Another, more complete, sample XML file is included in the
- <link linkend="sample_xml_file">configuration reference</link>
- section of this book,
- along with
- <link linkend="configuration_reference">a handy look-up table</link>
- explaining the various options.
- </para>
+ <para>
+ Another, more complete, sample XML file is included in the
+ <link linkend="sample_xml_file">configuration reference</link>
+ section of this book,
+ along with
+ <link linkend="configuration_reference">a handy look-up table</link>
+ explaining the various options.
+ </para>
- <para>
- For historical reasons, the format of the JBoss Cache configuraton
- file follows that of a JBoss AS Service Archive (SAR) deployment
- descriptor (and still can be used as such
- <link linkend="deployment.microkernel">inside JBoss AS</link>
- ). Because
- of this dual usage, you may see elements in some configuration files
- (such as
- <literal>depends</literal>
- or
- <literal>classpath</literal>
- ) that are
- not relevant outside JBoss AS. These can safely be ignored.
- </para>
+ <para>
+ For historical reasons, the format of the JBoss Cache configuraton
+ file follows that of a JBoss AS Service Archive (SAR) deployment
+ descriptor (and still can be used as such
+ <link linkend="deployment.microkernel">inside JBoss AS</link>
+ ). Because
+ of this dual usage, you may see elements in some configuration files
+ (such as
+ <literal>depends</literal>
+ or
+ <literal>classpath</literal>
+ ) that are
+ not relevant outside JBoss AS. These can safely be ignored.
+ </para>
- <para>
- Here's how you tell the
- <literal>CacheFactory</literal>
- to create
- and start a cache by finding and parsing a configuration file on the
- classpath:
- </para>
+ <para>
+ Here's how you tell the
+ <literal>CacheFactory</literal>
+ to create
+ and start a cache by finding and parsing a configuration file on the
+ classpath:
+ </para>
- <programlisting role="JAVA"><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
CacheFactory factory = new DefaultCacheFactory();
Cache cache = factory.createCache("cache-configuration.xml");
]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Programmatic Configuration</title>
- <para>
- In addition to the XML-based configuration above, the
- <literal>Configuration</literal>
- can be built up programatically,
- using the simple property mutators exposed by
- <literal>Configuration</literal>
- and its components. When constructed,
- the
- <literal>Configuration</literal>
- object is preset with JBoss Cache
- defaults and can even be used as-is for a quick start.
- </para>
+ <section>
+ <title>Programmatic Configuration</title>
+ <para>
+ In addition to the XML-based configuration above, the
+ <literal>Configuration</literal>
+ can be built up programatically,
+ using the simple property mutators exposed by
+ <literal>Configuration</literal>
+ and its components. When constructed,
+ the
+ <literal>Configuration</literal>
+ object is preset with JBoss Cache
+ defaults and can even be used as-is for a quick start.
+ </para>
- <para>
- Following is an example of programatically creating a
- <literal>Configuration</literal>
- configured to match the one produced
- by the XML example above, and then using it to create a
- <literal>Cache</literal>
- :
- </para>
+ <para>
+ Following is an example of programatically creating a
+ <literal>Configuration</literal>
+ configured to match the one produced
+ by the XML example above, and then using it to create a
+ <literal>Cache</literal>
+ :
+ </para>
- <programlisting role="JAVA"><![CDATA[
+ <programlisting role="JAVA"><![CDATA[
Configuration config = new Configuration();
String tmlc = GenericTransactionManagerLookup.class.getName();
config.setTransactionManagerLookupClass(tmlc);
@@ -215,226 +216,226 @@
Cache cache = factory.createCache(config);
]]></programlisting>
- <para>
- Even the above fairly simple configuration is pretty tedious programming;
- hence the preferred use of XML-based configuration. However, if your
- application requires it, there is no reason not to use XML-based
- configuration for most of the attributes, and then access the
- <literal>Configuration</literal>
- object to programatically change
- a few items from the defaults, add an eviction region, etc.
- </para>
+ <para>
+ Even the above fairly simple configuration is pretty tedious programming;
+ hence the preferred use of XML-based configuration. However, if your
+ application requires it, there is no reason not to use XML-based
+ configuration for most of the attributes, and then access the
+ <literal>Configuration</literal>
+ object to programatically change
+ a few items from the defaults, add an eviction region, etc.
+ </para>
- <para>
- Note that configuration values may not be changed programmatically when a cache is running,
- except those annotated as
- <literal>@Dynamic</literal>
- . Dynamic properties are also marked as such in the
- <link linkend="configuration_reference">configuration reference</link>
- table. Attempting to change a non-dynamic
- property will result in a
- <literal>ConfigurationException</literal>
- .
- </para>
- </section>
+ <para>
+ Note that configuration values may not be changed programmatically when a cache is running,
+ except those annotated as
+ <literal>@Dynamic</literal>
+ . Dynamic properties are also marked as such in the
+ <link linkend="configuration_reference">configuration reference</link>
+ table. Attempting to change a non-dynamic
+ property will result in a
+ <literal>ConfigurationException</literal>
+ .
+ </para>
+ </section>
- <section>
- <title>Using an IOC Framework</title>
+ <section>
+ <title>Using an IOC Framework</title>
- <para>
- The
+ <para>
+ The
+ <literal>Configuration</literal>
+ class and its
+ <link linkend="configuration.elements">component parts</link>
+ are all Java Beans that expose all config elements via simple setters
+ and getters. Therefore, any good IOC framework should be able to
+ build up a
+ <literal>Configuration</literal>
+ from an XML file in
+ the framework's own format. See the
+ <link linkend="deployment.microcontainer">deployment via the JBoss micrcontainer</link>
+ section for an example of this.
+ </para>
+ </section>
+ </section>
+
+ <section id="configuration.elements">
+ <title>Composition of a
<literal>Configuration</literal>
- class and its
- <link linkend="configuration.elements">component parts</link>
- are all Java Beans that expose all config elements via simple setters
- and getters. Therefore, any good IOC framework should be able to
- build up a
+ Object
+ </title>
+
+ <para>
+ A
<literal>Configuration</literal>
- from an XML file in
- the framework's own format. See the
- <link linkend="deployment.microcontainer">deployment via the JBoss micrcontainer</link>
- section for an example of this.
- </para>
- </section>
- </section>
+ is composed of a number of
+ subobjects:
- <section id="configuration.elements">
- <title>Composition of a
- <literal>Configuration</literal>
- Object
- </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="Configuration.png"/>
+ </imageobject>
+ </mediaobject>
+ </para>
- <para>
- A
- <literal>Configuration</literal>
- is composed of a number of
- subobjects:
+ <para>
+ Following is a brief overview of the components of a
+ <literal>Configuration</literal>
+ . See the javadoc and the linked
+ chapters in this book for a more complete explanation of the
+ configurations associated with each component.
- <mediaobject>
- <imageobject>
- <imagedata fileref="Configuration.png"/>
- </imageobject>
- </mediaobject>
- </para>
+ <itemizedlist>
+ <listitem>
+ <literal>Configuration</literal>
+ : top level object
+ in the hierarchy; exposes the configuration properties listed in the
+ <link linkend="configuration_reference">configuration reference</link>
+ section of this book.
+ </listitem>
- <para>
- Following is a brief overview of the components of a
- <literal>Configuration</literal>
- . See the javadoc and the linked
- chapters in this book for a more complete explanation of the
- configurations associated with each component.
+ <listitem>
+ <literal>BuddyReplicationConfig</literal>
+ : only relevant if
+ <link linkend="br">buddy replication</link>
+ is used. General
+ buddy replication configuration options. Must include a:
+ </listitem>
- <itemizedlist>
- <listitem>
- <literal>Configuration</literal>
- : top level object
- in the hierarchy; exposes the configuration properties listed in the
- <link linkend="configuration_reference">configuration reference</link>
- section of this book.
- </listitem>
+ <listitem>
+ <literal>BuddyLocatorConfig</literal>
+ : implementation-specific
+ configuration object for the
+ <literal>BuddyLocator</literal>
+ implementation
+ being used. What configuration elements are exposed depends on
+ the needs of the
+ <literal>BuddyLocator</literal>
+ implementation.
+ </listitem>
- <listitem>
- <literal>BuddyReplicationConfig</literal>
- : only relevant if
- <link linkend="br">buddy replication</link>
- is used. General
- buddy replication configuration options. Must include a:
- </listitem>
+ <listitem>
+ <literal>EvictionConfig</literal>
+ : only relevant if
+ <link linkend="eviction_policies">eviction</link>
+ is used. General
+ eviction configuration options. Must include at least one:
+ </listitem>
- <listitem>
- <literal>BuddyLocatorConfig</literal>
- : implementation-specific
- configuration object for the
- <literal>BuddyLocator</literal>
- implementation
- being used. What configuration elements are exposed depends on
- the needs of the
- <literal>BuddyLocator</literal>
- implementation.
- </listitem>
+ <listitem>
+ <literal>EvictionRegionConfig</literal>
+ : one for each
+ eviction region; names the region, etc. Must include a:
+ </listitem>
- <listitem>
- <literal>EvictionConfig</literal>
- : only relevant if
- <link linkend="eviction_policies">eviction</link>
- is used. General
- eviction configuration options. Must include at least one:
- </listitem>
+ <listitem>
+ <literal>EvictionPolicyConfig</literal>
+ : implementation-specific
+ configuration object for the
+ <literal>EvictionPolicy</literal>
+ implementation
+ being used. What configuration elements are exposed depends on
+ the needs of the
+ <literal>EvictionPolicy</literal>
+ implementation.
+ </listitem>
- <listitem>
- <literal>EvictionRegionConfig</literal>
- : one for each
- eviction region; names the region, etc. Must include a:
- </listitem>
+ <listitem>
+ <literal>CacheLoaderConfig</literal>
+ : only relevant if a
+ <link linkend="cache_loaders">cache loader</link>
+ is used. General
+ cache loader configuration options. Must include at least one:
+ </listitem>
- <listitem>
- <literal>EvictionPolicyConfig</literal>
- : implementation-specific
- configuration object for the
- <literal>EvictionPolicy</literal>
- implementation
- being used. What configuration elements are exposed depends on
- the needs of the
- <literal>EvictionPolicy</literal>
- implementation.
- </listitem>
+ <listitem>
+ <literal>IndividualCacheLoaderConfig</literal>
+ : implementation-specific
+ configuration object for the
+ <literal>CacheLoader</literal>
+ implementation
+ being used. What configuration elements are exposed depends on
+ the needs of the
+ <literal>CacheLoader</literal>
+ implementation.
+ </listitem>
- <listitem>
- <literal>CacheLoaderConfig</literal>
- : only relevant if a
- <link linkend="cache_loaders">cache loader</link>
- is used. General
- cache loader configuration options. Must include at least one:
- </listitem>
+ <listitem>
+ <literal>RuntimeConfig</literal>
+ : exposes to cache clients
+ certain information about the cache's runtime environment (e.g. membership
+ in buddy replication groups if
+ <link linkend="br">buddy replication</link>
+ is used.) Also allows
+ direct injection into the cache of needed external services like a
+ JTA
+ <literal>TransactionManager</literal>
+ or a JGroups
+ <literal>ChannelFactory</literal>
+ .
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
- <listitem>
- <literal>IndividualCacheLoaderConfig</literal>
- : implementation-specific
- configuration object for the
- <literal>CacheLoader</literal>
- implementation
- being used. What configuration elements are exposed depends on
- the needs of the
- <literal>CacheLoader</literal>
- implementation.
- </listitem>
-
- <listitem>
- <literal>RuntimeConfig</literal>
- : exposes to cache clients
- certain information about the cache's runtime environment (e.g. membership
- in buddy replication groups if
- <link linkend="br">buddy replication</link>
- is used.) Also allows
- direct injection into the cache of needed external services like a
- JTA
- <literal>TransactionManager</literal>
- or a JGroups
- <literal>ChannelFactory</literal>
- .
- </listitem>
- </itemizedlist>
- </para>
- </section>
-
- <section>
- <title>Dynamic Reconfiguration</title>
- <para>
- Dynamically changing the configuration of
- <emphasis>some</emphasis>
- options while the cache is running is supported,
- by programmatically obtaining the
- <literal>Configuration</literal>
- object from the running cache and changing values. E.g.,
- </para>
- <programlisting role="JAVA"><![CDATA[
+ <section>
+ <title>Dynamic Reconfiguration</title>
+ <para>
+ Dynamically changing the configuration of
+ <emphasis>some</emphasis>
+ options while the cache is running is supported,
+ by programmatically obtaining the
+ <literal>Configuration</literal>
+ object from the running cache and changing values. E.g.,
+ </para>
+ <programlisting role="JAVA"><![CDATA[
Configuration liveConfig = cache.getConfiguration();
liveConfig.setLockAcquisitionTimeout(2000);
]]></programlisting>
- <para>
- A complete listing of which options may be changed dynamically is in the
- <link linkend="configuration_reference">configuration reference</link>
- section. An
- <literal>org.jboss.cache.config.ConfigurationException</literal>
- will be thrown if you attempt to change a
- setting that is not dynamic.
- </para>
- </section>
+ <para>
+ A complete listing of which options may be changed dynamically is in the
+ <link linkend="configuration_reference">configuration reference</link>
+ section. An
+ <literal>org.jboss.cache.config.ConfigurationException</literal>
+ will be thrown if you attempt to change a
+ setting that is not dynamic.
+ </para>
+ </section>
- <section id="configuration.options">
- <title>Overriding the Configuration Via the Option API</title>
- <para>
- The Option API allows you to override certain behaviours of the cache on a per invocation basis.
- This involves creating an instance of
- <literal>org.jboss.cache.config.Option</literal>
- , setting the options
- you wish to override on the
- <literal>Option</literal>
- object and passing it in the
- <literal>InvocationContext</literal>
- before invoking your method on the cache.
- </para>
- <para>
- E.g., to override the default node versioning used with optimistic locking:
- </para>
- <programlisting role="JAVA"><![CDATA[
+ <section id="configuration.options">
+ <title>Overriding the Configuration Via the Option API</title>
+ <para>
+ The Option API allows you to override certain behaviours of the cache on a per invocation basis.
+ This involves creating an instance of
+ <literal>org.jboss.cache.config.Option</literal>
+ , setting the options
+ you wish to override on the
+ <literal>Option</literal>
+ object and passing it in the
+ <literal>InvocationContext</literal>
+ before invoking your method on the cache.
+ </para>
+ <para>
+ E.g., to override the default node versioning used with optimistic locking:
+ </para>
+ <programlisting role="JAVA"><![CDATA[
DataVersion v = new MyCustomDataVersion();
cache.getInvocationContext().getOptionOverrides().setDataVersion(v);
Node ch = cache.getRoot().addChild(Fqn.fromString("/a/b/c"));
]]></programlisting>
- <para>
- E.g., to suppress replication of a put call in a REPL_SYNC cache:
- </para>
- <programlisting role="JAVA"><![CDATA[
+ <para>
+ E.g., to suppress replication of a put call in a REPL_SYNC cache:
+ </para>
+ <programlisting role="JAVA"><![CDATA[
Node node = cache.getChild(Fqn.fromString("/a/b/c"));
cache.getInvocationContext().getOptionOverrides().setLocalOnly(true);
node.put("localCounter", new Integer(2));
]]></programlisting>
- <para>
- See the javadocs on the
- <literal>Option</literal>
- class for details on the options available.
- </para>
- </section>
+ <para>
+ See the javadocs on the
+ <literal>Option</literal>
+ class for details on the options available.
+ </para>
+ </section>
</chapter>
Modified: core/branches/flat/src/main/docbook/userguide/en/modules/configuration_reference.xml
===================================================================
--- core/branches/flat/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/docbook/userguide/en/modules/configuration_reference.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,13 +1,14 @@
<chapter id="configuration_reference_chapter">
- <title>Configuration References</title>
- <section id="sample_xml_file">
- <title>Sample XML Configuration File</title>
- <para>
- This is what a typical XML configuration file looks like. It is recommended that you use one of the
- configurations
- shipped with the JBoss Cache distribution and tweak according to your needs rather than write one from scratch.
- </para>
- <programlisting role="XML"><![CDATA[
+ <title>Configuration References</title>
+ <section id="sample_xml_file">
+ <title>Sample XML Configuration File</title>
+ <para>
+ This is what a typical XML configuration file looks like. It is recommended that you use one of the
+ configurations
+ shipped with the JBoss Cache distribution and tweak according to your needs rather than write one from
+ scratch.
+ </para>
+ <programlisting role="XML"><![CDATA[<![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
@@ -17,14 +18,14 @@
<!-- ===================================================================== -->
<server>
-
+
<!-- ==================================================================== -->
<!-- Defines JBoss Cache configuration -->
<!-- ==================================================================== -->
<!-- Note the value of the 'code' attribute has changed since JBC 1.x -->
<mbean code="org.jboss.cache.jmx.CacheJmxWrapper" name="jboss.cache:service=Cache">
-
+
<!-- Ensure JNDI and the TransactionManager are started before the
cache. Only works inside JBoss AS; ignored otherwise -->
<depends>jboss:service=Naming</depends>
@@ -32,7 +33,7 @@
<!-- Configure the TransactionManager -->
<attribute name="TransactionManagerLookupClass">
- org.jboss.cache.transaction.GenericTransactionManagerLookup
+ org.jboss.starobrno.transaction.GenericTransactionManagerLookup
</attribute>
<!-- Node locking level : SERIALIZABLE
@@ -53,7 +54,7 @@
<attribute name="CacheMode">REPL_ASYNC</attribute>
<!-- Name of cluster. Needs to be the same for all JBoss Cache nodes in a
- cluster in order to find each other.
+ cluster in order to find each other.
-->
<attribute name="ClusterName">JBossCache-Cluster</attribute>
@@ -61,10 +62,10 @@
This configuration is dependent on the JGroups multiplexer being
registered in an MBean server such as JBossAS. This type of
dependency injection only works in the AS; outside it's up to
- your code to inject a ChannelFactory if you want to use one.
+ your code to inject a ChannelFactory if you want to use one.
-->
<!--
- <depends optional-attribute-name="MultiplexerService"
+ <depends optional-attribute-name="MultiplexerService"
proxy-type="attribute">jgroups.mux:name=Multiplexer</depends>
<attribute name="MultiplexerStack">tcp</attribute>
-->
@@ -74,7 +75,7 @@
-->
<attribute name="ClusterConfig">
<config>
- <!-- UDP: if you have a multihomed machine, set the bind_addr
+ <!-- UDP: if you have a multihomed machine, set the bind_addr
attribute to the appropriate NIC IP address -->
<!-- UDP: On Windows machines, because of the media sense feature
being broken with multicast (even after disabling media sense)
@@ -98,7 +99,7 @@
<pbcast.STATE_TRANSFER/>
</config>
</attribute>
-
+
<!--
The max amount of time (in milliseconds) we wait until the
initial state (ie. the contents of the cache) are retrieved from
@@ -120,7 +121,7 @@
<attribute name="ShutdownHookBehavior">DEFAULT</attribute>
<!-- Enables or disables lazy unmarshalling. If omitted, the default is that lazy unmarshalling is enabled. -->
- <attribute name="UseLazyDeserialization">true</attribute>
+ <attribute name="UseLazyDeserialization">true</attribute>
<!-- Specific eviction policy configurations. This is LRU -->
<attribute name="EvictionConfig">
@@ -156,586 +157,600 @@
</attribute>
</mbean>
</server>
-]]></programlisting>
- </section>
+]]>]]>
+ </programlisting>
+ </section>
- <section id="configuration_reference">
- <title>
- Reference table of XML attributes
- </title>
- <para>A list of definitions of each of the XML attributes used above. If the
- description of an attribute states that it is
- <emphasis>dynamic</emphasis>
- ,
- that means it can be changed after the cache is created and started.
- </para>
+ <section id="configuration_reference">
+ <title>
+ Reference table of XML attributes
+ </title>
+ <para>A list of definitions of each of the XML attributes used above. If the
+ description of an attribute states that it is
+ <emphasis>dynamic</emphasis>
+ ,
+ that means it can be changed after the cache is created and started.
+ </para>
- <informaltable frame="all">
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>
- <para>Name</para>
- </entry>
+ <informaltable frame="all">
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>
+ <para>Name</para>
+ </entry>
- <entry>
- <para>Description</para>
- </entry>
- </row>
- <row>
- <entry>
- <para>BuddyReplicationConfig</para>
- </entry>
+ <entry>
+ <para>Description</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>BuddyReplicationConfig</para>
+ </entry>
- <entry>
- <para>An XML element that contains detailed buddy replication
- configuration. See
- <link linkend="br">section on Buddy Replication</link>
- for details.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>An XML element that contains detailed buddy replication
+ configuration. See
+ <link linkend="br">section on Buddy Replication</link>
+ for details.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>CacheLoaderConfig</para>
- </entry>
+ <row>
+ <entry>
+ <para>CacheLoaderConfig</para>
+ </entry>
- <entry>
- <para>An XML element that contains detailed cache loader
- configuration. See
- <link linkend="cache_loaders">chapter on Cache Loaders</link>
- for details.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>An XML element that contains detailed cache loader
+ configuration. See
+ <link linkend="cache_loaders">chapter on Cache Loaders</link>
+ for details.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>CacheLoaderConfiguration</para>
- </entry>
+ <row>
+ <entry>
+ <para>CacheLoaderConfiguration</para>
+ </entry>
- <entry>
- <para>
- <emphasis>Deprecated</emphasis>
- . Use
- <literal>CacheLoaderConfig</literal>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>
+ <emphasis>Deprecated</emphasis>
+ . Use
+ <literal>CacheLoaderConfig</literal>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>CacheMode</para>
- </entry>
+ <row>
+ <entry>
+ <para>CacheMode</para>
+ </entry>
- <entry>
- <para>LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC or
- INVALIDATION_ASYNC. Defaults to LOCAL. See the
- <link linkend="clustering">chapter on Clustering</link>
- for details.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>LOCAL, REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC or
+ INVALIDATION_ASYNC. Defaults to LOCAL. See the
+ <link linkend="clustering">chapter on Clustering</link>
+ for details.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ClusterConfig</para>
- </entry>
+ <row>
+ <entry>
+ <para>ClusterConfig</para>
+ </entry>
- <entry>
- <para>The configuration of the underlying JGroups stack.
- Ignored if
- <literal>MultiplexerService</literal>
- and
- <literal>MultiplexerStack</literal>
- are used.
- See the various *-service.xml files in the source distribution
- <literal>etc/config-samples</literal>
- folder for examples.
- See the
- <ulink url="http://www.jgroups.org">JGroups documentation</ulink>
- or the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">JGroups wiki page</ulink>
- for more information.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>The configuration of the underlying JGroups stack.
+ Ignored if
+ <literal>MultiplexerService</literal>
+ and
+ <literal>MultiplexerStack</literal>
+ are used.
+ See the various *-service.xml files in the source distribution
+ <literal>etc/config-samples</literal>
+ folder for examples.
+ See the
+ <ulink url="http://www.jgroups.org">JGroups documentation</ulink>
+ or the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JGroups">JGroups wiki page</ulink>
+ for more information.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ClusterName</para>
- </entry>
+ <row>
+ <entry>
+ <para>ClusterName</para>
+ </entry>
- <entry>
- <para>Name of cluster. Needs to be the same for all nodes in a
- cluster in order for them to communicate with each other.
- </para>
- </entry>
- </row>
- <row>
- <entry>
- <para>EvictionPolicyConfig</para>
- </entry>
+ <entry>
+ <para>Name of cluster. Needs to be the same for all nodes in a
+ cluster in order for them to communicate with each other.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>EvictionPolicyConfig</para>
+ </entry>
- <entry>
- <para>Configuration parameter for the specified eviction policy.
- See
- <link linkend="eviction_policies">chapter on eviction policies</link>
- for details. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Configuration parameter for the specified eviction policy.
+ See
+ <link linkend="eviction_policies">chapter on eviction policies</link>
+ for details. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ExposeManagementStatistics</para>
- </entry>
+ <row>
+ <entry>
+ <para>ExposeManagementStatistics</para>
+ </entry>
- <entry>
- <para>
- Specifies whether interceptors that provide statistics should have statistics
- gathering enabled at startup. Also controls whether a
- <literal>CacheMgmtInterceptor</literal>
- (whose sole purpose is gathering
- statistics) should be added to the interceptor chain. Default value is
- <emphasis>true</emphasis>
- . See the
- <link linkend="jmx.statistics">JBoss Cache Statistics section</link>
- section for more details.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>
+ Specifies whether interceptors that provide statistics should have statistics
+ gathering enabled at startup. Also controls whether a
+ <literal>CacheMgmtInterceptor</literal>
+ (whose sole purpose is gathering
+ statistics) should be added to the interceptor chain. Default value is
+ <emphasis>true</emphasis>
+ . See the
+ <link linkend="jmx.statistics">JBoss Cache Statistics section</link>
+ section for more details.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>FetchInMemoryState
- </para>
- </entry>
+ <row>
+ <entry>
+ <para>FetchInMemoryState
+ </para>
+ </entry>
- <entry>
- <para>Whether or not to acquire the initial in-memory state from
- existing members. Allows for hot caches when enabled. Also
- see the
- <literal>fetchPersistentState</literal>
- element in
- <literal>CacheLoaderConfig</literal>
- . Defaults to
- <literal>true</literal>
- . This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Whether or not to acquire the initial in-memory state from
+ existing members. Allows for hot caches when enabled. Also
+ see the
+ <literal>fetchPersistentState</literal>
+ element in
+ <literal>CacheLoaderConfig</literal>
+ . Defaults to
+ <literal>true</literal>
+ . This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>InactiveOnStartup</para>
- </entry>
+ <row>
+ <entry>
+ <para>InactiveOnStartup</para>
+ </entry>
- <entry>
- <para>Whether or not the entire tree is inactive upon startup,
- only responding to replication messages after
- <literal>activateRegion()</literal>
- is called to activate one or
- more parts of the tree. If true, property
- <literal>FetchInMemoryState</literal>
- is ignored. This property
- should only be set to true if
- <literal>UseRegionBasedMarshalling</literal>
- is also
- <literal>true</literal>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Whether or not the entire tree is inactive upon startup,
+ only responding to replication messages after
+ <literal>activateRegion()</literal>
+ is called to activate one or
+ more parts of the tree. If true, property
+ <literal>FetchInMemoryState</literal>
+ is ignored. This property
+ should only be set to true if
+ <literal>UseRegionBasedMarshalling</literal>
+ is also
+ <literal>true</literal>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>StateRetrievalTimeout</para>
- </entry>
+ <row>
+ <entry>
+ <para>StateRetrievalTimeout</para>
+ </entry>
- <entry>
- <para>Time in milliseconds to wait for state
- retrieval. This should be longer than
- <literal>LockAcquisitionTimeout</literal>
- as the node
- providing state may need to wait that long to acquire
- necessary read locks on the cache. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Time in milliseconds to wait for state
+ retrieval. This should be longer than
+ <literal>LockAcquisitionTimeout</literal>
+ as the node
+ providing state may need to wait that long to acquire
+ necessary read locks on the cache. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>IsolationLevel</para>
- </entry>
+ <row>
+ <entry>
+ <para>IsolationLevel</para>
+ </entry>
- <entry>
- <para>Node locking isolation level : SERIALIZABLE, REPEATABLE_READ
- (default), READ_COMMITTED, READ_UNCOMMITTED, and NONE. Note that this is ignored if
- NodeLockingScheme is OPTIMISTIC. Case doesn't matter. See documentation on Transactions and
- Concurrency for more details.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Node locking isolation level : SERIALIZABLE, REPEATABLE_READ
+ (default), READ_COMMITTED, READ_UNCOMMITTED, and NONE. Note that this is ignored if
+ NodeLockingScheme is OPTIMISTIC. Case doesn't matter. See documentation on Transactions
+ and
+ Concurrency for more details.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>LockAcquisitionTimeout</para>
- </entry>
+ <row>
+ <entry>
+ <para>LockAcquisitionTimeout</para>
+ </entry>
- <entry>
- <para>Time in milliseconds to wait for a lock to be acquired. If
- a lock cannot be acquired an exception will be thrown. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Time in milliseconds to wait for a lock to be acquired. If
+ a lock cannot be acquired an exception will be thrown. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>LockParentForChildInsertRemove</para>
- </entry>
+ <row>
+ <entry>
+ <para>LockParentForChildInsertRemove</para>
+ </entry>
- <entry>
- <para>Controls whether inserting or removing a node requires a write
- lock on the node's parent (when pessimistic locking is used) or whether
- it results in an update of the parent node's version (when optimistic
- locking is used). The default value is
- <code>false</code>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Controls whether inserting or removing a node requires a write
+ lock on the node's parent (when pessimistic locking is used) or whether
+ it results in an update of the parent node's version (when optimistic
+ locking is used). The default value is
+ <code>false</code>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>MarshallerClass</para>
- </entry>
+ <row>
+ <entry>
+ <para>MarshallerClass</para>
+ </entry>
- <entry>
- <para>An instance of
- <literal>org.jboss.cache.marshall.Marshaller</literal>
- used to serialize data to byte streams.
- Defaults to
- <literal>org.jboss.cache.marshall.VersionAwareMarshaller</literal>
- if not specified.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>An instance of
+ <literal>org.jboss.cache.marshall.Marshaller</literal>
+ used to serialize data to byte streams.
+ Defaults to
+ <literal>org.jboss.cache.marshall.VersionAwareMarshaller</literal>
+ if not specified.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>MultiplexerService</para>
- </entry>
+ <row>
+ <entry>
+ <para>MultiplexerService</para>
+ </entry>
- <entry>
- <para>The JMX object name of the service that defines the JGroups multiplexer.
- In JBoss AS 5.0 this service is normally defined in the jgroups-multiplexer.sar.
- This XML attribute can only be handled by the JBoss AS MBean deployment services;
- if it is included in a file passed to a
- <literal>CacheFactory</literal>
- the
- factory's creation of the cache will fail. Inside JBoss AS, the attribute should
- be specified using the "depends optional-attribute-name" syntax shown in
- the example above. Inside the AS if this attribute
- is defined, an instance of
- <literal>org.jgroups.jmx.JChannelFactoryMBean</literal>
- will be injected into the
- <literal>CacheJmxWrapper</literal>
- which will use
- it to obtain a multiplexed JGroups channel. The configuration
- of the channel will be that associated with
- <literal>MultiplexerStack</literal>
- .
- The
- <literal>ClusterConfig</literal>
- attribute will be ignored.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>The JMX object name of the service that defines the JGroups multiplexer.
+ In JBoss AS 5.0 this service is normally defined in the jgroups-multiplexer.sar.
+ This XML attribute can only be handled by the JBoss AS MBean deployment services;
+ if it is included in a file passed to a
+ <literal>CacheFactory</literal>
+ the
+ factory's creation of the cache will fail. Inside JBoss AS, the attribute should
+ be specified using the "depends optional-attribute-name" syntax shown in
+ the example above. Inside the AS if this attribute
+ is defined, an instance of
+ <literal>org.jgroups.jmx.JChannelFactoryMBean</literal>
+ will be injected into the
+ <literal>CacheJmxWrapper</literal>
+ which will use
+ it to obtain a multiplexed JGroups channel. The configuration
+ of the channel will be that associated with
+ <literal>MultiplexerStack</literal>
+ .
+ The
+ <literal>ClusterConfig</literal>
+ attribute will be ignored.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>MultiplexerStack</para>
- </entry>
+ <row>
+ <entry>
+ <para>MultiplexerStack</para>
+ </entry>
- <entry>
- <para>The name of the JGroups stack to be used with the cache cluster.
- Stacks are defined in the configuration of the external
- <literal>MultiplexerService</literal>
- discussed above. In JBoss AS 5 this is normally done in the
- jgroups-multiplexer.sar/META-INF/multiplexer-stacks.xml file.
- The default stack is
- <literal>udp</literal>
- . This attribute is used in conjunction with
- <literal>MultiplexerService</literal>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>The name of the JGroups stack to be used with the cache cluster.
+ Stacks are defined in the configuration of the external
+ <literal>MultiplexerService</literal>
+ discussed above. In JBoss AS 5 this is normally done in the
+ jgroups-multiplexer.sar/META-INF/multiplexer-stacks.xml file.
+ The default stack is
+ <literal>udp</literal>
+ . This attribute is used in conjunction with
+ <literal>MultiplexerService</literal>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>NodeLockingScheme</para>
- </entry>
+ <row>
+ <entry>
+ <para>NodeLockingScheme</para>
+ </entry>
- <entry>
- <para>May be PESSIMISTIC (default) or OPTIMISTIC.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>May be PESSIMISTIC (default) or OPTIMISTIC.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ReplicationVersion</para>
- </entry>
- <entry>
- <para>Tells the cache to serialize cluster traffic
- in a format consistent with that used by the given release
- of JBoss Cache. Different JBoss Cache versions use different
- wire formats; setting this attribute tells a cache from a later
- release to serialize data using the format from an earlier
- release. This allows caches from different releases to
- interoperate. For example, a 2.1.0 cache could have this
- value set to "2.0.0", allowing it to interoperate with a 2.0.0
- cache. Valid values are a dot-separated release number, with
- any final qualifer also separated by a dot, e.g. "2.0.0" or "2.0.0.GA".
- Values that indicate a 1.x release are not supported in the 2.x series.
- </para>
- </entry>
- </row>
+ <row>
+ <entry>
+ <para>ReplicationVersion</para>
+ </entry>
+ <entry>
+ <para>Tells the cache to serialize cluster traffic
+ in a format consistent with that used by the given release
+ of JBoss Cache. Different JBoss Cache versions use different
+ wire formats; setting this attribute tells a cache from a later
+ release to serialize data using the format from an earlier
+ release. This allows caches from different releases to
+ interoperate. For example, a 2.1.0 cache could have this
+ value set to "2.0.0", allowing it to interoperate with a 2.0.0
+ cache. Valid values are a dot-separated release number, with
+ any final qualifer also separated by a dot, e.g. "2.0.0" or "2.0.0.GA".
+ Values that indicate a 1.x release are not supported in the 2.x series.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ReplQueueInterval</para>
- </entry>
+ <row>
+ <entry>
+ <para>ReplQueueInterval</para>
+ </entry>
- <entry>
- <para>Time in milliseconds for elements from the replication
- queue to be replicated. Only used if
- <literal>UseReplQueue</literal>
- is enabled. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Time in milliseconds for elements from the replication
+ queue to be replicated. Only used if
+ <literal>UseReplQueue</literal>
+ is enabled. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ReplQueueMaxElements</para>
- </entry>
+ <row>
+ <entry>
+ <para>ReplQueueMaxElements</para>
+ </entry>
- <entry>
- <para>Max number of elements in the replication queue until
- replication kicks in. Only used if
- <literal>UseReplQueue</literal>
- is enabled. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>Max number of elements in the replication queue until
+ replication kicks in. Only used if
+ <literal>UseReplQueue</literal>
+ is enabled. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>SyncCommitPhase</para>
- </entry>
+ <row>
+ <entry>
+ <para>SyncCommitPhase</para>
+ </entry>
- <entry>
- <para>This option is used to control the behaviour of the commit part of a 2-phase commit protocol,
- when
- using REPL_SYNC (does not apply to other cache modes). By default this is set to
- <literal>false</literal>
- . There is a performance penalty to enabling this, especially when running
- in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
- clustered caches for more information on this. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>This option is used to control the behaviour of the commit part of a 2-phase commit
+ protocol,
+ when
+ using REPL_SYNC (does not apply to other cache modes). By default this is set to
+ <literal>false</literal>
+ . There is a performance penalty to enabling this, especially when running
+ in a large cluster, but the upsides are greater cluster-wide data integrity. See the
+ chapter on
+ clustered caches for more information on this. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>SyncReplTimeout</para>
- </entry>
+ <row>
+ <entry>
+ <para>SyncReplTimeout</para>
+ </entry>
- <entry>
- <para>For synchronous replication: time in milliseconds to wait
- until replication acks have been received from all nodes in the
- cluster. It is usually best that this is greater than
- <literal>LockAcquisitionTimeout</literal>
- .
- This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>For synchronous replication: time in milliseconds to wait
+ until replication acks have been received from all nodes in the
+ cluster. It is usually best that this is greater than
+ <literal>LockAcquisitionTimeout</literal>
+ .
+ This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>SyncRollbackPhase</para>
- </entry>
+ <row>
+ <entry>
+ <para>SyncRollbackPhase</para>
+ </entry>
- <entry>
- <para>This option is used to control the behaviour of the rollback part of a 2-phase commit
- protocol, when
- using REPL_SYNC (does not apply to other cache modes). By default this is set to
- <literal>false</literal>
- . There is a performance penalty to enabling this, especially when running
- in a large cluster, but the upsides are greater cluster-wide data integrity. See the chapter on
- clustered caches for more information on this. This property is
- <emphasis>dynamic</emphasis>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>This option is used to control the behaviour of the rollback part of a 2-phase commit
+ protocol, when
+ using REPL_SYNC (does not apply to other cache modes). By default this is set to
+ <literal>false</literal>
+ . There is a performance penalty to enabling this, especially when running
+ in a large cluster, but the upsides are greater cluster-wide data integrity. See the
+ chapter on
+ clustered caches for more information on this. This property is
+ <emphasis>dynamic</emphasis>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>TransactionManagerLookupClass</para>
- </entry>
+ <row>
+ <entry>
+ <para>TransactionManagerLookupClass</para>
+ </entry>
- <entry>
- <para>The fully qualified name of a class implementing
- TransactionManagerLookup. Default is
- JBossTransactionManagerLookup. There is also an option of
- GenericTransactionManagerLookup for example.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>The fully qualified name of a class implementing
+ TransactionManagerLookup. Default is
+ JBossTransactionManagerLookup. There is also an option of
+ GenericTransactionManagerLookup for example.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>UseInterceptorMbeans</para>
- </entry>
+ <row>
+ <entry>
+ <para>UseInterceptorMbeans</para>
+ </entry>
- <entry>
- <para>
- <emphasis>Deprecated</emphasis>
- . Use
- <literal>ExposeManagementStatistics</literal>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>
+ <emphasis>Deprecated</emphasis>
+ . Use
+ <literal>ExposeManagementStatistics</literal>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>UseRegionBasedMarshalling</para>
- </entry>
+ <row>
+ <entry>
+ <para>UseRegionBasedMarshalling</para>
+ </entry>
- <entry>
- <para>When unmarshalling replicated data, this option specifies whether or not to
- support use of different classloaders for different cache regions. This defaults to
- <literal>false</literal>
- if unspecified.
- <p/>
- <b>DEPRECATED.</b>
- This option will disappear in JBoss Cache 3.x. See
- <literal>UseLazyDeserialization</literal>
- instead.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>When unmarshalling replicated data, this option specifies whether or not to
+ support use of different classloaders for different cache regions. This defaults to
+ <literal>false</literal>
+ if unspecified.
+ <p/>
+ <b>DEPRECATED.</b>
+ This option will disappear in JBoss Cache 3.x. See
+ <literal>UseLazyDeserialization</literal>
+ instead.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>UseReplQueue</para>
- </entry>
+ <row>
+ <entry>
+ <para>UseReplQueue</para>
+ </entry>
- <entry>
- <para>For asynchronous replication: whether or not to use a
- replication queue. Defaults to
- <literal>false</literal>
- .
- </para>
- </entry>
- </row>
+ <entry>
+ <para>For asynchronous replication: whether or not to use a
+ replication queue. Defaults to
+ <literal>false</literal>
+ .
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ShutdownHookBehavior</para>
- </entry>
+ <row>
+ <entry>
+ <para>ShutdownHookBehavior</para>
+ </entry>
- <entry>
- <para>An optional parameter that controls whether JBoss Cache registers a shutdown hook with the
- JVM
- runtime. Allowed values are<literal>DEFAULT</literal>,
- <literal>REGISTER</literal>
- and
- <literal>DONT_REGISTER</literal>.
- <literal>REGISTER</literal>
- and
- <literal>DONT_REGISTER</literal>
- forces or suppresses the registration of a shutdown hook, respectively, and
- <literal>DEFAULT</literal>
- registers one if an MBean server (other than the JDK default) cannot be found and it is assumed
- that the
- cache is running in a managed environment. The default if unspecified is, as expected,<literal>
- DEFAULT</literal>.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>An optional parameter that controls whether JBoss Cache registers a shutdown hook with
+ the
+ JVM
+ runtime. Allowed values are<literal>DEFAULT</literal>,
+ <literal>REGISTER</literal>
+ and
+ <literal>DONT_REGISTER</literal>.
+ <literal>REGISTER</literal>
+ and
+ <literal>DONT_REGISTER</literal>
+ forces or suppresses the registration of a shutdown hook, respectively, and
+ <literal>DEFAULT</literal>
+ registers one if an MBean server (other than the JDK default) cannot be found and it is
+ assumed
+ that the
+ cache is running in a managed environment. The default if unspecified is, as expected,
+ <literal>
+ DEFAULT</literal>.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>UseLazyDeserialization</para>
- </entry>
+ <row>
+ <entry>
+ <para>UseLazyDeserialization</para>
+ </entry>
- <entry>
- <para>An optional parameter that can be used to enable or disable the use of lazy deserialization
- for cached objects. Defaults to<literal>false</literal>, since it adds a small processing
- overhead.
- If lazy deserialization is disabled, support for implicitly using context class loaders
- registered
- with the calling thread goes away.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>An optional parameter that can be used to enable or disable the use of lazy
+ deserialization
+ for cached objects. Defaults to<literal>false</literal>, since it adds a small
+ processing
+ overhead.
+ If lazy deserialization is disabled, support for implicitly using context class loaders
+ registered
+ with the calling thread goes away.
+ </para>
+ </entry>
+ </row>
- <row>
- <entry>
- <para>ObjectInputStreamPoolSize and ObjectOutputStreamPoolSize</para>
- </entry>
+ <row>
+ <entry>
+ <para>ObjectInputStreamPoolSize and ObjectOutputStreamPoolSize</para>
+ </entry>
- <entry>
- <para>
- Since JBoss Cache 2.1.0, object input and output streams - used to serialize and deserialize RPC
- calls in a cluster - are pooled to reduce the overhead of constructing such streams. They are
- reused
- by making use of special resettable stream implementations.
- </para>
- <para>
- by default, these stream pools are set at
- <literal>50</literal>
- objects each. You could increase or decrease the pool
- size if, while profiling, you see a lot of threads blocking on
- <literal>ObjectStreamPool.getInputStream()</literal>
- or<literal>ObjectStreamPool.getOutputStream()</literal>. In general, having more streams is
- better
- than having fewer than needed. Based on your application, make sure you have more streams
- available
- than number of threads you expect to concurrently write to the cache.
- </para>
- </entry>
- </row>
+ <entry>
+ <para>
+ Since JBoss Cache 2.1.0, object input and output streams - used to serialize and
+ deserialize RPC
+ calls in a cluster - are pooled to reduce the overhead of constructing such streams.
+ They are
+ reused
+ by making use of special resettable stream implementations.
+ </para>
+ <para>
+ by default, these stream pools are set at
+ <literal>50</literal>
+ objects each. You could increase or decrease the pool
+ size if, while profiling, you see a lot of threads blocking on
+ <literal>ObjectStreamPool.getInputStream()</literal>
+ or<literal>ObjectStreamPool.getOutputStream()</literal>. In general, having more streams
+ is
+ better
+ than having fewer than needed. Based on your application, make sure you have more
+ streams
+ available
+ than number of threads you expect to concurrently write to the cache.
+ </para>
+ </entry>
+ </row>
- </tbody>
- </tgroup>
- </informaltable>
- </section>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </section>
</chapter>
\ No newline at end of file
Modified: core/branches/flat/src/main/java/org/jboss/cache/AbstractNode.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/AbstractNode.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/AbstractNode.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -24,7 +24,7 @@
import static org.jboss.cache.AbstractNode.NodeFlags.REMOVED;
import static org.jboss.cache.AbstractNode.NodeFlags.RESIDENT;
import org.jboss.cache.lock.IdentityLock;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/CacheSPI_Legacy.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/CacheSPI_Legacy.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/CacheSPI_Legacy.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -28,11 +28,11 @@
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.factories.ComponentRegistry;
import org.jboss.starobrno.notifications.Notifier;
import org.jboss.starobrno.statetransfer.StateTransferManager;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import javax.transaction.Transaction;
Modified: core/branches/flat/src/main/java/org/jboss/cache/InternalNode.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/InternalNode.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/InternalNode.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -22,7 +22,7 @@
package org.jboss.cache;
import org.jboss.cache.lock.NodeLock;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/InvocationContext.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/InvocationContext.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/InvocationContext.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -26,10 +26,10 @@
import org.jboss.cache.annotations.Compat;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.marshall.MethodCall;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.config.Option;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.util.Immutables;
Modified: core/branches/flat/src/main/java/org/jboss/cache/NodeSPI.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/NodeSPI.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/NodeSPI.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,7 +23,7 @@
import net.jcip.annotations.NotThreadSafe;
import org.jboss.cache.lock.NodeLock;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -33,7 +33,6 @@
import org.jboss.cache.marshall.CommandAwareRpcDispatcher;
import org.jboss.cache.marshall.Marshaller;
import org.jboss.cache.remoting.jgroups.ChannelMessageListener;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.starobrno.CacheException;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.config.RuntimeConfig;
@@ -45,6 +44,7 @@
import org.jboss.starobrno.notifications.Notifier;
import org.jboss.starobrno.remoting.SuspectException;
import org.jboss.starobrno.statetransfer.DefaultStateTransferManager;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.transaction.TransactionTable;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.util.ReflectionUtil;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactory.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -28,7 +28,7 @@
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.*;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import org.jgroups.Address;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/CommandsFactoryImpl.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -34,12 +34,12 @@
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.commands.write.*;
import org.jboss.cache.interceptors.InterceptorChain;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.CacheException;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.notifications.Notifier;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import org.jgroups.Address;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/WriteCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/WriteCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/WriteCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -21,7 +21,7 @@
*/
package org.jboss.cache.commands;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
/**
* A write command that has a reference to a {@link org.jboss.cache.transaction.GlobalTransaction}.
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -32,8 +32,8 @@
import org.jboss.cache.commands.write.EvictCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.interceptors.InterceptorChain;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.List;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/tx/AbstractTransactionCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,7 +23,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.VisitableCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
/**
* Base class for transaction boundary commands that deal with global transactions
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,7 +23,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
/**
* Represents a commit() call, the 2nd part of a 2-phase commit.
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -25,7 +25,7 @@
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.commands.WriteCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jgroups.Address;
import java.util.ArrayList;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,7 +23,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
/**
* The rollback phase of a 2-phase commit.
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/AbstractVersionedDataCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -26,8 +26,8 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.VersionedDataCommand;
import org.jboss.cache.commands.read.AbstractDataCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.starobrno.notifications.Notifier;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
/**
@@ -106,4 +106,4 @@
{
throw new UnsupportedOperationException();
}
-}
\ No newline at end of file
+}
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/ClearDataCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -26,7 +26,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/MoveCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/MoveCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -30,8 +30,8 @@
import org.jboss.cache.commands.Visitor;
import org.jboss.cache.commands.WriteCommand;
import org.jboss.cache.commands.read.AbstractDataCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.starobrno.notifications.Notifier;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutDataMapCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -27,7 +27,7 @@
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutForExternalReadCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutForExternalReadCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutForExternalReadCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,7 +23,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
/**
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/PutKeyValueCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -27,7 +27,7 @@
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Collections;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveKeyCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -26,7 +26,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Collections;
Modified: core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/commands/write/RemoveNodeCommand.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -26,7 +26,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.Visitor;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Map;
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/ActivationInterceptor.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -33,10 +33,10 @@
import org.jboss.cache.commands.write.*;
import org.jboss.cache.jmx.annotations.ManagedAttribute;
import org.jboss.cache.jmx.annotations.ManagedOperation;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.factories.annotations.Start;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import javax.transaction.SystemException;
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -24,17 +24,17 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.RPCManager;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.starobrno.cluster.ReplicationQueue;
import org.jboss.cache.commands.CommandsFactory;
import org.jboss.cache.commands.ReplicableCommand;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.interceptors.base.CommandInterceptor;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.cache.transaction.TransactionTable;
+import org.jboss.starobrno.cluster.ReplicationQueue;
import org.jboss.starobrno.config.Option;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.factories.annotations.Start;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jgroups.Address;
import javax.transaction.Transaction;
@@ -214,4 +214,4 @@
}
return false;
}
-}
\ No newline at end of file
+}
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -23,11 +23,11 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.interceptors.base.CommandInterceptor;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.config.Option;
import org.jboss.starobrno.factories.annotations.Inject;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import javax.transaction.Status;
import javax.transaction.SystemException;
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -37,11 +37,11 @@
import org.jboss.cache.jmx.annotations.ManagedOperation;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.starobrno.config.CacheLoaderConfig;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.factories.annotations.Start;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import javax.transaction.SystemException;
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor_Legacy.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor_Legacy.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor_Legacy.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -32,12 +32,12 @@
import org.jboss.cache.commands.write.*;
import org.jboss.cache.jmx.annotations.ManagedAttribute;
import org.jboss.cache.jmx.annotations.ManagedOperation;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.config.Option;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.factories.annotations.Start;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import javax.transaction.SystemException;
Modified: core/branches/flat/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -27,16 +27,10 @@
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.write.ClearDataCommand;
-import org.jboss.cache.commands.write.MoveCommand;
-import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.commands.write.PutForExternalReadCommand;
-import org.jboss.cache.commands.write.PutKeyValueCommand;
-import org.jboss.cache.commands.write.RemoveKeyCommand;
-import org.jboss.cache.commands.write.RemoveNodeCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.commands.write.*;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.GlobalTransaction;
/**
* Takes care of replicating modifications to other nodes in a cluster. Also
Modified: core/branches/flat/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -32,7 +32,6 @@
import org.jboss.cache.interceptors.base.CommandInterceptor;
import org.jboss.cache.loader.CacheLoaderManager;
import org.jboss.cache.marshall.Marshaller;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.CacheException;
import org.jboss.starobrno.batch.BatchContainer;
@@ -44,6 +43,7 @@
import org.jboss.starobrno.factories.annotations.NonVolatile;
import org.jboss.starobrno.notifications.Notifier;
import org.jboss.starobrno.statetransfer.StateTransferManager;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.util.Immutables;
import org.jgroups.Address;
Modified: core/branches/flat/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/invocation/NodeInvocationDelegate.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -25,9 +25,9 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.*;
import org.jboss.cache.lock.NodeLock;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.starobrno.CacheException;
import org.jboss.starobrno.config.Option;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.Collections;
Modified: core/branches/flat/src/main/java/org/jboss/cache/lock/LockUtil.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/lock/LockUtil.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -27,9 +27,9 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.CommandsFactory;
import org.jboss.cache.commands.write.PutDataMapCommand;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionContext;
import org.jboss.cache.transaction.TransactionTable;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import javax.transaction.Status;
Modified: core/branches/flat/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/lock/PessimisticNodeBasedLockManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -27,10 +27,10 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.CommandsFactory;
import static org.jboss.cache.lock.LockType.WRITE;
-import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionTable;
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.lock.TimeoutException;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jboss.starobrno.tree.Fqn;
import java.util.List;
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/BatchModeTransactionManager.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/BatchModeTransactionManager.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/BatchModeTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * Not really a transaction manager in the truest sense of the word. Only used to batch up operations. Proper
- * transactional symantics of rollbacks and recovery are NOT used here. This is used by PojoCache.
- *
- * @author bela
- * @version $Revision$
- * Date: May 15, 2003
- * Time: 4:11:37 PM
- */
-public class BatchModeTransactionManager extends DummyBaseTransactionManager
-{
- static BatchModeTransactionManager instance = null;
- static Log log = LogFactory.getLog(BatchModeTransactionManager.class);
- private static final long serialVersionUID = 5656602677430350961L;
-
- public static BatchModeTransactionManager getInstance()
- {
- if (instance == null)
- {
- instance = new BatchModeTransactionManager();
- }
- return instance;
- }
-
- public static void destroy()
- {
- if (instance == null) return;
- instance.setTransaction(null);
- instance = null;
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,256 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-/**
- * @author bela
- * @version $Revision$
- * Date: May 15, 2003
- * Time: 4:11:37 PM
- */
-public class DummyBaseTransactionManager implements TransactionManager, java.io.Serializable
-{
- static ThreadLocal<Transaction> thread_local = new ThreadLocal<Transaction>();
- private static final long serialVersionUID = -6716097342564237376l;
- private static final Log log = LogFactory.getLog(DummyBaseTransactionManager.class);
- private static final boolean trace = log.isTraceEnabled();
-
- /**
- * Starts a new transaction, and associate it with the calling thread.
- *
- * @throws javax.transaction.NotSupportedException
- * If the calling thread is already
- * associated with a transaction, and nested transactions are
- * not supported.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public void begin() throws NotSupportedException, SystemException
- {
- Transaction currentTx;
- if ((currentTx = getTransaction()) != null)
- throw new NotSupportedException(Thread.currentThread() +
- " is already associated with a transaction (" + currentTx + ")");
- DummyTransaction tx = new DummyTransaction(this);
- setTransaction(tx);
- }
-
- /**
- * Commit the transaction associated with the calling thread.
- *
- * @throws javax.transaction.RollbackException
- * If the transaction was marked for rollback
- * only, the transaction is rolled back and this exception is
- * thrown.
- * @throws IllegalStateException If the calling thread is not associated
- * with a transaction.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- * @throws javax.transaction.HeuristicMixedException
- * If a heuristic decision was made and
- * some some parts of the transaction have been committed while
- * other parts have been rolled back.
- * @throws javax.transaction.HeuristicRollbackException
- * If a heuristic decision to roll
- * back the transaction was made.
- * @throws SecurityException If the caller is not allowed to commit this
- * transaction.
- */
- public void commit() throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException,
- IllegalStateException, SystemException
- {
- int status;
- Transaction tx = getTransaction();
- if (tx == null)
- throw new IllegalStateException("thread not associated with transaction");
- status = tx.getStatus();
- if (status == Status.STATUS_MARKED_ROLLBACK)
- throw new RollbackException();
- tx.commit();
-
- // Disassociate tx from thread.
- setTransaction(null);
- }
-
- /**
- * Rolls back the transaction associated with the calling thread.
- *
- * @throws IllegalStateException If the transaction is in a state
- * where it cannot be rolled back. This could be because the
- * calling thread is not associated with a transaction, or
- * because it is in the
- * {@link javax.transaction.Status#STATUS_PREPARED prepared state}.
- * @throws SecurityException If the caller is not allowed to roll back
- * this transaction.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public void rollback() throws IllegalStateException, SecurityException,
- SystemException
- {
- Transaction tx = getTransaction();
- if (tx == null)
- throw new IllegalStateException("no transaction associated with thread");
- tx.rollback();
-
- // Disassociate tx from thread.
- setTransaction(null);
- }
-
- /**
- * Mark the transaction associated with the calling thread for rollback
- * only.
- *
- * @throws IllegalStateException If the transaction is in a state
- * where it cannot be rolled back. This could be because the
- * calling thread is not associated with a transaction, or
- * because it is in the
- * {@link javax.transaction.Status#STATUS_PREPARED prepared state}.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public void setRollbackOnly() throws IllegalStateException, SystemException
- {
- Transaction tx = getTransaction();
- if (tx == null)
- throw new IllegalStateException("no transaction associated with calling thread");
- tx.setRollbackOnly();
- }
-
- /**
- * Get the status of the transaction associated with the calling thread.
- *
- * @return The status of the transaction. This is one of the
- * {@link javax.transaction.Status} constants. If no transaction is associated
- * with the calling thread,
- * {@link javax.transaction.Status#STATUS_NO_TRANSACTION} is returned.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public int getStatus() throws SystemException
- {
- Transaction tx = getTransaction();
- return tx != null ? tx.getStatus() : Status.STATUS_NO_TRANSACTION;
- }
-
- /**
- * Get the transaction associated with the calling thread.
- *
- * @return The transaction associated with the calling thread, or
- * <code>null</code> if the calling thread is not associated
- * with a transaction.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public Transaction getTransaction() throws SystemException
- {
- return thread_local.get();
- }
-
- /**
- * Change the transaction timeout for transactions started by the calling
- * thread with the {@link #begin()} method.
- *
- * @param seconds The new timeout value, in seconds. If this parameter
- * is <code>0</code>, the timeout value is reset to the default
- * value.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public void setTransactionTimeout(int seconds) throws SystemException
- {
- throw new SystemException("not supported");
- }
-
- /**
- * Suspend the association the calling thread has to a transaction,
- * and return the suspended transaction.
- * When returning from this method, the calling thread is no longer
- * associated with a transaction.
- *
- * @return The transaction that the calling thread was associated with,
- * or <code>null</code> if the calling thread was not associated
- * with a transaction.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public Transaction suspend() throws SystemException
- {
- Transaction retval = getTransaction();
- setTransaction(null);
- if (trace) log.trace("Suspending tx " + retval);
- return retval;
- }
-
- /**
- * Resume the association of the calling thread with the given
- * transaction.
- *
- * @param tx The transaction to be associated with the calling thread.
- * @throws javax.transaction.InvalidTransactionException
- * If the argument does not represent
- * a valid transaction.
- * @throws IllegalStateException If the calling thread is already
- * associated with a transaction.
- * @throws javax.transaction.SystemException
- * If the transaction service fails in an
- * unexpected way.
- */
- public void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException
- {
- if (trace) log.trace("Resuming tx " + tx);
- setTransaction(tx);
- }
-
- /**
- * Just used for unit tests
- *
- * @param tx
- */
- public void setTransaction(Transaction tx)
- {
- thread_local.set(tx);
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContext.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContext.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContext.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,602 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import javax.naming.Binding;
-import javax.naming.CompoundName;
-import javax.naming.Context;
-import javax.naming.ContextNotEmptyException;
-import javax.naming.Name;
-import javax.naming.NameAlreadyBoundException;
-import javax.naming.NameClassPair;
-import javax.naming.NameNotFoundException;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.NotContextException;
-import javax.naming.OperationNotSupportedException;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.InvalidAttributesException;
-import java.util.HashMap;
-import java.util.Hashtable;
-
-/**
- * @author bela
- * Date: May 15, 2003
- * Time: 6:21:37 PM
- */
-public class DummyContext implements Context
-{
-
- HashMap<String, Object> bindings = new HashMap<String, Object>();
-
- /**
- * Retrieves the named object.
- * If <tt>name</tt> is empty, returns a new instance of this context
- * (which represents the same naming context as this context, but its
- * environment may be modified independently and it may be accessed
- * concurrently).
- *
- * @param name the name of the object to look up
- * @return the object bound to <tt>name</tt>
- * @throws NamingException if a naming exception is encountered
- * @see #lookup(String)
- * @see #lookupLink(Name)
- */
- public Object lookup(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the named object.
- * See {@link #lookup(Name)} for details.
- *
- * @param name the name of the object to look up
- * @return the object bound to <tt>name</tt>
- * @throws NamingException if a naming exception is encountered
- */
- public Object lookup(String name) throws NamingException
- {
- return bindings.get(name);
- }
-
- /**
- * Binds a name to an object.
- * All intermediate contexts and the target context (that named by all
- * but terminal atomic component of the name) must already exist.
- *
- * @param name the name to bind; may not be empty
- * @param obj the object to bind; possibly null
- * @throws NameAlreadyBoundException if name is already bound
- * @throws InvalidAttributesException if object did not supply all mandatory attributes
- * @throws NamingException if a naming exception is encountered
- * @see #bind(String,Object)
- * @see #rebind(Name,Object)
- * @see DirContext#bind(Name,Object,
- * Attributes)
- */
- public void bind(Name name, Object obj) throws NamingException
- {
- }
-
- /**
- * Binds a name to an object.
- * See {@link #bind(Name,Object)} for details.
- *
- * @param name the name to bind; may not be empty
- * @param obj the object to bind; possibly null
- * @throws NameAlreadyBoundException if name is already bound
- * @throws InvalidAttributesException if object did not supply all mandatory attributes
- * @throws NamingException if a naming exception is encountered
- */
- public void bind(String name, Object obj) throws NamingException
- {
- bindings.put(name, obj);
- }
-
- /**
- * Binds a name to an object, overwriting any existing binding.
- * All intermediate contexts and the target context (that named by all
- * but terminal atomic component of the name) must already exist.
- * <p/>
- * <p> If the object is a <tt>DirContext</tt>, any existing attributes
- * associated with the name are replaced with those of the object.
- * Otherwise, any existing attributes associated with the name remain
- * unchanged.
- *
- * @param name the name to bind; may not be empty
- * @param obj the object to bind; possibly null
- * @throws InvalidAttributesException if object did not supply all mandatory attributes
- * @throws NamingException if a naming exception is encountered
- * @see #rebind(String,Object)
- * @see #bind(Name,Object)
- * @see DirContext#rebind(Name,Object,
- * Attributes)
- * @see DirContext
- */
- public void rebind(Name name, Object obj) throws NamingException
- {
- }
-
- /**
- * Binds a name to an object, overwriting any existing binding.
- * See {@link #rebind(Name,Object)} for details.
- *
- * @param name the name to bind; may not be empty
- * @param obj the object to bind; possibly null
- * @throws InvalidAttributesException if object did not supply all mandatory attributes
- * @throws NamingException if a naming exception is encountered
- */
- public void rebind(String name, Object obj) throws NamingException
- {
- bindings.put(name, obj);
- }
-
- /**
- * Unbinds the named object.
- * Removes the terminal atomic name in <code>name</code>
- * from the target context--that named by all but the terminal
- * atomic part of <code>name</code>.
- * <p/>
- * <p> This method is idempotent.
- * It succeeds even if the terminal atomic name
- * is not bound in the target context, but throws
- * <tt>NameNotFoundException</tt>
- * if any of the intermediate contexts do not exist.
- * <p/>
- * <p> Any attributes associated with the name are removed.
- * Intermediate contexts are not changed.
- *
- * @param name the name to unbind; may not be empty
- * @throws NameNotFoundException if an intermediate context does not exist
- * @throws NamingException if a naming exception is encountered
- * @see #unbind(String)
- */
- public void unbind(Name name) throws NamingException
- {
- }
-
- /**
- * Unbinds the named object.
- * See {@link #unbind(Name)} for details.
- *
- * @param name the name to unbind; may not be empty
- * @throws NameNotFoundException if an intermediate context does not exist
- * @throws NamingException if a naming exception is encountered
- */
- public void unbind(String name) throws NamingException
- {
- bindings.remove(name);
- }
-
- /**
- * Binds a new name to the object bound to an old name, and unbinds
- * the old name. Both names are relative to this context.
- * Any attributes associated with the old name become associated
- * with the new name.
- * Intermediate contexts of the old name are not changed.
- *
- * @param oldName the name of the existing binding; may not be empty
- * @param newName the name of the new binding; may not be empty
- * @throws NameAlreadyBoundException if <tt>newName</tt> is already bound
- * @throws NamingException if a naming exception is encountered
- * @see #rename(String,String)
- * @see #bind(Name,Object)
- * @see #rebind(Name,Object)
- */
- public void rename(Name oldName, Name newName) throws NamingException
- {
- }
-
- /**
- * Binds a new name to the object bound to an old name, and unbinds
- * the old name.
- * See {@link #rename(Name,Name)} for details.
- *
- * @param oldName the name of the existing binding; may not be empty
- * @param newName the name of the new binding; may not be empty
- * @throws NameAlreadyBoundException if <tt>newName</tt> is already bound
- * @throws NamingException if a naming exception is encountered
- */
- public void rename(String oldName, String newName) throws NamingException
- {
- }
-
- /**
- * Enumerates the names bound in the named context, along with the
- * class names of objects bound to them.
- * The contents of any subcontexts are not included.
- * <p/>
- * <p> If a binding is added to or removed from this context,
- * its effect on an enumeration previously returned is undefined.
- *
- * @param name the name of the context to list
- * @return an enumeration of the names and class names of the
- * bindings in this context. Each element of the
- * enumeration is of type <tt>NameClassPair</tt>.
- * @throws NamingException if a naming exception is encountered
- * @see #list(String)
- * @see #listBindings(Name)
- * @see NameClassPair
- */
- public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Enumerates the names bound in the named context, along with the
- * class names of objects bound to them.
- * See {@link #list(Name)} for details.
- *
- * @param name the name of the context to list
- * @return an enumeration of the names and class names of the
- * bindings in this context. Each element of the
- * enumeration is of type <tt>NameClassPair</tt>.
- * @throws NamingException if a naming exception is encountered
- */
- public NamingEnumeration<NameClassPair> list(String name) throws NamingException
- {
- return null;
- }
-
- /**
- * Enumerates the names bound in the named context, along with the
- * objects bound to them.
- * The contents of any subcontexts are not included.
- * <p/>
- * <p> If a binding is added to or removed from this context,
- * its effect on an enumeration previously returned is undefined.
- *
- * @param name the name of the context to list
- * @return an enumeration of the bindings in this context.
- * Each element of the enumeration is of type
- * <tt>Binding</tt>.
- * @throws NamingException if a naming exception is encountered
- * @see #listBindings(String)
- * @see #list(Name)
- * @see Binding
- */
- public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Enumerates the names bound in the named context, along with the
- * objects bound to them.
- * See {@link #listBindings(Name)} for details.
- *
- * @param name the name of the context to list
- * @return an enumeration of the bindings in this context.
- * Each element of the enumeration is of type
- * <tt>Binding</tt>.
- * @throws NamingException if a naming exception is encountered
- */
- public NamingEnumeration<Binding> listBindings(String name) throws NamingException
- {
- return null;
- }
-
- /**
- * Destroys the named context and removes it from the namespace.
- * Any attributes associated with the name are also removed.
- * Intermediate contexts are not destroyed.
- * <p/>
- * <p> This method is idempotent.
- * It succeeds even if the terminal atomic name
- * is not bound in the target context, but throws
- * <tt>NameNotFoundException</tt>
- * if any of the intermediate contexts do not exist.
- * <p/>
- * <p> In a federated naming system, a context from one naming system
- * may be bound to a name in another. One can subsequently
- * look up and perform operations on the foreign context using a
- * composite name. However, an attempt destroy the context using
- * this composite name will fail with
- * <tt>NotContextException</tt>, because the foreign context is not
- * a "subcontext" of the context in which it is bound.
- * Instead, use <tt>unbind()</tt> to remove the
- * binding of the foreign context. Destroying the foreign context
- * requires that the <tt>destroySubcontext()</tt> be performed
- * on a context from the foreign context's "native" naming system.
- *
- * @param name the name of the context to be destroyed; may not be empty
- * @throws NameNotFoundException if an intermediate context does not exist
- * @throws NotContextException if the name is bound but does not name a
- * context, or does not name a context of the appropriate type
- * @throws ContextNotEmptyException if the named context is not empty
- * @throws NamingException if a naming exception is encountered
- * @see #destroySubcontext(String)
- */
- public void destroySubcontext(Name name) throws NamingException
- {
- }
-
- /**
- * Destroys the named context and removes it from the namespace.
- * See {@link #destroySubcontext(Name)} for details.
- *
- * @param name the name of the context to be destroyed; may not be empty
- * @throws NameNotFoundException if an intermediate context does not exist
- * @throws NotContextException if the name is bound but does not name a
- * context, or does not name a context of the appropriate type
- * @throws ContextNotEmptyException if the named context is not empty
- * @throws NamingException if a naming exception is encountered
- */
- public void destroySubcontext(String name) throws NamingException
- {
- }
-
- /**
- * Creates and binds a new context.
- * Creates a new context with the given name and binds it in
- * the target context (that named by all but terminal atomic
- * component of the name). All intermediate contexts and the
- * target context must already exist.
- *
- * @param name the name of the context to create; may not be empty
- * @return the newly created context
- * @throws NameAlreadyBoundException if name is already bound
- * @throws InvalidAttributesException if creation of the subcontext requires specification of
- * mandatory attributes
- * @throws NamingException if a naming exception is encountered
- * @see #createSubcontext(String)
- * @see DirContext#createSubcontext
- */
- public Context createSubcontext(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Creates and binds a new context.
- * See {@link #createSubcontext(Name)} for details.
- *
- * @param name the name of the context to create; may not be empty
- * @return the newly created context
- * @throws NameAlreadyBoundException if name is already bound
- * @throws InvalidAttributesException if creation of the subcontext requires specification of
- * mandatory attributes
- * @throws NamingException if a naming exception is encountered
- */
- public Context createSubcontext(String name) throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the named object, following links except
- * for the terminal atomic component of the name.
- * If the object bound to <tt>name</tt> is not a link,
- * returns the object itself.
- *
- * @param name the name of the object to look up
- * @return the object bound to <tt>name</tt>, not following the
- * terminal link (if any).
- * @throws NamingException if a naming exception is encountered
- * @see #lookupLink(String)
- */
- public Object lookupLink(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the named object, following links except
- * for the terminal atomic component of the name.
- * See {@link #lookupLink(Name)} for details.
- *
- * @param name the name of the object to look up
- * @return the object bound to <tt>name</tt>, not following the
- * terminal link (if any)
- * @throws NamingException if a naming exception is encountered
- */
- public Object lookupLink(String name) throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the parser associated with the named context.
- * In a federation of namespaces, different naming systems will
- * parse names differently. This method allows an application
- * to get a parser for parsing names into their atomic components
- * using the naming convention of a particular naming system.
- * Within any single naming system, <tt>NameParser</tt> objects
- * returned by this method must be equal (using the <tt>equals()</tt>
- * test).
- *
- * @param name the name of the context from which to get the parser
- * @return a name parser that can parse compound names into their atomic
- * components
- * @throws NamingException if a naming exception is encountered
- * @see #getNameParser(String)
- * @see CompoundName
- */
- public NameParser getNameParser(Name name) throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the parser associated with the named context.
- * See {@link #getNameParser(Name)} for details.
- *
- * @param name the name of the context from which to get the parser
- * @return a name parser that can parse compound names into their atomic
- * components
- * @throws NamingException if a naming exception is encountered
- */
- public NameParser getNameParser(String name) throws NamingException
- {
- return null;
- }
-
- /**
- * Composes the name of this context with a name relative to
- * this context.
- * Given a name (<code>name</code>) relative to this context, and
- * the name (<code>prefix</code>) of this context relative to one
- * of its ancestors, this method returns the composition of the
- * two names using the syntax appropriate for the naming
- * system(s) involved. That is, if <code>name</code> names an
- * object relative to this context, the result is the name of the
- * same object, but relative to the ancestor context. None of the
- * names may be null.
- * <p/>
- * For example, if this context is named "wiz.com" relative
- * to the initial context, then
- * <pre>
- * composeName("east", "wiz.com") </pre>
- * might return <code>"east.wiz.com"</code>.
- * If instead this context is named "org/research", then
- * <pre>
- * composeName("user/jane", "org/research") </pre>
- * might return <code>"org/research/user/jane"</code> while
- * <pre>
- * composeName("user/jane", "research") </pre>
- * returns <code>"research/user/jane"</code>.
- *
- * @param name a name relative to this context
- * @param prefix the name of this context relative to one of its ancestors
- * @return the composition of <code>prefix</code> and <code>name</code>
- * @throws NamingException if a naming exception is encountered
- * @see #composeName(String,String)
- */
- public Name composeName(Name name, Name prefix) throws NamingException
- {
- return null;
- }
-
- /**
- * Composes the name of this context with a name relative to
- * this context.
- * See {@link #composeName(Name,Name)} for details.
- *
- * @param name a name relative to this context
- * @param prefix the name of this context relative to one of its ancestors
- * @return the composition of <code>prefix</code> and <code>name</code>
- * @throws NamingException if a naming exception is encountered
- */
- public String composeName(String name, String prefix)
- throws NamingException
- {
- return null;
- }
-
- /**
- * Adds a new environment property to the environment of this
- * context. If the property already exists, its value is overwritten.
- * See class description for more details on environment properties.
- *
- * @param propName the name of the environment property to add; may not be null
- * @param propVal the value of the property to add; may not be null
- * @return the previous value of the property, or null if the property was
- * not in the environment before
- * @throws NamingException if a naming exception is encountered
- * @see #getEnvironment()
- * @see #removeFromEnvironment(String)
- */
- public Object addToEnvironment(String propName, Object propVal)
- throws NamingException
- {
- return null;
- }
-
- /**
- * Removes an environment property from the environment of this
- * context. See class description for more details on environment
- * properties.
- *
- * @param propName the name of the environment property to remove; may not be null
- * @return the previous value of the property, or null if the property was
- * not in the environment
- * @throws NamingException if a naming exception is encountered
- * @see #getEnvironment()
- * @see #addToEnvironment(String,Object)
- */
- public Object removeFromEnvironment(String propName)
- throws NamingException
- {
- return null;
- }
-
- /**
- * Retrieves the environment in effect for this context.
- * See class description for more details on environment properties.
- * <p/>
- * <p> The caller should not make any changes to the object returned:
- * their effect on the context is undefined.
- * The environment of this context may be changed using
- * <tt>addToEnvironment()</tt> and <tt>removeFromEnvironment()</tt>.
- *
- * @return the environment of this context; never null
- * @throws NamingException if a naming exception is encountered
- * @see #addToEnvironment(String,Object)
- * @see #removeFromEnvironment(String)
- */
- public Hashtable<?, ?> getEnvironment() throws NamingException
- {
- return null;
- }
-
- /**
- * Closes this context.
- * This method releases this context's resources immediately, instead of
- * waiting for them to be released automatically by the garbage collector.
- * <p/>
- * <p> This method is idempotent: invoking it on a context that has
- * already been closed has no effect. Invoking any other method
- * on a closed context is not allowed, and results in undefined behaviour.
- *
- * @throws NamingException if a naming exception is encountered
- */
- public void close() throws NamingException
- {
- }
-
- /**
- * Retrieves the full name of this context within its own namespace.
- * <p/>
- * <p> Many naming services have a notion of a "full name" for objects
- * in their respective namespaces. For example, an LDAP entry has
- * a distinguished name, and a DNS record has a fully qualified name.
- * This method allows the client application to retrieve this name.
- * The string returned by this method is not a JNDI composite name
- * and should not be passed directly to context methods.
- * In naming systems for which the notion of full name does not
- * make sense, <tt>OperationNotSupportedException</tt> is thrown.
- *
- * @return this context's name in its own namespace; never null
- * @throws OperationNotSupportedException if the naming system does
- * not have the notion of a full name
- * @throws NamingException if a naming exception is encountered
- * @since 1.3
- */
- public String getNameInNamespace() throws NamingException
- {
- return null;
- }
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContextFactory.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContextFactory.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyContextFactory.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Hashtable;
-
-/**
- * @author bela
- * Date: May 15, 2003
- * Time: 6:22:02 PM
- */
-public class DummyContextFactory implements InitialContextFactory
-{
-
- static Context instance = null;
-
- /**
- * Creates an Initial Context for beginning name resolution.
- * Special requirements of this context are supplied
- * using <code>environment</code>.
- * <p/>
- * The environment parameter is owned by the caller.
- * The implementation will not modify the object or keep a reference
- * to it, although it may keep a reference to a clone or copy.
- *
- * @param environment The possibly null environment
- * specifying information to be used in the creation
- * of the initial context.
- * @return A non-null initial context object that implements the Context
- * interface.
- * @throws NamingException If cannot create an initial context.
- */
- public Context getInitialContext(Hashtable environment) throws NamingException
- {
- if (instance == null)
- instance = new DummyContext();
- return instance;
- }
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransaction.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransaction.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,313 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.xa.XAResource;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-/**
- * @author bela
- * @version $Revision$
- * Date: May 15, 2003
- * Time: 4:20:17 PM
- */
-public class DummyTransaction implements Transaction
-{
- private int status = Status.STATUS_UNKNOWN;
- private static final Log log = LogFactory.getLog(DummyTransaction.class);
- protected DummyBaseTransactionManager tm_;
-
- protected final Set<Synchronization> participants = new CopyOnWriteArraySet<Synchronization>();
-
- public DummyTransaction(DummyBaseTransactionManager tm)
- {
- tm_ = tm;
- status = Status.STATUS_ACTIVE;
- }
-
- /**
- * Attempt to commit this transaction.
- *
- * @throws RollbackException If the transaction was marked for rollback
- * only, the transaction is rolled back and this exception is
- * thrown.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- * @throws HeuristicMixedException If a heuristic decision was made and
- * some some parts of the transaction have been committed while
- * other parts have been rolled back.
- * @throws HeuristicRollbackException If a heuristic decision to roll
- * back the transaction was made.
- * @throws SecurityException If the caller is not allowed to commit this
- * transaction.
- */
- public void commit()
- throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
- SecurityException, SystemException
- {
- boolean doCommit;
- status = Status.STATUS_PREPARING;
- try
- {
- boolean outcome = notifyBeforeCompletion();
- // status=Status.STATUS_PREPARED;
- if (outcome && status != Status.STATUS_MARKED_ROLLBACK)
- {
- status = Status.STATUS_COMMITTING;
- doCommit = true;
- }
- else
- {
- status = Status.STATUS_ROLLING_BACK;
- doCommit = false;
- }
- notifyAfterCompletion(doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK);
- status = doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK;
- if (!doCommit) throw new RollbackException("outcome is " + outcome + " status: " + status);
- }
- finally
- {
- // Disassociate tx from thread.
- tm_.setTransaction(null);
- }
- }
-
- /**
- * Rolls back this transaction.
- *
- * @throws IllegalStateException If the transaction is in a state
- * where it cannot be rolled back. This could be because the
- * transaction is no longer active, or because it is in the
- * {@link Status#STATUS_PREPARED prepared state}.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void rollback() throws IllegalStateException, SystemException
- {
- try
- {
- // JBCACHE-360 -- to match JBossTM (and presumable the spec) a
- // rollback transaction should have status ROLLEDBACK before
- // calling afterCompletion().
- //status=Status.STATUS_ROLLING_BACK;
- status = Status.STATUS_ROLLEDBACK;
- notifyAfterCompletion(Status.STATUS_ROLLEDBACK);
- }
- catch (Throwable t)
- {
- }
- status = Status.STATUS_ROLLEDBACK;
-
- // Disassociate tx from thread.
- tm_.setTransaction(null);
- }
-
- /**
- * Mark the transaction so that the only possible outcome is a rollback.
- *
- * @throws IllegalStateException If the transaction is not in an active
- * state.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void setRollbackOnly() throws IllegalStateException, SystemException
- {
- status = Status.STATUS_MARKED_ROLLBACK;
- }
-
- /**
- * Get the status of the transaction.
- *
- * @return The status of the transaction. This is one of the
- * {@link Status} constants.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public int getStatus() throws SystemException
- {
- return status;
- }
-
- /**
- * Change the transaction timeout for transactions started by the calling
- * thread with the {@link DummyTransactionManager#begin()} method.
- *
- * @param seconds The new timeout value, in seconds. If this parameter
- * is <code>0</code>, the timeout value is reset to the default
- * value.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void setTransactionTimeout(int seconds) throws SystemException
- {
- throw new SystemException("not supported");
- }
-
- /**
- * Enlist an XA resource with this transaction.
- *
- * @return <code>true</code> if the resource could be enlisted with
- * this transaction, otherwise <code>false</code>.
- * @throws RollbackException If the transaction is marked for rollback
- * only.
- * @throws IllegalStateException If the transaction is in a state
- * where resources cannot be enlisted. This could be because the
- * transaction is no longer active, or because it is in the
- * {@link Status#STATUS_PREPARED prepared state}.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public boolean enlistResource(XAResource xaRes)
- throws RollbackException, IllegalStateException, SystemException
- {
- throw new SystemException("not supported");
- }
-
- /**
- * Delist an XA resource from this transaction.
- *
- * @return <code>true</code> if the resource could be delisted from
- * this transaction, otherwise <code>false</code>.
- * @throws IllegalStateException If the transaction is in a state
- * where resources cannot be delisted. This could be because the
- * transaction is no longer active.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public boolean delistResource(XAResource xaRes, int flag)
- throws IllegalStateException, SystemException
- {
- throw new SystemException("not supported");
- }
-
- /**
- * Register a {@link Synchronization} callback with this transaction.
- *
- * @throws RollbackException If the transaction is marked for rollback
- * only.
- * @throws IllegalStateException If the transaction is in a state
- * where {@link Synchronization} callbacks cannot be registered.
- * This could be because the transaction is no longer active,
- * or because it is in the
- * {@link Status#STATUS_PREPARED prepared state}.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void registerSynchronization(Synchronization sync)
- throws RollbackException, IllegalStateException, SystemException
- {
- if (sync == null)
- throw new IllegalArgumentException("null synchronization " + this);
-
- switch (status)
- {
- case Status.STATUS_ACTIVE:
- case Status.STATUS_PREPARING:
- break;
- case Status.STATUS_PREPARED:
- throw new IllegalStateException("already prepared. " + this);
- case Status.STATUS_COMMITTING:
- throw new IllegalStateException("already started committing. " + this);
- case Status.STATUS_COMMITTED:
- throw new IllegalStateException("already committed. " + this);
- case Status.STATUS_MARKED_ROLLBACK:
- throw new RollbackException("already marked for rollback " + this);
- case Status.STATUS_ROLLING_BACK:
- throw new RollbackException("already started rolling back. " + this);
- case Status.STATUS_ROLLEDBACK:
- throw new RollbackException("already rolled back. " + this);
- case Status.STATUS_NO_TRANSACTION:
- throw new IllegalStateException("no transaction. " + this);
- case Status.STATUS_UNKNOWN:
- throw new IllegalStateException("unknown state " + this);
- default:
- throw new IllegalStateException("illegal status: " + status + " tx=" + this);
- }
-
- if (log.isDebugEnabled())
- {
- log.debug("registering synchronization handler " + sync);
- }
- participants.add(sync);
-
- }
-
- void setStatus(int new_status)
- {
- status = new_status;
- }
-
- protected boolean notifyBeforeCompletion()
- {
- boolean retval = true;
-
- for (Synchronization s : participants)
- {
- if (log.isDebugEnabled())
- {
- log.debug("processing beforeCompletion for " + s);
- }
- try
- {
- s.beforeCompletion();
- }
- catch (Throwable t)
- {
- retval = false;
- log.error("beforeCompletion() failed for " + s, t);
- }
- }
- return retval;
- }
-
- protected void notifyAfterCompletion(int status)
- {
- for (Synchronization s : participants)
- {
- if (log.isDebugEnabled())
- {
- log.debug("processing afterCompletion for " + s);
- }
- try
- {
- s.afterCompletion(status);
- }
- catch (Throwable t)
- {
- log.error("afterCompletion() failed for " + s, t);
- }
- }
- participants.clear();
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManager.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManager.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Properties;
-
-/**
- * Simple transaction manager implementation that maintains transaction state
- * in memory only.
- *
- * @author bela
- * @version $Revision$
- * Date: May 15, 2003
- * Time: 4:11:37 PM
- */
-public class DummyTransactionManager extends DummyBaseTransactionManager
-{
- protected static DummyTransactionManager instance = null;
- protected static DummyUserTransaction utx = null;
-
- protected static Log log = LogFactory.getLog(DummyTransactionManager.class);
-
- private static final long serialVersionUID = 4396695354693176535L;
-
- public static DummyTransactionManager getInstance()
- {
- if (instance == null)
- {
- instance = new DummyTransactionManager();
- utx = new DummyUserTransaction(instance);
- try
- {
- Properties p = new Properties();
- p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
- Context ctx = new InitialContext(p);
- ctx.bind("java:/TransactionManager", instance);
- ctx.bind("UserTransaction", utx);
- }
- catch (NamingException e)
- {
- log.error("binding of DummyTransactionManager failed", e);
- }
- }
- return instance;
- }
-
- public static DummyUserTransaction getUserTransaction()
- {
- getInstance();
- return utx;
- }
-
- public static void destroy()
- {
- if (instance == null)
- return;
- try
- {
- Properties p = new Properties();
- p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
- Context ctx = new InitialContext(p);
- ctx.unbind("java:/TransactionManager");
- ctx.unbind("UserTransaction");
- }
- catch (NamingException e)
- {
- log.error("unbinding of DummyTransactionManager failed", e);
- }
- instance.setTransaction(null);
- instance = null;
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManagerLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManagerLookup.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-
-
-/**
- * Returns an instance of {@link DummyTransactionManager}.
- *
- * @author Bela Ban Sept 5 2003
- * @version $Id$
- */
-public class DummyTransactionManagerLookup implements TransactionManagerLookup
-{
-
- public TransactionManager getTransactionManager() throws Exception
- {
- return DummyTransactionManager.getInstance();
- }
-
- public UserTransaction getUserTransaction()
- {
- return DummyTransactionManager.getUserTransaction();
- }
-
- public void cleanup()
- {
- DummyTransactionManager.destroy();
- }
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,155 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-import javax.transaction.UserTransaction;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author bela
- * @version $Revision$
- * Date: May 15, 2003
- * Time: 4:20:17 PM
- */
-public class DummyUserTransaction implements UserTransaction, java.io.Serializable
-{
- static final Log logger_ = LogFactory.getLog(DummyUserTransaction.class);
- DummyTransactionManager tm_;
- private static final long serialVersionUID = -6568400755677046127L;
-
- /**
- * List<Synchronization>
- */
- List<Synchronization> l = new ArrayList<Synchronization>();
-
- public DummyUserTransaction(DummyTransactionManager tm)
- {
- tm_ = tm;
- }
-
-
- /**
- * Starts a new transaction, and associate it with the calling thread.
- *
- * @throws NotSupportedException If the calling thread is already
- * associated with a transaction, and nested transactions are
- * not supported.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void begin() throws NotSupportedException, SystemException
- {
- tm_.begin();
- }
-
- /**
- * Attempt to commit this transaction.
- *
- * @throws RollbackException If the transaction was marked for rollback
- * only, the transaction is rolled back and this exception is
- * thrown.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- * @throws HeuristicMixedException If a heuristic decision was made and
- * some some parts of the transaction have been committed while
- * other parts have been rolled back.
- * @throws HeuristicRollbackException If a heuristic decision to roll
- * back the transaction was made.
- * @throws SecurityException If the caller is not allowed to commit this
- * transaction.
- */
- public void commit()
- throws RollbackException, HeuristicMixedException,
- HeuristicRollbackException, SecurityException, SystemException
- {
-
- tm_.commit();
- }
-
- /**
- * Rolls back this transaction.
- *
- * @throws IllegalStateException If the transaction is in a state
- * where it cannot be rolled back. This could be because the
- * transaction is no longer active, or because it is in the
- * {@link Status#STATUS_PREPARED prepared state}.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void rollback() throws IllegalStateException, SystemException
- {
- tm_.rollback();
- }
-
- /**
- * Mark the transaction so that the only possible outcome is a rollback.
- *
- * @throws IllegalStateException If the transaction is not in an active
- * state.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void setRollbackOnly() throws IllegalStateException, SystemException
- {
- tm_.setRollbackOnly();
- }
-
- /**
- * Get the status of the transaction.
- *
- * @return The status of the transaction. This is one of the
- * {@link Status} constants.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public int getStatus() throws SystemException
- {
- return tm_.getStatus();
- }
-
- /**
- * Change the transaction timeout for transactions started by the calling
- * thread with the {@link #begin()} method.
- *
- * @param seconds The new timeout value, in seconds. If this parameter
- * is <code>0</code>, the timeout value is reset to the default
- * value.
- * @throws SystemException If the transaction service fails in an
- * unexpected way.
- */
- public void setTransactionTimeout(int seconds) throws SystemException
- {
- throw new SystemException("not supported");
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,206 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.transaction.TransactionManager;
-import java.lang.reflect.Method;
-
-/**
- * A transaction manager lookup class that attempts to locate a TransactionManager.
- * A variety of different classes and JNDI locations are tried, for servers
- * such as:
- * <ul>
- * <li> JBoss
- * <li> JRun4
- * <li> Resin
- * <li> Orion
- * <li> JOnAS
- * <li> BEA Weblogic
- * <li> Websphere 4.0, 5.0, 5.1, 6.0
- * <li> Sun, Glassfish
- * </ul>
- * If a transaction manager is not found, returns a {@link DummyTransactionManager}.
- *
- * @author Markus Plesser
- * @version $Id$
- */
-public class GenericTransactionManagerLookup implements TransactionManagerLookup
-{
-
- private static final Log log = LogFactory.getLog(GenericTransactionManagerLookup.class);
-
- /**
- * JNDI lookups performed?
- */
- private static boolean lookupDone = false;
-
- /**
- * No JNDI available?
- */
- private static boolean lookupFailed = false;
-
- /**
- * The JVM TransactionManager found.
- */
- private static TransactionManager tm = null;
-
- /**
- * JNDI locations for TransactionManagers we know of
- */
- private static String[][] knownJNDIManagers =
- {
- {"java:/TransactionManager", "JBoss, JRun4"},
- {"java:comp/TransactionManager", "Resin 3.x"},
- {"java:appserver/TransactionManager", "Sun Glassfish"},
- {"java:pm/TransactionManager", "Borland, Sun"},
- {"javax.transaction.TransactionManager", "BEA WebLogic"},
- {"java:comp/UserTransaction", "Resin, Orion, JOnAS (JOTM)"},
- };
-
- /**
- * WebSphere 5.1 and 6.0 TransactionManagerFactory
- */
- private static final String WS_FACTORY_CLASS_5_1 = "com.ibm.ws.Transaction.TransactionManagerFactory";
-
- /**
- * WebSphere 5.0 TransactionManagerFactory
- */
- private static final String WS_FACTORY_CLASS_5_0 = "com.ibm.ejs.jts.jta.TransactionManagerFactory";
-
- /**
- * WebSphere 4.0 TransactionManagerFactory
- */
- private static final String WS_FACTORY_CLASS_4 = "com.ibm.ejs.jts.jta.JTSXA";
-
- /**
- * Get the systemwide used TransactionManager
- *
- * @return TransactionManager
- */
- public TransactionManager getTransactionManager()
- {
- if (!lookupDone)
- doLookups();
- if (tm != null)
- return tm;
- if (lookupFailed)
- {
- //fall back to a dummy from JBossCache
- tm = DummyTransactionManager.getInstance();
- log.warn("Falling back to DummyTransactionManager from JBossCache");
- }
- return tm;
- }
-
- /**
- * Try to figure out which TransactionManager to use
- */
- private static void doLookups()
- {
- if (lookupFailed)
- return;
- InitialContext ctx;
- try
- {
- ctx = new InitialContext();
- }
- catch (NamingException e)
- {
- log.error("Failed creating initial JNDI context", e);
- lookupFailed = true;
- return;
- }
- //probe jndi lookups first
- for (String[] knownJNDIManager : knownJNDIManagers)
- {
- Object jndiObject;
- try
- {
- if (log.isDebugEnabled())
- log.debug("Trying to lookup TransactionManager for " + knownJNDIManager[1]);
- jndiObject = ctx.lookup(knownJNDIManager[0]);
- }
- catch (NamingException e)
- {
- log.debug("Failed to perform a lookup for [" + knownJNDIManager[0] + " (" + knownJNDIManager[1]
- + ")]");
- continue;
- }
- if (jndiObject instanceof TransactionManager)
- {
- tm = (TransactionManager) jndiObject;
- log.debug("Found TransactionManager for " + knownJNDIManager[1]);
- return;
- }
- }
- //try to find websphere lookups since we came here
- Class clazz;
- try
- {
- log.debug("Trying WebSphere 5.1: " + WS_FACTORY_CLASS_5_1);
- clazz = Class.forName(WS_FACTORY_CLASS_5_1);
- log.debug("Found WebSphere 5.1: " + WS_FACTORY_CLASS_5_1);
- }
- catch (ClassNotFoundException ex)
- {
- try
- {
- log.debug("Trying WebSphere 5.0: " + WS_FACTORY_CLASS_5_0);
- clazz = Class.forName(WS_FACTORY_CLASS_5_0);
- log.debug("Found WebSphere 5.0: " + WS_FACTORY_CLASS_5_0);
- }
- catch (ClassNotFoundException ex2)
- {
- try
- {
- log.debug("Trying WebSphere 4: " + WS_FACTORY_CLASS_4);
- clazz = Class.forName(WS_FACTORY_CLASS_4);
- log.debug("Found WebSphere 4: " + WS_FACTORY_CLASS_4);
- }
- catch (ClassNotFoundException ex3)
- {
- log.debug("Couldn't find any WebSphere TransactionManager factory class, neither for WebSphere version 5.1 nor 5.0 nor 4");
- lookupFailed = true;
- return;
- }
- }
- }
- try
- {
- Class[] signature = null;
- Object[] args = null;
- Method method = clazz.getMethod("getTransactionManager", signature);
- tm = (TransactionManager) method.invoke(null, args);
- }
- catch (Exception ex)
- {
- log.error("Found WebSphere TransactionManager factory class [" + clazz.getName()
- + "], but couldn't invoke its static 'getTransactionManager' method", ex);
- }
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/GlobalTransaction.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/GlobalTransaction.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/GlobalTransaction.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,160 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-
-import org.jgroups.Address;
-
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-
-/**
- * Uniquely identifies a transaction that spans all nodes in a cluster. This is used when
- * replicating all modifications in a transaction; the PREPARE and COMMIT (or ROLLBACK)
- * messages have to have a unique identifier to associate the changes with<br>
- *
- * @author <a href="mailto:bela at jboss.org">Bela Ban</a> Apr 12, 2003
- * @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
- * @version $Revision$
- */
-public class GlobalTransaction implements Externalizable
-{
-
- private static final long serialVersionUID = 8011434781266976149L;
-
- private static long sid = 0;
-
- private Address addr = null;
- private long id = -1;
- private transient boolean remote = false;
-
- // cache the hashcode
- private transient int hash_code = -1; // in the worst case, hashCode() returns 0, then increases, so we're safe here
-
- /**
- * empty ctor used by externalization
- */
- public GlobalTransaction()
- {
- }
-
- private GlobalTransaction(Address addr)
- {
- this.addr = addr;
- id = newId();
- }
-
- private static synchronized long newId()
- {
- return ++sid;
- }
-
- public static GlobalTransaction create(Address addr)
- {
- return new GlobalTransaction(addr);
- }
-
- public Object getAddress()
- {
- return addr;
- }
-
- public void setAddress(Address address)
- {
- addr = address;
- }
-
- public long getId()
- {
- return id;
- }
-
- @Override
- public int hashCode()
- {
- if (hash_code == -1)
- {
- hash_code = (addr != null ? addr.hashCode() : 0) + (int) id;
- }
- return hash_code;
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (this == other)
- return true;
- if (!(other instanceof GlobalTransaction))
- return false;
-
- GlobalTransaction otherGtx = (GlobalTransaction) other;
- boolean aeq = (addr == null) ? (otherGtx.addr == null) : addr.equals(otherGtx.addr);
- return aeq && (id == otherGtx.id);
- }
-
- @Override
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
- sb.append("GlobalTransaction:<").append(addr).append(">:").append(id);
- return sb.toString();
- }
-
- public void writeExternal(ObjectOutput out) throws IOException
- {
- out.writeObject(addr);
- out.writeLong(id);
- // out.writeInt(hash_code);
- }
-
- public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- {
- addr = (Address) in.readObject();
- id = in.readLong();
- hash_code = -1;
- }
-
- /**
- * @return Returns the remote.
- */
- public boolean isRemote()
- {
- return remote;
- }
-
- /**
- * @param remote The remote to set.
- */
- public void setRemote(boolean remote)
- {
- this.remote = remote;
- }
-
-
- public void setId(long id)
- {
- this.id = id;
- }
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossStandaloneJTAManagerLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossStandaloneJTAManagerLookup.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossStandaloneJTAManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-import java.lang.reflect.Method;
-
-/**
- * JTA standalone TM lookup.
- *
- * @author Jason T. Greene
- */
-public class JBossStandaloneJTAManagerLookup implements TransactionManagerLookup
-{
- private Method manager, user;
-
- public JBossStandaloneJTAManagerLookup()
- {
- try
- {
- manager = Class.forName("com.arjuna.ats.jta.TransactionManager").getMethod("transactionManager");
- user = Class.forName("com.arjuna.ats.jta.UserTransaction").getMethod("userTransaction");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public TransactionManager getTransactionManager() throws Exception
- {
- return (TransactionManager) manager.invoke(null);
- }
-
- public UserTransaction getUserTransaction() throws Exception
- {
- return (UserTransaction) user.invoke(null);
- }
-}
\ No newline at end of file
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossTransactionManagerLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossTransactionManagerLookup.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import javax.naming.InitialContext;
-import javax.transaction.TransactionManager;
-
-
-/**
- * Uses JNDI to look-up the
- * {@link TransactionManager} instance from "java:/TransactionManager".
- *
- * @author Bela Ban, Aug 26 2003
- * @version $Id$
- */
-public class JBossTransactionManagerLookup implements TransactionManagerLookup
-{
-
- public TransactionManager getTransactionManager() throws Exception
- {
- return (TransactionManager) new InitialContext().lookup("java:/TransactionManager");
- }
-
-}
Deleted: core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionManagerLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionManagerLookup.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,44 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.transaction;
-
-import javax.transaction.TransactionManager;
-
-/**
- * Factory interface, allows {@link org.jboss.cache.Cache_Legacy} to use different transactional systems.
- * Names of implementors of this class can be configured using
- * {@link Configuration#setTransactionManagerLookupClass}.
- *
- * @author Bela Ban, Aug 26 2003
- * @version $Id$
- */
-public interface TransactionManagerLookup
-{
-
- /**
- * Returns a new TransactionManager.
- *
- * @throws Exception if lookup failed
- */
- TransactionManager getTransactionManager() throws Exception;
-
-}
Modified: core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -29,6 +29,7 @@
import org.jboss.starobrno.factories.annotations.Inject;
import org.jboss.starobrno.factories.annotations.NonVolatile;
import org.jboss.starobrno.factories.context.ContextFactory;
+import org.jboss.starobrno.transaction.GlobalTransaction;
import org.jgroups.Address;
import javax.transaction.Status;
Deleted: core/branches/flat/src/main/java/org/jboss/cache/util/Caches.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/cache/util/Caches.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/cache/util/Caches.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,802 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY 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 along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.cache.util;
-
-import org.jboss.cache.Cache_Legacy;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.loader.CacheLoader;
-import org.jboss.starobrno.tree.Fqn;
-import org.jboss.starobrno.util.SimpleImmutableEntry;
-
-import java.util.*;
-
-/**
- * Adaptors for {@link org.jboss.cache.Cache_Legacy} classes, such as {@link Node}.
- * This is useful for integration of JBoss Cache into existing applications.
- * <p/>
- * Example use:
- * <pre>
- * Cache c = ...;
- * Map m = Caches.asMap(c);
- * m.put("a", "b"); // null
- * m.containsKey("a"); // true
- * m.remove("a"); // "b"
- * </pre>
- */
-public class Caches
-{
-
- private Caches()
- {
- }
-
- /**
- * Returns a {@link Map} from the root node.
- *
- * @param cache cache to wrap as a map
- * @return a map representation of the cache
- * @see #asMap(Node)
- */
- public static <K, V> Map<K, V> asMap(Cache_Legacy<K, V> cache)
- {
- if (cache == null) throw new NullPointerException("cache");
- return asMap(cache.getRoot());
- }
-
- /**
- * Returns a {@link Map}, where map keys are named children of the given Node,
- * and values are kept under a single key for this node.
- * The map may be safely concurrently modified through this Map or externally,
- * and its contents reflect the cache state and
- * existing data of the Node.
- * This means that {@link ConcurrentModificationException} is never thrown
- * and all methods are thread safe.
- * <p/>
- * The map is not serializable.
- * <p/>
- * Usage note: As a single node is used for every key, it is most efficient to store
- * data for a single entity (e.g. Person) in a single object.
- * <p/>
- * Also, when using a {@link CacheLoader} for storage, keys used must be valid as
- * part of the {@link Fqn} used in calls. Generally speaking, simple string values are
- * preferred.
- *
- * @param node node in a cache to wrap
- * @return a Map representation of the cache
- */
- public static <K, V> Map<K, V> asMap(Node<K, V> node)
- {
- return new MapNode<K, V>(node);
- }
-
- /**
- * Returns a {@link Map}, where map data is put and returned directly from a single Node.
- * This method is "simple" as data is kept under a single node.
- * Note that storing all data in a single Node can be inefficient when using persistence,
- * replication, or transactions.
- * The map may be safely concurrently modified through this Map or externally.
- * This means that {@link ConcurrentModificationException} is never thrown
- * and all methods are thread safe.
- * <p/>
- * The methods {@link Map#entrySet} and {@link Map#values} and {@link Map#keySet}
- * do not allow for modification of the Node.
- * Further all these methods return a collection which is a snapshot (copy)
- * of the data at time of calling. This may be very inefficient.
- * <p/>
- * The map is not serializable.
- *
- * @param node node to wrap
- * @return Map representation of the cache
- */
- public static <K, V> Map<K, V> asSimpleMap(Node<K, V> node)
- {
- return new SimpleMapNode<K, V>(node);
- }
-
- /**
- * Returns a {@link Set}, where set entries are data entries of the given Node.
- * This method is "simple" as data is kept under a single node.
- * <p/>
- * Note that storing all data in a single Node can be inefficient when using persistence,
- * replication, or transactions.
- * The set may be safely concurrently modified through this Map or externally.
- * This means that {@link ConcurrentModificationException} is never thrown
- * and all methods are thread safe.
- * <p/>
- * The set is not serializable.
- *
- * @param node node to wrap
- * @return a Set representation of the values in a node
- */
- public static <K, V> Set<V> asSimpleSet(Node<K, V> node)
- {
- return new SimpleSetNode<V>(node);
- }
-
- /**
- * Returns a {@link Map}, where map entries are partitioned into
- * children nodes, within a cache node.
- * The default child selector divides the data into 128 child nodes based on hash code.
- * Note that for large data sets, the number of child nodes should be increased.
- *
- * @param node node to cache under
- * @return a Map representation of the cache
- */
- @SuppressWarnings("unchecked")
- public static <K, V> Map<K, V> asPartitionedMap(Node<K, V> node)
- {
- return new PartitionedMapNode<K, V>(node, HashKeySelector.DEFAULT);
- }
-
- /**
- * Returns a {@link Map}, where map entries are partitioned
- * into children, within a cache node, by key hash code.
- * <p/>
- * The map is not serializable.
- * <p/>
- * Usage note: This is a performance (and size) compromise between {@link #asMap(Node)}
- * and {@link #asSimpleMap(Node)}. For applications using a {@link org.jboss.cache.loader.CacheLoader},
- * {@link #asMap(Node)} is a better choice.
- * <p/>
- *
- * @param node node to cache under
- * @param ss selector strategy that chooses a segment based on key
- * @return a Map representation of the cache
- */
- public static <K, V> Map<K, V> asPartitionedMap(Node<K, V> node, ChildSelector<K> ss)
- {
- return new PartitionedMapNode<K, V>(node, ss);
- }
-
- /**
- * Returns a {@link Map}, where map entries are partitioned into child nodes,
- * within the cache root, by key hash code.
- *
- * @param cache cache to use
- * @return a Map representation of the cache
- */
- public static <K, V> Map<K, V> asPartitionedMap(Cache_Legacy<K, V> cache)
- {
- return asPartitionedMap(cache.getRoot());
- }
-
- /**
- * Computes an improved hash code from an object's hash code.
- */
- static protected final int hashCode(int i)
- {
- i ^= i >>> 20 ^ i >>> 12;
- return i ^ i >>> 7 ^ i >>> 4;
- }
-
- /**
- * Returns a segment ({@link Node#getChild(Object) child node name})
- * to use based on the characteristics of a key.
- * <p/>
- * Here is an example class which selects a child based on a person's department:
- * <pre>
- * public static class DepartmentSelector implements ChildSelector<Person>
- * {
- * public Object childName(Person key)
- * {
- * return key.getDepartment();
- * }
- * }
- * </pre>
- */
- public interface ChildSelector<T>
- {
- /**
- * Returns a child node name for a key.
- *
- * @param key for calls to {@link Map#put}, {@link Map#get} etc.
- * @return node name
- */
- Fqn childName(T key);
- }
-
- /**
- * Class that returns a child name to use based on the hash code of a key.
- */
- public static class HashKeySelector<T> implements ChildSelector<T>
- {
-
- static ChildSelector DEFAULT = new HashKeySelector(128);
-
- protected int segments;
-
- /**
- * Constructs with N segments, where N must be a power of 2.
- *
- * @param segments Number of hash segments
- */
- public HashKeySelector(int segments)
- {
- this.segments = segments;
- if (Integer.bitCount(segments) != 1)
- throw new IllegalArgumentException();
- if (segments <= 0)
- throw new IllegalArgumentException();
- }
-
- /**
- * Returns the segment for this key, in the inclusive range 0 to {@link #segments} - 1.
- */
- protected final int segmentFor(T key)
- {
- if (key == null)
- return 0;
- int hc = key.hashCode();
- return Caches.hashCode(hc) & (segments - 1);
- }
-
- /**
- * Returns the node name for this segment.
- */
- protected final Fqn childName(int segment)
- {
- return Fqn.fromElements(Integer.toString(segment));
- }
-
- /**
- * Returns the node name for this key.
- * By default, returns a String containing the segment.
- */
- public final Fqn childName(T key)
- {
- return childName(segmentFor(key));
- }
-
- @Override
- public String toString()
- {
- return super.toString() + " segments=" + segments;
- }
-
- }
-
- static class MapNode<K, V> extends AbstractMap<K, V>
- {
-
- public static final String KEY = "K";
-
- private Node node; // purposefully un-genericized
-
- public MapNode(Node<K, V> node)
- {
- if (node == null)
- throw new NullPointerException("node");
- this.node = node;
- }
-
- @Override
- public Set<Map.Entry<K, V>> entrySet()
- {
- return new AbstractSet<Map.Entry<K, V>>()
- {
-
- @Override
- public Iterator<Map.Entry<K, V>> iterator()
- {
- final Iterator<Node<K, V>> i = set().iterator();
- return new Iterator<Map.Entry<K, V>>()
- {
-
- Object name;
-
- boolean next = false;
-
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public Entry<K, V> next()
- {
- Node n = i.next();
- this.name = n.getFqn().getLastElement();
- this.next = true;
- Object key = n.get(KEY);
- return new SimpleImmutableEntry(name, key);
- }
-
- public void remove()
- {
- if (!next)
- throw new IllegalStateException();
- node.removeChild(name);
- }
-
- @Override
- public String toString()
- {
- return "Itr name=" + name;
- }
-
- };
- }
-
- @SuppressWarnings("unchecked")
- private Set<Node<K, V>> set()
- {
- return node.getChildren();
- }
-
- @Override
- public int size()
- {
- return set().size();
- }
-
- };
- }
-
- @Override
- public void clear()
- {
- for (Object o : node.getChildrenNames())
- node.removeChild(o);
- }
-
- @Override
- public boolean containsKey(Object arg0)
- {
- return node.getChild(arg0) != null;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V get(Object arg0)
- {
- Node child = node.getChild(arg0);
- if (child == null)
- return null;
- return (V) child.get(KEY);
- }
-
- @Override
- public boolean isEmpty()
- {
- return node.getChildrenNames().isEmpty();
- }
-
- @Override
- public Set<K> keySet()
- {
-
- return new AbstractSet<K>()
- {
-
- private Set set()
- {
- return node.getChildrenNames();
- }
-
- @Override
- public Iterator<K> iterator()
- {
- final Iterator i = set().iterator();
- return new Iterator<K>()
- {
-
- K child;
-
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public K next()
- {
- child = (K) i.next();
- return child;
- }
-
- public void remove()
- {
- if (child == null)
- throw new IllegalStateException();
- node.removeChild(child);
- // since set is read-only, invalidate
- }
-
- };
- }
-
- @Override
- public boolean remove(Object key)
- {
- return node.removeChild(key);
- }
-
- @Override
- public int size()
- {
- return set().size();
- }
-
- };
-
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V put(K arg0, V arg1)
- {
- return (V) node.addChild(Fqn.fromElements(arg0)).put(KEY, arg1);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V remove(Object arg0)
- {
- Node child = node.getChild(arg0);
- if (child == null)
- return null;
- V o = (V) child.remove(KEY);
- node.removeChild(arg0);
- return o;
- }
-
- @Override
- public int size()
- {
- return node.getChildrenNames().size();
- }
-
- }
-
- static class SimpleMapNode<K, V> extends AbstractMap<K, V>
- {
-
- private Node<K, V> node;
-
- public SimpleMapNode(Node<K, V> node)
- {
- if (node == null)
- throw new NullPointerException("node");
- this.node = node;
- }
-
- @Override
- public void clear()
- {
- node.clearData();
- }
-
- @Override
- public boolean containsKey(Object key)
- {
- return node.getKeys().contains(key);
- }
-
- @Override
- public boolean containsValue(Object value)
- {
- return node.getData().containsValue(value);
- }
-
- /**
- * getData returns a snapshot of the data.
- */
- @Override
- public Set<Map.Entry<K, V>> entrySet()
- {
- return node.getData().entrySet();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V get(Object key)
- {
- return node.get((K) key);
- }
-
- @Override
- public Set<K> keySet()
- {
- return node.getKeys();
- }
-
- @Override
- public V put(K key, V value)
- {
- return node.put(key, value);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public void putAll(Map<? extends K, ? extends V> map)
- {
- node.putAll((Map) map);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V remove(Object key)
- {
- return node.remove((K) key);
- }
-
- @Override
- public int size()
- {
- return node.dataSize();
- }
-
- }
-
- static class SimpleSetNode<K> extends AbstractSet<K> implements java.util.Set<K>
- {
-
- private Node node;
-
- private static final String VALUE = "V";
-
- public <K, V> SimpleSetNode(Node<K, V> node)
- {
- if (node == null)
- throw new NullPointerException("node");
- this.node = node;
- }
-
- @Override
- public void clear()
- {
- node.clearData();
- }
-
- @Override
- public boolean contains(Object key)
- {
- return node.getKeys().contains(key);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public boolean remove(Object key)
- {
- return node.remove(key) != null;
- }
-
- @Override
- public int size()
- {
- return node.dataSize();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public boolean add(K arg0)
- {
- return node.put(arg0, VALUE) == null;
- }
-
- @Override
- public Iterator<K> iterator()
- {
- final Iterator i = node.getKeys().iterator();
- return new Iterator<K>()
- {
- K key;
-
- boolean next = false;
-
- public boolean hasNext()
- {
- return i.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public K next()
- {
- key = (K) i.next();
- next = true;
- return key;
- }
-
- @SuppressWarnings("unchecked")
- public void remove()
- {
- if (!next)
- throw new IllegalStateException();
- node.remove(key);
- }
-
- };
- }
-
- }
-
- static class PartitionedMapNode<K, V> extends AbstractMap<K, V>
- {
-
- private NodeSPI node;
-
- private ChildSelector<K> selector;
-
- public PartitionedMapNode(Node<K, V> node, ChildSelector<K> selector)
- {
- this.node = (NodeSPI) node;
- this.selector = selector;
- }
-
- @Override
- public Set<Map.Entry<K, V>> entrySet()
- {
- return new AbstractSet<Map.Entry<K, V>>()
- {
-
- Iterator<Node> ci = node.getChildren().iterator();
-
- @Override
- public Iterator<Entry<K, V>> iterator()
- {
- return new Iterator<Entry<K, V>>()
- {
-
- Iterator ni;
-
- {
- nextChild();
- findNext();
- }
-
- @SuppressWarnings("unchecked")
- private void nextChild()
- {
- ni = new SimpleMapNode(ci.next()).entrySet().iterator();
- }
-
- private void findNext()
- {
- while (!ni.hasNext())
- {
- if (!ci.hasNext())
- return;
- nextChild();
- }
- }
-
- public boolean hasNext()
- {
- return ni.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public Entry<K, V> next()
- {
- Entry<K, V> n = (Entry<K, V>) ni.next();
- findNext();
- return n;
- }
-
- public void remove()
- {
- ni.remove();
- }
-
- };
- }
-
- @Override
- public int size()
- {
- return PartitionedMapNode.this.size();
- }
-
- };
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Set keySet()
- {
- return new AbstractSet<Map.Entry<K, V>>()
- {
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<Entry<K, V>> iterator()
- {
- return (Iterator<Entry<K, V>>) PartitionedMapNode.super.keySet().iterator();
- }
-
- @Override
- public boolean remove(Object o)
- {
- boolean key = PartitionedMapNode.this.containsKey(o);
- PartitionedMapNode.this.remove(o);
- return key;
- }
-
- @Override
- public boolean contains(Object o)
- {
- return PartitionedMapNode.this.containsKey(o);
- }
-
- @Override
- public int size()
- {
- return PartitionedMapNode.super.keySet().size();
- }
-
- };
- }
-
- @Override
- public void clear()
- {
- for (Object o : node.getChildrenNames())
- node.getChild(o).clearData();
- }
-
- @SuppressWarnings("unchecked")
- private Fqn fqnFor(Object o)
- {
- return Fqn.fromRelativeFqn(node.getFqn(), selector.childName((K) o));
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public boolean containsKey(Object o)
- {
- Fqn fqn = fqnFor(o);
- Set keys = node.getCache().getKeys(fqn);
- return keys != null && keys.contains(o);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public V get(Object key)
- {
- return (V) node.getCache().get(fqnFor(key), key);
- }
-
- @SuppressWarnings("unchecked")
- public Object put(Object key, Object value)
- {
- return node.getCache().put(fqnFor(key), key, value);
- }
-
- @SuppressWarnings("unchecked")
- public V remove(Object key)
- {
- return (V) node.getCache().remove(fqnFor(key), key);
- }
-
- public int size()
- {
- int size = 0;
- for (Object o : node.getChildrenNames())
- {
- Node child = node.getChild(o);
- size += child.dataSize();
- }
- return size;
- }
- }
-}
Modified: core/branches/flat/src/main/java/org/jboss/starobrno/factories/TransactionManagerFactory.java
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/factories/TransactionManagerFactory.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/factories/TransactionManagerFactory.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -21,10 +21,10 @@
*/
package org.jboss.starobrno.factories;
-import org.jboss.cache.transaction.BatchModeTransactionManager;
-import org.jboss.cache.transaction.TransactionManagerLookup;
import org.jboss.starobrno.config.ConfigurationException;
import org.jboss.starobrno.factories.annotations.DefaultFactoryFor;
+import org.jboss.starobrno.transaction.BatchModeTransactionManager;
+import org.jboss.starobrno.transaction.TransactionManagerLookup;
import javax.transaction.TransactionManager;
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/BatchModeTransactionManager.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/BatchModeTransactionManager.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/BatchModeTransactionManager.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/BatchModeTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Not really a transaction manager in the truest sense of the word. Only used to batch up operations. Proper
+ * transactional symantics of rollbacks and recovery are NOT used here. This is used by PojoCache.
+ *
+ * @author bela
+ * @version $Revision$
+ * Date: May 15, 2003
+ * Time: 4:11:37 PM
+ */
+public class BatchModeTransactionManager extends DummyBaseTransactionManager
+{
+ static BatchModeTransactionManager instance = null;
+ static Log log = LogFactory.getLog(BatchModeTransactionManager.class);
+ private static final long serialVersionUID = 5656602677430350961L;
+
+ public static BatchModeTransactionManager getInstance()
+ {
+ if (instance == null)
+ {
+ instance = new BatchModeTransactionManager();
+ }
+ return instance;
+ }
+
+ public static void destroy()
+ {
+ if (instance == null) return;
+ instance.setTransaction(null);
+ instance = null;
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/BatchModeTransactionManager.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyBaseTransactionManager.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyBaseTransactionManager.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyBaseTransactionManager.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyBaseTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,248 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.transaction.*;
+
+/**
+ * @author bela
+ * @version $Revision$
+ * Date: May 15, 2003
+ * Time: 4:11:37 PM
+ */
+public class DummyBaseTransactionManager implements TransactionManager, java.io.Serializable
+{
+ static ThreadLocal<Transaction> thread_local = new ThreadLocal<Transaction>();
+ private static final long serialVersionUID = -6716097342564237376l;
+ private static final Log log = LogFactory.getLog(DummyBaseTransactionManager.class);
+ private static final boolean trace = log.isTraceEnabled();
+
+ /**
+ * Starts a new transaction, and associate it with the calling thread.
+ *
+ * @throws javax.transaction.NotSupportedException
+ * If the calling thread is already
+ * associated with a transaction, and nested transactions are
+ * not supported.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public void begin() throws NotSupportedException, SystemException
+ {
+ Transaction currentTx;
+ if ((currentTx = getTransaction()) != null)
+ throw new NotSupportedException(Thread.currentThread() +
+ " is already associated with a transaction (" + currentTx + ")");
+ DummyTransaction tx = new DummyTransaction(this);
+ setTransaction(tx);
+ }
+
+ /**
+ * Commit the transaction associated with the calling thread.
+ *
+ * @throws javax.transaction.RollbackException
+ * If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws IllegalStateException If the calling thread is not associated
+ * with a transaction.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ * @throws javax.transaction.HeuristicMixedException
+ * If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws javax.transaction.HeuristicRollbackException
+ * If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit() throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException,
+ IllegalStateException, SystemException
+ {
+ int status;
+ Transaction tx = getTransaction();
+ if (tx == null)
+ throw new IllegalStateException("thread not associated with transaction");
+ status = tx.getStatus();
+ if (status == Status.STATUS_MARKED_ROLLBACK)
+ throw new RollbackException();
+ tx.commit();
+
+ // Disassociate tx from thread.
+ setTransaction(null);
+ }
+
+ /**
+ * Rolls back the transaction associated with the calling thread.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link javax.transaction.Status#STATUS_PREPARED prepared state}.
+ * @throws SecurityException If the caller is not allowed to roll back
+ * this transaction.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback() throws IllegalStateException, SecurityException,
+ SystemException
+ {
+ Transaction tx = getTransaction();
+ if (tx == null)
+ throw new IllegalStateException("no transaction associated with thread");
+ tx.rollback();
+
+ // Disassociate tx from thread.
+ setTransaction(null);
+ }
+
+ /**
+ * Mark the transaction associated with the calling thread for rollback
+ * only.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * calling thread is not associated with a transaction, or
+ * because it is in the
+ * {@link javax.transaction.Status#STATUS_PREPARED prepared state}.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException
+ {
+ Transaction tx = getTransaction();
+ if (tx == null)
+ throw new IllegalStateException("no transaction associated with calling thread");
+ tx.setRollbackOnly();
+ }
+
+ /**
+ * Get the status of the transaction associated with the calling thread.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link javax.transaction.Status} constants. If no transaction is associated
+ * with the calling thread,
+ * {@link javax.transaction.Status#STATUS_NO_TRANSACTION} is returned.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException
+ {
+ Transaction tx = getTransaction();
+ return tx != null ? tx.getStatus() : Status.STATUS_NO_TRANSACTION;
+ }
+
+ /**
+ * Get the transaction associated with the calling thread.
+ *
+ * @return The transaction associated with the calling thread, or
+ * <code>null</code> if the calling thread is not associated
+ * with a transaction.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public Transaction getTransaction() throws SystemException
+ {
+ return thread_local.get();
+ }
+
+ /**
+ * Change the transaction timeout for transactions started by the calling
+ * thread with the {@link #begin()} method.
+ *
+ * @param seconds The new timeout value, in seconds. If this parameter
+ * is <code>0</code>, the timeout value is reset to the default
+ * value.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException
+ {
+ throw new SystemException("not supported");
+ }
+
+ /**
+ * Suspend the association the calling thread has to a transaction,
+ * and return the suspended transaction.
+ * When returning from this method, the calling thread is no longer
+ * associated with a transaction.
+ *
+ * @return The transaction that the calling thread was associated with,
+ * or <code>null</code> if the calling thread was not associated
+ * with a transaction.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public Transaction suspend() throws SystemException
+ {
+ Transaction retval = getTransaction();
+ setTransaction(null);
+ if (trace) log.trace("Suspending tx " + retval);
+ return retval;
+ }
+
+ /**
+ * Resume the association of the calling thread with the given
+ * transaction.
+ *
+ * @param tx The transaction to be associated with the calling thread.
+ * @throws javax.transaction.InvalidTransactionException
+ * If the argument does not represent
+ * a valid transaction.
+ * @throws IllegalStateException If the calling thread is already
+ * associated with a transaction.
+ * @throws javax.transaction.SystemException
+ * If the transaction service fails in an
+ * unexpected way.
+ */
+ public void resume(Transaction tx) throws InvalidTransactionException, IllegalStateException, SystemException
+ {
+ if (trace) log.trace("Resuming tx " + tx);
+ setTransaction(tx);
+ }
+
+ /**
+ * Just used for unit tests
+ *
+ * @param tx
+ */
+ public void setTransaction(Transaction tx)
+ {
+ thread_local.set(tx);
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyBaseTransactionManager.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransaction.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransaction.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransaction.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransaction.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,307 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.transaction.*;
+import javax.transaction.xa.XAResource;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+/**
+ * @author bela
+ * @version $Revision$
+ * Date: May 15, 2003
+ * Time: 4:20:17 PM
+ */
+public class DummyTransaction implements Transaction
+{
+ private int status = Status.STATUS_UNKNOWN;
+ private static final Log log = LogFactory.getLog(DummyTransaction.class);
+ protected DummyBaseTransactionManager tm_;
+
+ protected final Set<Synchronization> participants = new CopyOnWriteArraySet<Synchronization>();
+
+ public DummyTransaction(DummyBaseTransactionManager tm)
+ {
+ tm_ = tm;
+ status = Status.STATUS_ACTIVE;
+ }
+
+ /**
+ * Attempt to commit this transaction.
+ *
+ * @throws RollbackException If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ * @throws HeuristicMixedException If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws HeuristicRollbackException If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit()
+ throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
+ SecurityException, SystemException
+ {
+ boolean doCommit;
+ status = Status.STATUS_PREPARING;
+ try
+ {
+ boolean outcome = notifyBeforeCompletion();
+ // status=Status.STATUS_PREPARED;
+ if (outcome && status != Status.STATUS_MARKED_ROLLBACK)
+ {
+ status = Status.STATUS_COMMITTING;
+ doCommit = true;
+ }
+ else
+ {
+ status = Status.STATUS_ROLLING_BACK;
+ doCommit = false;
+ }
+ notifyAfterCompletion(doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK);
+ status = doCommit ? Status.STATUS_COMMITTED : Status.STATUS_MARKED_ROLLBACK;
+ if (!doCommit) throw new RollbackException("outcome is " + outcome + " status: " + status);
+ }
+ finally
+ {
+ // Disassociate tx from thread.
+ tm_.setTransaction(null);
+ }
+ }
+
+ /**
+ * Rolls back this transaction.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * transaction is no longer active, or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback() throws IllegalStateException, SystemException
+ {
+ try
+ {
+ // JBCACHE-360 -- to match JBossTM (and presumable the spec) a
+ // rollback transaction should have status ROLLEDBACK before
+ // calling afterCompletion().
+ //status=Status.STATUS_ROLLING_BACK;
+ status = Status.STATUS_ROLLEDBACK;
+ notifyAfterCompletion(Status.STATUS_ROLLEDBACK);
+ }
+ catch (Throwable t)
+ {
+ }
+ status = Status.STATUS_ROLLEDBACK;
+
+ // Disassociate tx from thread.
+ tm_.setTransaction(null);
+ }
+
+ /**
+ * Mark the transaction so that the only possible outcome is a rollback.
+ *
+ * @throws IllegalStateException If the transaction is not in an active
+ * state.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException
+ {
+ status = Status.STATUS_MARKED_ROLLBACK;
+ }
+
+ /**
+ * Get the status of the transaction.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link Status} constants.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException
+ {
+ return status;
+ }
+
+ /**
+ * Change the transaction timeout for transactions started by the calling
+ * thread with the {@link DummyTransactionManager#begin()} method.
+ *
+ * @param seconds The new timeout value, in seconds. If this parameter
+ * is <code>0</code>, the timeout value is reset to the default
+ * value.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException
+ {
+ throw new SystemException("not supported");
+ }
+
+ /**
+ * Enlist an XA resource with this transaction.
+ *
+ * @return <code>true</code> if the resource could be enlisted with
+ * this transaction, otherwise <code>false</code>.
+ * @throws RollbackException If the transaction is marked for rollback
+ * only.
+ * @throws IllegalStateException If the transaction is in a state
+ * where resources cannot be enlisted. This could be because the
+ * transaction is no longer active, or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public boolean enlistResource(XAResource xaRes)
+ throws RollbackException, IllegalStateException, SystemException
+ {
+ throw new SystemException("not supported");
+ }
+
+ /**
+ * Delist an XA resource from this transaction.
+ *
+ * @return <code>true</code> if the resource could be delisted from
+ * this transaction, otherwise <code>false</code>.
+ * @throws IllegalStateException If the transaction is in a state
+ * where resources cannot be delisted. This could be because the
+ * transaction is no longer active.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public boolean delistResource(XAResource xaRes, int flag)
+ throws IllegalStateException, SystemException
+ {
+ throw new SystemException("not supported");
+ }
+
+ /**
+ * Register a {@link Synchronization} callback with this transaction.
+ *
+ * @throws RollbackException If the transaction is marked for rollback
+ * only.
+ * @throws IllegalStateException If the transaction is in a state
+ * where {@link Synchronization} callbacks cannot be registered.
+ * This could be because the transaction is no longer active,
+ * or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void registerSynchronization(Synchronization sync)
+ throws RollbackException, IllegalStateException, SystemException
+ {
+ if (sync == null)
+ throw new IllegalArgumentException("null synchronization " + this);
+
+ switch (status)
+ {
+ case Status.STATUS_ACTIVE:
+ case Status.STATUS_PREPARING:
+ break;
+ case Status.STATUS_PREPARED:
+ throw new IllegalStateException("already prepared. " + this);
+ case Status.STATUS_COMMITTING:
+ throw new IllegalStateException("already started committing. " + this);
+ case Status.STATUS_COMMITTED:
+ throw new IllegalStateException("already committed. " + this);
+ case Status.STATUS_MARKED_ROLLBACK:
+ throw new RollbackException("already marked for rollback " + this);
+ case Status.STATUS_ROLLING_BACK:
+ throw new RollbackException("already started rolling back. " + this);
+ case Status.STATUS_ROLLEDBACK:
+ throw new RollbackException("already rolled back. " + this);
+ case Status.STATUS_NO_TRANSACTION:
+ throw new IllegalStateException("no transaction. " + this);
+ case Status.STATUS_UNKNOWN:
+ throw new IllegalStateException("unknown state " + this);
+ default:
+ throw new IllegalStateException("illegal status: " + status + " tx=" + this);
+ }
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("registering synchronization handler " + sync);
+ }
+ participants.add(sync);
+
+ }
+
+ void setStatus(int new_status)
+ {
+ status = new_status;
+ }
+
+ protected boolean notifyBeforeCompletion()
+ {
+ boolean retval = true;
+
+ for (Synchronization s : participants)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("processing beforeCompletion for " + s);
+ }
+ try
+ {
+ s.beforeCompletion();
+ }
+ catch (Throwable t)
+ {
+ retval = false;
+ log.error("beforeCompletion() failed for " + s, t);
+ }
+ }
+ return retval;
+ }
+
+ protected void notifyAfterCompletion(int status)
+ {
+ for (Synchronization s : participants)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("processing afterCompletion for " + s);
+ }
+ try
+ {
+ s.afterCompletion(status);
+ }
+ catch (Throwable t)
+ {
+ log.error("afterCompletion() failed for " + s, t);
+ }
+ }
+ participants.clear();
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransaction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManager.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManager.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManager.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManager.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.Properties;
+
+/**
+ * Simple transaction manager implementation that maintains transaction state
+ * in memory only.
+ *
+ * @author bela
+ * @version $Revision$
+ * Date: May 15, 2003
+ * Time: 4:11:37 PM
+ */
+public class DummyTransactionManager extends DummyBaseTransactionManager
+{
+ protected static DummyTransactionManager instance = null;
+ protected static DummyUserTransaction utx = null;
+
+ protected static Log log = LogFactory.getLog(DummyTransactionManager.class);
+
+ private static final long serialVersionUID = 4396695354693176535L;
+
+ public static DummyTransactionManager getInstance()
+ {
+ if (instance == null)
+ {
+ instance = new DummyTransactionManager();
+ utx = new DummyUserTransaction(instance);
+ try
+ {
+ Properties p = new Properties();
+ p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
+ Context ctx = new InitialContext(p);
+ ctx.bind("java:/TransactionManager", instance);
+ ctx.bind("UserTransaction", utx);
+ }
+ catch (NamingException e)
+ {
+ log.error("binding of DummyTransactionManager failed", e);
+ }
+ }
+ return instance;
+ }
+
+ public static DummyUserTransaction getUserTransaction()
+ {
+ getInstance();
+ return utx;
+ }
+
+ public static void destroy()
+ {
+ if (instance == null)
+ return;
+ try
+ {
+ Properties p = new Properties();
+ p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory");
+ Context ctx = new InitialContext(p);
+ ctx.unbind("java:/TransactionManager");
+ ctx.unbind("UserTransaction");
+ }
+ catch (NamingException e)
+ {
+ log.error("unbinding of DummyTransactionManager failed", e);
+ }
+ instance.setTransaction(null);
+ instance = null;
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManager.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManagerLookup.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyTransactionManagerLookup.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManagerLookup.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+
+
+/**
+ * Returns an instance of {@link org.jboss.starobrno.transaction.DummyTransactionManager}.
+ *
+ * @author Bela Ban Sept 5 2003
+ * @version $Id$
+ */
+public class DummyTransactionManagerLookup implements TransactionManagerLookup
+{
+
+ public TransactionManager getTransactionManager() throws Exception
+ {
+ return DummyTransactionManager.getInstance();
+ }
+
+ public UserTransaction getUserTransaction()
+ {
+ return DummyTransactionManager.getUserTransaction();
+ }
+
+ public void cleanup()
+ {
+ DummyTransactionManager.destroy();
+ }
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyTransactionManagerLookup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyUserTransaction.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/DummyUserTransaction.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyUserTransaction.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyUserTransaction.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.transaction.*;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author bela
+ * @version $Revision$
+ * Date: May 15, 2003
+ * Time: 4:20:17 PM
+ */
+public class DummyUserTransaction implements UserTransaction, java.io.Serializable
+{
+ static final Log logger_ = LogFactory.getLog(DummyUserTransaction.class);
+ DummyTransactionManager tm_;
+ private static final long serialVersionUID = -6568400755677046127L;
+
+ /**
+ * List<Synchronization>
+ */
+ List<Synchronization> l = new ArrayList<Synchronization>();
+
+ public DummyUserTransaction(DummyTransactionManager tm)
+ {
+ tm_ = tm;
+ }
+
+
+ /**
+ * Starts a new transaction, and associate it with the calling thread.
+ *
+ * @throws NotSupportedException If the calling thread is already
+ * associated with a transaction, and nested transactions are
+ * not supported.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void begin() throws NotSupportedException, SystemException
+ {
+ tm_.begin();
+ }
+
+ /**
+ * Attempt to commit this transaction.
+ *
+ * @throws RollbackException If the transaction was marked for rollback
+ * only, the transaction is rolled back and this exception is
+ * thrown.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ * @throws HeuristicMixedException If a heuristic decision was made and
+ * some some parts of the transaction have been committed while
+ * other parts have been rolled back.
+ * @throws HeuristicRollbackException If a heuristic decision to roll
+ * back the transaction was made.
+ * @throws SecurityException If the caller is not allowed to commit this
+ * transaction.
+ */
+ public void commit()
+ throws RollbackException, HeuristicMixedException,
+ HeuristicRollbackException, SecurityException, SystemException
+ {
+
+ tm_.commit();
+ }
+
+ /**
+ * Rolls back this transaction.
+ *
+ * @throws IllegalStateException If the transaction is in a state
+ * where it cannot be rolled back. This could be because the
+ * transaction is no longer active, or because it is in the
+ * {@link Status#STATUS_PREPARED prepared state}.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void rollback() throws IllegalStateException, SystemException
+ {
+ tm_.rollback();
+ }
+
+ /**
+ * Mark the transaction so that the only possible outcome is a rollback.
+ *
+ * @throws IllegalStateException If the transaction is not in an active
+ * state.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setRollbackOnly() throws IllegalStateException, SystemException
+ {
+ tm_.setRollbackOnly();
+ }
+
+ /**
+ * Get the status of the transaction.
+ *
+ * @return The status of the transaction. This is one of the
+ * {@link Status} constants.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public int getStatus() throws SystemException
+ {
+ return tm_.getStatus();
+ }
+
+ /**
+ * Change the transaction timeout for transactions started by the calling
+ * thread with the {@link #begin()} method.
+ *
+ * @param seconds The new timeout value, in seconds. If this parameter
+ * is <code>0</code>, the timeout value is reset to the default
+ * value.
+ * @throws SystemException If the transaction service fails in an
+ * unexpected way.
+ */
+ public void setTransactionTimeout(int seconds) throws SystemException
+ {
+ throw new SystemException("not supported");
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/DummyUserTransaction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/GenericTransactionManagerLookup.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/GenericTransactionManagerLookup.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/GenericTransactionManagerLookup.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/GenericTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,206 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.transaction.TransactionManager;
+import java.lang.reflect.Method;
+
+/**
+ * A transaction manager lookup class that attempts to locate a TransactionManager.
+ * A variety of different classes and JNDI locations are tried, for servers
+ * such as:
+ * <ul>
+ * <li> JBoss
+ * <li> JRun4
+ * <li> Resin
+ * <li> Orion
+ * <li> JOnAS
+ * <li> BEA Weblogic
+ * <li> Websphere 4.0, 5.0, 5.1, 6.0
+ * <li> Sun, Glassfish
+ * </ul>
+ * If a transaction manager is not found, returns a {@link org.jboss.starobrno.transaction.DummyTransactionManager}.
+ *
+ * @author Markus Plesser
+ * @version $Id$
+ */
+public class GenericTransactionManagerLookup implements TransactionManagerLookup
+{
+
+ private static final Log log = LogFactory.getLog(GenericTransactionManagerLookup.class);
+
+ /**
+ * JNDI lookups performed?
+ */
+ private static boolean lookupDone = false;
+
+ /**
+ * No JNDI available?
+ */
+ private static boolean lookupFailed = false;
+
+ /**
+ * The JVM TransactionManager found.
+ */
+ private static TransactionManager tm = null;
+
+ /**
+ * JNDI locations for TransactionManagers we know of
+ */
+ private static String[][] knownJNDIManagers =
+ {
+ {"java:/TransactionManager", "JBoss, JRun4"},
+ {"java:comp/TransactionManager", "Resin 3.x"},
+ {"java:appserver/TransactionManager", "Sun Glassfish"},
+ {"java:pm/TransactionManager", "Borland, Sun"},
+ {"javax.transaction.TransactionManager", "BEA WebLogic"},
+ {"java:comp/UserTransaction", "Resin, Orion, JOnAS (JOTM)"},
+ };
+
+ /**
+ * WebSphere 5.1 and 6.0 TransactionManagerFactory
+ */
+ private static final String WS_FACTORY_CLASS_5_1 = "com.ibm.ws.Transaction.TransactionManagerFactory";
+
+ /**
+ * WebSphere 5.0 TransactionManagerFactory
+ */
+ private static final String WS_FACTORY_CLASS_5_0 = "com.ibm.ejs.jts.jta.TransactionManagerFactory";
+
+ /**
+ * WebSphere 4.0 TransactionManagerFactory
+ */
+ private static final String WS_FACTORY_CLASS_4 = "com.ibm.ejs.jts.jta.JTSXA";
+
+ /**
+ * Get the systemwide used TransactionManager
+ *
+ * @return TransactionManager
+ */
+ public TransactionManager getTransactionManager()
+ {
+ if (!lookupDone)
+ doLookups();
+ if (tm != null)
+ return tm;
+ if (lookupFailed)
+ {
+ //fall back to a dummy from JBossCache
+ tm = DummyTransactionManager.getInstance();
+ log.warn("Falling back to DummyTransactionManager from JBossCache");
+ }
+ return tm;
+ }
+
+ /**
+ * Try to figure out which TransactionManager to use
+ */
+ private static void doLookups()
+ {
+ if (lookupFailed)
+ return;
+ InitialContext ctx;
+ try
+ {
+ ctx = new InitialContext();
+ }
+ catch (NamingException e)
+ {
+ log.error("Failed creating initial JNDI context", e);
+ lookupFailed = true;
+ return;
+ }
+ //probe jndi lookups first
+ for (String[] knownJNDIManager : knownJNDIManagers)
+ {
+ Object jndiObject;
+ try
+ {
+ if (log.isDebugEnabled())
+ log.debug("Trying to lookup TransactionManager for " + knownJNDIManager[1]);
+ jndiObject = ctx.lookup(knownJNDIManager[0]);
+ }
+ catch (NamingException e)
+ {
+ log.debug("Failed to perform a lookup for [" + knownJNDIManager[0] + " (" + knownJNDIManager[1]
+ + ")]");
+ continue;
+ }
+ if (jndiObject instanceof TransactionManager)
+ {
+ tm = (TransactionManager) jndiObject;
+ log.debug("Found TransactionManager for " + knownJNDIManager[1]);
+ return;
+ }
+ }
+ //try to find websphere lookups since we came here
+ Class clazz;
+ try
+ {
+ log.debug("Trying WebSphere 5.1: " + WS_FACTORY_CLASS_5_1);
+ clazz = Class.forName(WS_FACTORY_CLASS_5_1);
+ log.debug("Found WebSphere 5.1: " + WS_FACTORY_CLASS_5_1);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ try
+ {
+ log.debug("Trying WebSphere 5.0: " + WS_FACTORY_CLASS_5_0);
+ clazz = Class.forName(WS_FACTORY_CLASS_5_0);
+ log.debug("Found WebSphere 5.0: " + WS_FACTORY_CLASS_5_0);
+ }
+ catch (ClassNotFoundException ex2)
+ {
+ try
+ {
+ log.debug("Trying WebSphere 4: " + WS_FACTORY_CLASS_4);
+ clazz = Class.forName(WS_FACTORY_CLASS_4);
+ log.debug("Found WebSphere 4: " + WS_FACTORY_CLASS_4);
+ }
+ catch (ClassNotFoundException ex3)
+ {
+ log.debug("Couldn't find any WebSphere TransactionManager factory class, neither for WebSphere version 5.1 nor 5.0 nor 4");
+ lookupFailed = true;
+ return;
+ }
+ }
+ }
+ try
+ {
+ Class[] signature = null;
+ Object[] args = null;
+ Method method = clazz.getMethod("getTransactionManager", signature);
+ tm = (TransactionManager) method.invoke(null, args);
+ }
+ catch (Exception ex)
+ {
+ log.error("Found WebSphere TransactionManager factory class [" + clazz.getName()
+ + "], but couldn't invoke its static 'getTransactionManager' method", ex);
+ }
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/GenericTransactionManagerLookup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossStandaloneJTAManagerLookup.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossStandaloneJTAManagerLookup.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossStandaloneJTAManagerLookup.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossStandaloneJTAManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import java.lang.reflect.Method;
+
+/**
+ * JTA standalone TM lookup.
+ *
+ * @author Jason T. Greene
+ */
+public class JBossStandaloneJTAManagerLookup implements TransactionManagerLookup
+{
+ private Method manager, user;
+
+ public JBossStandaloneJTAManagerLookup()
+ {
+ try
+ {
+ manager = Class.forName("com.arjuna.ats.jta.TransactionManager").getMethod("transactionManager");
+ user = Class.forName("com.arjuna.ats.jta.UserTransaction").getMethod("userTransaction");
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public TransactionManager getTransactionManager() throws Exception
+ {
+ return (TransactionManager) manager.invoke(null);
+ }
+
+ public UserTransaction getUserTransaction() throws Exception
+ {
+ return (UserTransaction) user.invoke(null);
+ }
+}
\ No newline at end of file
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossStandaloneJTAManagerLookup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossTransactionManagerLookup.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/JBossTransactionManagerLookup.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossTransactionManagerLookup.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossTransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import javax.naming.InitialContext;
+import javax.transaction.TransactionManager;
+
+
+/**
+ * Uses JNDI to look-up the
+ * {@link TransactionManager} instance from "java:/TransactionManager".
+ *
+ * @author Bela Ban, Aug 26 2003
+ * @version $Id$
+ */
+public class JBossTransactionManagerLookup implements TransactionManagerLookup
+{
+
+ public TransactionManager getTransactionManager() throws Exception
+ {
+ return (TransactionManager) new InitialContext().lookup("java:/TransactionManager");
+ }
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/JBossTransactionManagerLookup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/TransactionManagerLookup.java (from rev 7261, core/branches/flat/src/main/java/org/jboss/cache/transaction/TransactionManagerLookup.java)
===================================================================
--- core/branches/flat/src/main/java/org/jboss/starobrno/transaction/TransactionManagerLookup.java (rev 0)
+++ core/branches/flat/src/main/java/org/jboss/starobrno/transaction/TransactionManagerLookup.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2000 - 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY 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 along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.starobrno.transaction;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * Factory interface, allows {@link org.jboss.cache.Cache_Legacy} to use different transactional systems.
+ * Names of implementors of this class can be configured using
+ * {@link Configuration#setTransactionManagerLookupClass}.
+ *
+ * @author Bela Ban, Aug 26 2003
+ * @version $Id$
+ */
+public interface TransactionManagerLookup
+{
+
+ /**
+ * Returns a new TransactionManager.
+ *
+ * @throws Exception if lookup failed
+ */
+ TransactionManager getTransactionManager() throws Exception;
+
+}
Property changes on: core/branches/flat/src/main/java/org/jboss/starobrno/transaction/TransactionManagerLookup.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: core/branches/flat/src/main/resources/config-samples/all.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/all.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/all.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -18,7 +18,7 @@
Used to register a transaction manager and participate in ongoing transactions.
-->
<transaction
- transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="false"
syncCommitPhase="false"/>
Modified: core/branches/flat/src/main/resources/config-samples/buddy-replication.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/buddy-replication.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/buddy-replication.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering mode="replication">
<!--
Modified: core/branches/flat/src/main/resources/config-samples/cacheloader-enabled.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/cacheloader-enabled.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/cacheloader-enabled.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<!-- Specific eviction policy configurations -->
<eviction wakeUpInterval="5000">
Modified: core/branches/flat/src/main/resources/config-samples/eviction-enabled.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/eviction-enabled.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/eviction-enabled.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<!--
wakeUpInterval: time interval (millis) when the eviction thread kicks in.
Modified: core/branches/flat/src/main/resources/config-samples/external-jgroups-file.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/external-jgroups-file.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/external-jgroups-file.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering>
<async/>
Modified: core/branches/flat/src/main/resources/config-samples/invalidation-async.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/invalidation-async.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/invalidation-async.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering mode="invalidation">
<!--
Modified: core/branches/flat/src/main/resources/config-samples/local.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/local.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/local.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -4,5 +4,5 @@
<!-- By not specifying the 'clustering' element, the cache runs in LOCAL mode. -->
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
</jbosscache>
Modified: core/branches/flat/src/main/resources/config-samples/multiplexer-enabled.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/multiplexer-enabled.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/multiplexer-enabled.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering>
<sync/>
Modified: core/branches/flat/src/main/resources/config-samples/total-replication.xml
===================================================================
--- core/branches/flat/src/main/resources/config-samples/total-replication.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/main/resources/config-samples/total-replication.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
<!-- Configure the TransactionManager -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering mode="replication">
<!-- JGroups protocol stack properties. -->
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/CacheAPITest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/CacheAPITest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/CacheAPITest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,12 +2,12 @@
import org.jboss.cache.CacheFactory;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheSPI;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.config.ConfigurationException;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNull;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/batch/BatchWithTM.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/batch/BatchWithTM.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/batch/BatchWithTM.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,14 +1,14 @@
package org.jboss.starobrno.api.batch;
import org.jboss.cache.CacheFactory;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.Test;
import javax.transaction.TransactionManager;
-import org.jboss.starobrno.UnitTestCacheFactory;
@Test(groups = {"functional", "transaction"})
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/LockTestBase.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/LockTestBase.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/LockTestBase.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,12 +3,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.invocation.InvocationContextContainer;
import org.jboss.starobrno.lock.LockManager;
import org.jboss.starobrno.lock.TimeoutException;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -17,7 +18,6 @@
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import java.util.Collections;
-import org.jboss.starobrno.UnitTestCacheFactory;
/**
* @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
@@ -29,14 +29,15 @@
protected boolean repeatableRead = true;
protected boolean lockParentForChildInsertRemove = false;
private Log log = LogFactory.getLog(LockTestBase.class);
-
- protected class LockTestBaseTL {
+
+ protected class LockTestBaseTL
+ {
public Cache<String, String> cache;
public TransactionManager tm;
public LockManager lockManager;
public InvocationContextContainer icc;
}
-
+
protected ThreadLocal<LockTestBaseTL> threadLocal = new ThreadLocal<LockTestBaseTL>();
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/PutForExternalReadTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/PutForExternalReadTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/PutForExternalReadTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -49,7 +49,7 @@
Configuration c = new Configuration();
c.setCacheMode(Configuration.CacheMode.REPL_SYNC);
cache1 = (CacheSPI<String, String>) cf.createCache(c, false);
- cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ cache1.getConfiguration().setTransactionManagerLookupClass("org.jboss.starobrno.transaction.DummyTransactionManagerLookup");
cache1.getConfiguration().setSerializationExecutorPoolSize(0);//this is very important for async tests!
cache1.start();
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/repeatable_read/WriteSkewTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/repeatable_read/WriteSkewTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/mvcc/repeatable_read/WriteSkewTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,12 +1,13 @@
package org.jboss.starobrno.api.mvcc.repeatable_read;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.api.mvcc.LockAssert;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.invocation.InvocationContextContainer;
import org.jboss.starobrno.lock.LockManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -18,7 +19,6 @@
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
-import org.jboss.starobrno.UnitTestCacheFactory;
@Test(groups = {"functional", "mvcc"}, sequential = true)
public class WriteSkewTest
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeAPITest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeAPITest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeAPITest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,10 +1,10 @@
package org.jboss.starobrno.api.tree;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheSPI;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.tree.Node;
import org.jboss.starobrno.tree.TreeCache;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeReplicatedMoveTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeReplicatedMoveTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/NodeReplicatedMoveTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -6,9 +6,9 @@
*/
package org.jboss.starobrno.api.tree;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.tree.Node;
import org.jboss.starobrno.tree.TreeCache;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/SyncReplTxTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/SyncReplTxTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/SyncReplTxTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -7,11 +7,11 @@
package org.jboss.starobrno.api.tree;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.Cache;
import org.jboss.starobrno.CacheSPI;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.tree.Node;
import org.jboss.starobrno.tree.TreeCache;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/TreeCacheAPITest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/TreeCacheAPITest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/api/tree/TreeCacheAPITest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,9 +1,9 @@
package org.jboss.starobrno.api.tree;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheSPI;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.manager.CacheManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.tree.Node;
import org.jboss.starobrno.tree.TreeCache;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/atomic/APITest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/atomic/APITest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/atomic/APITest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -22,10 +22,10 @@
package org.jboss.starobrno.atomic;
import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.config.Configuration.CacheMode;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.Test;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/eviction/FIFOPolicyTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/eviction/FIFOPolicyTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/eviction/FIFOPolicyTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,13 +1,13 @@
package org.jboss.starobrno.eviction;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheSPI;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.config.EvictionCacheConfig;
import org.jboss.starobrno.config.EvictionConfig;
import org.jboss.starobrno.eviction.algorithms.fifo.FIFOAlgorithmConfig;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/notifications/CacheListenerTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/notifications/CacheListenerTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/notifications/CacheListenerTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,6 +2,7 @@
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.notifications.event.Event;
import static org.jboss.starobrno.notifications.event.Event.Type.*;
@@ -15,12 +16,7 @@
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.jboss.starobrno.UnitTestCacheFactory;
+import java.util.*;
/**
* Note that this is significantly different from the old <b>TreeCacheListenerTest</b> of the JBoss Cache 1.x series, and
@@ -42,7 +38,7 @@
Configuration c = new Configuration();
c.setCacheMode(Configuration.CacheMode.LOCAL);
c.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
- c.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ c.setTransactionManagerLookupClass("org.jboss.starobrno.transaction.DummyTransactionManagerLookup");
cache = new UnitTestCacheFactory<Object, Object>().createCache(c);
tm = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
eventLog.events.clear();
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/profiling/TreeProfileTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/profiling/TreeProfileTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/profiling/TreeProfileTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,12 +3,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManager;
import org.jboss.starobrno.Cache;
import org.jboss.starobrno.UnitTestCacheFactory;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.profiling.testinternals.Generator;
import org.jboss.starobrno.profiling.testinternals.TaskRunner;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
import org.jboss.starobrno.tree.Fqn;
import org.jboss.starobrno.tree.TreeCache;
import org.jboss.starobrno.tree.TreeCacheImpl;
@@ -60,7 +60,7 @@
cfg.setConcurrencyLevel(2000);
cfg.setLockAcquisitionTimeout(120000);
cfg.setLockParentForChildInsertRemove(true);
- cfg.setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cfg.setIsolationLevel(IsolationLevel.READ_COMMITTED);
Cache c = new UnitTestCacheFactory().createCache(cfg);
cache = new TreeCacheImpl(c);
}
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/replication/AsyncReplTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/replication/AsyncReplTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/replication/AsyncReplTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -8,20 +8,20 @@
package org.jboss.starobrno.replication;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
+import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.CacheSPI;
+import org.jboss.starobrno.UnitTestCacheManager;
+import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.manager.CacheManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
+import org.jboss.starobrno.util.TestingUtil;
+import org.jboss.starobrno.util.internals.ReplicationListener;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.transaction.TransactionManager;
-import org.jboss.starobrno.CacheSPI;
-import org.jboss.starobrno.Cache;
-import org.jboss.starobrno.UnitTestCacheManager;
-import org.jboss.starobrno.manager.CacheManager;
-import org.jboss.starobrno.config.Configuration;
-import org.jboss.starobrno.util.internals.ReplicationListener;
-import org.jboss.starobrno.util.TestingUtil;
/**
* Unit test for replicated async CacheSPI. Use locking and multiple threads to test
@@ -31,7 +31,8 @@
public class AsyncReplTest
{
- private class AsyncReplTestTL {
+ private class AsyncReplTestTL
+ {
private Configuration configuration;
private CacheSPI<Object, Object> cache1, cache2;
private CacheManager cacheManager1, cacheManager2;
@@ -107,7 +108,7 @@
cache1.put(key, "value1");
// allow for replication
replListener2.waitForReplicationToOccur(500);
- assertEquals("value1", cache1.get( key));
+ assertEquals("value1", cache1.get(key));
assertEquals("value1", cache2.get(key));
TransactionManager mgr = cache1.getTransactionManager();
@@ -211,7 +212,7 @@
{
TransactionManager tm = cache1.getTransactionManager();
tm.begin();
- cache1.put( "age", 38);
+ cache1.put("age", 38);
tm.commit();
// value on cache2 may be 38 or not yet replicated
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/replication/ExceptionTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/replication/ExceptionTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/replication/ExceptionTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,19 +1,20 @@
package org.jboss.starobrno.replication;
+import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.UnitTestCacheManager;
+import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.lock.TimeoutException;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
+import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import org.jboss.starobrno.Cache;
-import org.jboss.starobrno.util.TestingUtil;
-import org.jboss.starobrno.lock.TimeoutException;
-import org.jboss.starobrno.config.Configuration;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
-import org.jboss.starobrno.UnitTestCacheManager;
/**
* Tests the type of exceptions thrown for Lock Acquisition Timeouts versus Sync Repl Timeouts
+ *
* @author <a href="mailto:manik at jboss.org">Manik Surtani</a>
*/
@Test(groups = {"functional"}, sequential = true)
@@ -23,20 +24,20 @@
private Cache cache2;
private static String DELAYED_CLUSTER_CONFIG =
- "UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;" +
- " mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
- "PING(timeout=1000;num_initial_members=2):" +
- "MERGE2(min_interval=5000;max_interval=10000):" +
- "FD_SOCK:" +
- "VERIFY_SUSPECT(timeout=1500):" +
- "pbcast.NAKACK(gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800):" +
- "UNICAST(timeout=600,1200,2400,4800):" +
- "pbcast.STABLE(desired_avg_gossip=20000):" +
- "FRAG(frag_size=8192;down_thread=false;up_thread=false):" +
- "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
- "shun=false;print_local_addr=true):" +
- "pbcast.STATE_TRANSFER:" +
- "DELAY(in_delay=100;out_delay=100)";
+ "UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;" +
+ " mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
+ "PING(timeout=1000;num_initial_members=2):" +
+ "MERGE2(min_interval=5000;max_interval=10000):" +
+ "FD_SOCK:" +
+ "VERIFY_SUSPECT(timeout=1500):" +
+ "pbcast.NAKACK(gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800):" +
+ "UNICAST(timeout=600,1200,2400,4800):" +
+ "pbcast.STABLE(desired_avg_gossip=20000):" +
+ "FRAG(frag_size=8192;down_thread=false;up_thread=false):" +
+ "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
+ "shun=false;print_local_addr=true):" +
+ "pbcast.STATE_TRANSFER:" +
+ "DELAY(in_delay=100;out_delay=100)";
private Cache createCache(String jgroupsConfig)
{
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/replication/ReplicationExceptionTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/replication/ReplicationExceptionTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/replication/ReplicationExceptionTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -7,16 +7,17 @@
*/
package org.jboss.starobrno.replication;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.starobrno.CacheSPI;
+import org.jboss.starobrno.UnitTestCacheManager;
+import org.jboss.starobrno.config.Configuration;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
+import org.jboss.starobrno.util.TestingUtil;
import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.fail;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
-import org.jboss.starobrno.CacheSPI;
-import org.jboss.starobrno.config.Configuration;
-import org.jboss.starobrno.util.TestingUtil;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.lock.IsolationLevel;
import javax.naming.Context;
import javax.transaction.NotSupportedException;
@@ -25,7 +26,6 @@
import javax.transaction.TransactionManager;
import java.io.NotSerializableException;
import java.io.Serializable;
-import org.jboss.starobrno.UnitTestCacheManager;
/**
* Teting of replication exception for a Nonerislizable object
@@ -80,11 +80,11 @@
conf1.setIsolationLevel(IsolationLevel.SERIALIZABLE);
conf2.setIsolationLevel(IsolationLevel.SERIALIZABLE);
- conf1.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
- conf2.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
+ conf1.setTransactionManagerLookupClass("org.jboss.starobrno.transaction.DummyTransactionManagerLookup");
+ conf2.setTransactionManagerLookupClass("org.jboss.starobrno.transaction.DummyTransactionManagerLookup");
/*
- cache1.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
- cache2.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ cache1.setTransactionManagerLookupClass("org.jboss.starobrno.transaction.GenericTransactionManagerLookup");
+ cache2.setTransactionManagerLookupClass("org.jboss.starobrno.transaction.GenericTransactionManagerLookup");
*/
conf1.setLockAcquisitionTimeout(5000);
conf2.setLockAcquisitionTimeout(5000);
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/replication/SyncCacheListenerTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/replication/SyncCacheListenerTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/replication/SyncCacheListenerTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -10,16 +10,17 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.transaction.DummyTransactionManager;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheException;
import org.jboss.starobrno.CacheSPI;
+import org.jboss.starobrno.UnitTestCacheManager;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.notifications.annotation.CacheEntryModified;
import org.jboss.starobrno.notifications.annotation.CacheEntryRemoved;
import org.jboss.starobrno.notifications.annotation.CacheListener;
import org.jboss.starobrno.notifications.event.Event;
import org.jboss.starobrno.notifications.event.TransactionalEvent;
+import org.jboss.starobrno.transaction.DummyTransactionManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -31,7 +32,6 @@
import javax.transaction.TransactionManager;
import java.util.Map;
import java.util.Set;
-import org.jboss.starobrno.UnitTestCacheManager;
/**
* Test out the TreeCacheListener
@@ -149,7 +149,7 @@
{
TransactionManager tm = cache1.getConfiguration().getRuntimeConfig().getTransactionManager();
tm.begin();
- cache1.put("key","value");
+ cache1.put("key", "value");
tm.commit();
assert cache2.get("key").equals("value");
Modified: core/branches/flat/src/test/java/org/jboss/starobrno/tx/LocalModeTxTest.java
===================================================================
--- core/branches/flat/src/test/java/org/jboss/starobrno/tx/LocalModeTxTest.java 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/java/org/jboss/starobrno/tx/LocalModeTxTest.java 2008-12-11 14:44:12 UTC (rev 7281)
@@ -21,16 +21,16 @@
*/
package org.jboss.starobrno.tx;
-import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.CacheSPI;
+import org.jboss.starobrno.UnitTestCacheManager;
import org.jboss.starobrno.config.Configuration;
import org.jboss.starobrno.manager.CacheManager;
+import org.jboss.starobrno.transaction.DummyTransactionManagerLookup;
import org.jboss.starobrno.util.TestingUtil;
import org.testng.annotations.Test;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import org.jboss.starobrno.UnitTestCacheManager;
@Test(groups = "functional")
public class LocalModeTxTest
Modified: core/branches/flat/src/test/resources/configs/buddy-replication-cache.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/buddy-replication-cache.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/buddy-replication-cache.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering clusterName="JBossCache-Cluster">
<sync replTimeout="15000"/>
Modified: core/branches/flat/src/test/resources/configs/clonable-config.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/clonable-config.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/clonable-config.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="SERIALIZABLE" lockAcquisitionTimeout="1"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering clusterName="CloneCluster">
<stateRetrieval fetchInMemoryState="false" timeout="3"/>
<jgroupsConfig multiplexerStack="udp">
Modified: core/branches/flat/src/test/resources/configs/local-lru-eviction.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/local-lru-eviction.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/local-lru-eviction.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering clusterName="JBossCache-Cluster">
<stateRetrieval timeout="20000"/>
</clustering>
Modified: core/branches/flat/src/test/resources/configs/local-passivation.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/local-passivation.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/local-passivation.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<eviction wakeUpInterval="1000">
<default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
<property name="maxNodes" value="5000"/>
Modified: core/branches/flat/src/test/resources/configs/local-tx.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/local-tx.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/local-tx.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<serialization useRegionBasedMarshalling="false"/>
<eviction wakeUpInterval="5000">
<default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
Modified: core/branches/flat/src/test/resources/configs/mixedPolicy-eviction.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/mixedPolicy-eviction.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/mixedPolicy-eviction.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -3,7 +3,7 @@
xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering>
<stateRetrieval timeout="20000"/>
<jgroupsConfig configFile="udp.xml"/>
Modified: core/branches/flat/src/test/resources/configs/mux.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/mux.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/mux.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering>
<stateRetrieval timeout="20000"/>
<jgroupsConfig multiplexerStack="tcp"/>
Modified: core/branches/flat/src/test/resources/configs/mvcc-repl-sync-br.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/mvcc-repl-sync-br.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/mvcc-repl-sync-br.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns="urn:jboss:starobrno-core:config:1.0">
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering>
<stateRetrieval fetchInMemoryState="false"/>
<jgroupsConfig>
Modified: core/branches/flat/src/test/resources/configs/parser-test-async.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/parser-test-async.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/parser-test-async.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -9,7 +9,7 @@
<locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="10234"
writeSkewCheck="false" concurrencyLevel="21"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="false"/>
Modified: core/branches/flat/src/test/resources/configs/parser-test.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/parser-test.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/parser-test.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -10,7 +10,7 @@
writeSkewCheck="false" concurrencyLevel="21"/>
<!-- perCM -->
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"
syncRollbackPhase="true" syncCommitPhase="true"/>
<jmxStatistics enabled="false"/>
Modified: core/branches/flat/src/test/resources/configs/policyPerRegion-eviction.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/policyPerRegion-eviction.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/policyPerRegion-eviction.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<clustering clusterName="JBossCache-Cluster123"/>
<eviction wakeUpInterval="5000">
<default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm">
Modified: core/branches/flat/src/test/resources/configs/replSync.xml
===================================================================
--- core/branches/flat/src/test/resources/configs/replSync.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/configs/replSync.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:starobrno-core:config:1.0">
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<serialization useRegionBasedMarshalling="true"/>
<clustering>
<stateRetrieval fetchInMemoryState="true" timeout="15000"/>
Modified: core/branches/flat/src/test/resources/jbc3-registry-configs.xml
===================================================================
--- core/branches/flat/src/test/resources/jbc3-registry-configs.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/jbc3-registry-configs.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,184 +2,184 @@
<registry:cache-configs xmlns="urn:jboss:jbosscache-core:config:3.0"
xmlns:registry="urn:jboss:jbosscache-core:cache-repo:3.0">
- <!--
- Various JBoss Cache configurations, suitable for different caching
- uses (e.g. entities vs. queries).
+ <!--
+ Various JBoss Cache configurations, suitable for different caching
+ uses (e.g. entities vs. queries).
- In all cases, TransactionManager configuration not required.
- Hibernate will plug in its own transaction manager integration.
- -->
+ In all cases, TransactionManager configuration not required.
+ Hibernate will plug in its own transaction manager integration.
+ -->
- <!-- A config appropriate for entity/collection caching. -->
- <registry:cache-config name="optimistic-entity">
- <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
- <transaction syncCommitPhase="true" syncRollbackPhase="true"
- transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
- <transport clusterName="optimistic-entity" multiplexerStack="udp-sync"/>
- <invalidation>
- <sync replTimeout="20000"/>
- </invalidation>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <!-- A config appropriate for entity/collection caching. -->
+ <registry:cache-config name="optimistic-entity">
+ <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
+ <transaction syncCommitPhase="true" syncRollbackPhase="true"
+ transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
+ <transport clusterName="optimistic-entity" multiplexerStack="udp-sync"/>
+ <invalidation>
+ <sync replTimeout="20000"/>
+ </invalidation>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- A config appropriate for entity/collection caching that
-uses pessimistic locking -->
- <registry:cache-config name="pessimistic-entity">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
- <transport clusterName="pessimistic-entity" multiplexerStack="udp-sync"/>
- <invalidation>
- <sync replTimeout="20000"/>
- </invalidation>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <!-- A config appropriate for entity/collection caching that
+ uses pessimistic locking -->
+ <registry:cache-config name="pessimistic-entity">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
+ <transport clusterName="pessimistic-entity" multiplexerStack="udp-sync"/>
+ <invalidation>
+ <sync replTimeout="20000"/>
+ </invalidation>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- A config appropriate for query caching. Does not replicate
- queries. DO NOT STORE TIMESTAMPS IN THIS CACHE.
- -->
- <registry:cache-config name="local-query">
- <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <!-- A config appropriate for query caching. Does not replicate
+ queries. DO NOT STORE TIMESTAMPS IN THIS CACHE.
+ -->
+ <registry:cache-config name="local-query">
+ <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- A query cache that replicates queries. Replication is asynchronous.
- DO NOT STORE TIMESTAMPS IN THIS CACHE.
- -->
- <registry:cache-config name="replicated-query">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="false"/>
- <startup regionsInactiveOnStartup="false"/>
- <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
- <transport clusterName="replicated-query" multiplexerStack="udp"/>
- <replication>
- <async/>
- </replication>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <!-- A query cache that replicates queries. Replication is asynchronous.
+ DO NOT STORE TIMESTAMPS IN THIS CACHE.
+ -->
+ <registry:cache-config name="replicated-query">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="false"/>
+ <startup regionsInactiveOnStartup="false"/>
+ <stateRetrieval fetchInMemoryState="false" timeout="20000"/>
+ <transport clusterName="replicated-query" multiplexerStack="udp"/>
+ <replication>
+ <async/>
+ </replication>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- 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.
- -->
- <registry:cache-config name="timestamps-cache">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
- <transport clusterName="timestamps-cache" multiplexerStack="udp"/>
- <replication>
- <async/>
- </replication>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <!-- 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.
+ -->
+ <registry:cache-config name="timestamps-cache">
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
+ <transport clusterName="timestamps-cache" multiplexerStack="udp"/>
+ <replication>
+ <async/>
+ </replication>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- A config appropriate for a cache that's shared for
+ <!-- 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. -->
- <registry:cache-config name="optimistic-shared">
- <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
- <transaction syncCommitPhase="true" syncRollbackPhase="true"
- transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
- <transport clusterName="optimistic-shared" multiplexerStack="udp"/>
- <replication>
- <sync replTimeout="20000"/>
- </replication>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <registry:cache-config name="optimistic-shared">
+ <locking lockAcquisitionTimeout="15000" nodeLockingScheme="optimistic"/>
+ <transaction syncCommitPhase="true" syncRollbackPhase="true"
+ transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
+ <transport clusterName="optimistic-shared" multiplexerStack="udp"/>
+ <replication>
+ <sync replTimeout="20000"/>
+ </replication>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
- <!-- 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.
- -->
- <registry:cache-config name="pessimistic-shared">
+ <!-- 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.
+ -->
+ <registry:cache-config name="pessimistic-shared">
- <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
- <serialization useRegionBasedMarshalling="true"/>
- <startup regionsInactiveOnStartup="true"/>
- <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
- <transport clusterName="pessimistic-shared" multiplexerStack="udp"/>
- <replication>
- <sync replTimeout="20000"/>
- </replication>
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
- <attribute name="maxNodes">5000</attribute>
- <attribute name="timeToLive">1000</attribute>
- </default>
- <region name="/TS">
- <attribute name="maxNodes">0</attribute>
- <attribute name="timeToLive">0</attribute>
- </region>
- </eviction>
- </registry:cache-config>
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="15000" nodeLockingScheme="pessimistic"/>
+ <serialization useRegionBasedMarshalling="true"/>
+ <startup regionsInactiveOnStartup="true"/>
+ <stateRetrieval fetchInMemoryState="true" timeout="20000"/>
+ <transport clusterName="pessimistic-shared" multiplexerStack="udp"/>
+ <replication>
+ <sync replTimeout="20000"/>
+ </replication>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.starobrno.eviction.algorithms.lru.LRUAlgorithm">
+ <attribute name="maxNodes">5000</attribute>
+ <attribute name="timeToLive">1000</attribute>
+ </default>
+ <region name="/TS">
+ <attribute name="maxNodes">0</attribute>
+ <attribute name="timeToLive">0</attribute>
+ </region>
+ </eviction>
+ </registry:cache-config>
</registry:cache-configs>
Modified: core/branches/flat/src/test/resources/unit-test-cache-service.xml
===================================================================
--- core/branches/flat/src/test/resources/unit-test-cache-service.xml 2008-12-11 14:19:18 UTC (rev 7280)
+++ core/branches/flat/src/test/resources/unit-test-cache-service.xml 2008-12-11 14:44:12 UTC (rev 7281)
@@ -2,7 +2,7 @@
<jbosscache xmlns="urn:jboss:starobrno-core:config:1.0">
<locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="10000"/>
- <transaction transactionManagerLookupClass="org.jboss.cache.transaction.GenericTransactionManagerLookup"/>
+ <transaction transactionManagerLookupClass="org.jboss.starobrno.transaction.GenericTransactionManagerLookup"/>
<serialization useRegionBasedMarshalling="false"/>
<clustering>
<sync replTimeout="15000"/>
More information about the jbosscache-commits
mailing list