Author: mircea.markus
Date: 2008-04-14 09:22:50 -0400 (Mon, 14 Apr 2008)
New Revision: 5548
Added:
core/trunk/src/main/java/org/jboss/cache/commands/BaseCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/CommandsVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/EvictFqnCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/functional/
core/trunk/src/main/java/org/jboss/cache/commands/functional/MarshallableCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/functional/TxCacheCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/state/
core/trunk/src/main/java/org/jboss/cache/commands/state/DataVersionCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/state/GlobalTransactionCommand.java
Removed:
core/trunk/src/main/java/org/jboss/cache/commands/BaseCacheCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/CacheCommandsVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/DataVersionCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/EvictFqnCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/GlobalTransactionCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/GravitateDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/MarshallableCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/TxCacheCommand.java
Modified:
core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
core/trunk/src/main/java/org/jboss/cache/commands/CacheCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/CacheDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/ExistsNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetChildrenNamesCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeysCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/MoveCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutDataMapCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutKeyValueCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveDataCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveKeyCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/channel/BlockChannelCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/channel/UnblockChannelCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/visitors/AbstractCommandsVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/visitors/DataVersionCommandsVisitor.java
core/trunk/src/main/java/org/jboss/cache/commands/visitors/GlobalTransactionCommandsVisitor.java
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
core/trunk/src/main/java/org/jboss/cache/marshall/MethodCallWrapper.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java
Log:
JBCACHE-1222 - package redistribution
Modified: core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-14 12:26:47 UTC
(rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/RPCManagerImpl.java 2008-04-14 13:22:50 UTC
(rev 5548)
@@ -9,7 +9,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.RuntimeConfig;
import org.jboss.cache.factories.annotations.Inject;
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyFqnTransformer.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,17 +5,12 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.EvictFqnCommand;
-import org.jboss.cache.commands.GravitateDataCommand;
-import org.jboss.cache.commands.InvalidateCommand;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
+import org.jboss.cache.commands.cachedata.InvalidateCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.commands.cachedata.*;
-import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
-import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ClusteredGetCommand;
-import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
-import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ReplicateCommand;
+import org.jboss.cache.commands.remote.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -17,7 +17,7 @@
import org.jboss.cache.RegionManager;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/cluster/ReplicationQueue.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -4,7 +4,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.RPCManager;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/BaseCacheCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/BaseCacheCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/BaseCacheCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,51 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.annotations.CacheInjectionMethods;
-import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.CacheData;
-import org.jboss.cache.notifications.Notifier;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-@CacheInjectionMethods
-public abstract class BaseCacheCommand implements MarshallableCommand
-{
- protected static final Object[] EMPTY_OBJECT_ARRAY = new Object[]{};
- protected Log log = LogFactory.getLog(getClass());
- protected Notifier notifier;
- protected CacheData cacheData;
- protected CacheSPI spi;
- protected Configuration configuration;
- protected static boolean trace;
-
- @Inject
- public void init(Notifier notifier, CacheData cacheData, CacheSPI spi, Configuration
configuration)
- {
- this.notifier = notifier;
- this.cacheData = cacheData;
- this.spi = spi;
- this.configuration = configuration;
- trace = log.isTraceEnabled();
- }
-
- public Notifier getNotifier()
- {
- return notifier;
- }
-
- public CacheData getCacheData()
- {
- return cacheData;
- }
-
- public CacheSPI getSpi()
- {
- return spi;
- }
-}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/BaseCommand.java (from rev 5546,
core/trunk/src/main/java/org/jboss/cache/commands/BaseCacheCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/BaseCommand.java
(rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/BaseCommand.java 2008-04-14 13:22:50
UTC (rev 5548)
@@ -0,0 +1,52 @@
+package org.jboss.cache.commands;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.commands.functional.MarshallableCommand;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.CacheInjectionMethods;
+import org.jboss.cache.invocation.CacheData;
+import org.jboss.cache.notifications.Notifier;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+@CacheInjectionMethods
+public abstract class BaseCommand implements MarshallableCommand
+{
+ protected static final Object[] EMPTY_OBJECT_ARRAY = new Object[]{};
+ protected Log log = LogFactory.getLog(getClass());
+ protected Notifier notifier;
+ protected CacheData cacheData;
+ protected CacheSPI spi;
+ protected Configuration configuration;
+ protected static boolean trace;
+
+ @Inject
+ public void init(Notifier notifier, CacheData cacheData, CacheSPI spi, Configuration
configuration)
+ {
+ this.notifier = notifier;
+ this.cacheData = cacheData;
+ this.spi = spi;
+ this.configuration = configuration;
+ trace = log.isTraceEnabled();
+ }
+
+ public Notifier getNotifier()
+ {
+ return notifier;
+ }
+
+ public CacheData getCacheData()
+ {
+ return cacheData;
+ }
+
+ public CacheSPI getSpi()
+ {
+ return spi;
+ }
+}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/CacheCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CacheCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CacheCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -11,5 +11,5 @@
{
Object perform(InvocationContext ctx) throws Throwable;
- Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws Throwable;
+ Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable;
}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/CacheCommandsVisitor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CacheCommandsVisitor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CacheCommandsVisitor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,204 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.cachedata.*;
-import org.jboss.cache.commands.tx.PrepareCommand;
-import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.commands.tx.CommitCommand;
-import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
-import org.jboss.cache.commands.remote.*;
-import org.jboss.cache.commands.channel.BlockChannelCommand;
-import org.jboss.cache.commands.channel.UnblockChannelCommand;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public interface CacheCommandsVisitor
-{
-
-// put methods:
-// putMethodIds.add(putDataMethodLocal_id);
-// putMethodIds.add(putDataEraseMethodLocal_id);
-// putMethodIds.add(putKeyValMethodLocal_id);
-// putMethodIds.add(putDataEraseVersionedMethodLocal_id);
-// putMethodIds.add(putDataVersionedMethodLocal_id);
-// putMethodIds.add(putKeyValVersionedMethodLocal_id);
-// putMethodIds.add(putForExternalReadMethodLocal_id);
-// putMethodIds.add(putForExternalReadVersionedMethodLocal_id);
-// crudMethods
-// crudMethodIds.addAll(putMethodIds);
-// crudMethodIds.add(removeNodeMethodLocal_id);
-// crudMethodIds.add(removeKeyMethodLocal_id);
-// crudMethodIds.add(removeDataMethodLocal_id);
-// crudMethodIds.add(dataGravitationCleanupMethod_id);
-// crudMethodIds.add(moveMethodLocal_id);
-// crudMethodIds.add(removeNodeVersionedMethodLocal_id);
-// crudMethodIds.add(removeKeyVersionedMethodLocal_id);
-// crudMethodIds.add(removeDataVersionedMethodLocal_id);
-
-
- /*
- equiv of old:
- 1 - putDataEraseMethodLocal_id
- 2 - putDataMethodLocal_id
- 3 - putDataEraseVersionedMethodLocal_id
- 4 - putDataVersionedMethodLocal_id
- */
- public Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand
command) throws Throwable;
-
- /*
- equiv of old:
- 1 - putKeyValMethodLocal_id
- 2 - putKeyValVersionedMethodLocal_id
- 3 - putForExternalReadMethodLocal_id
- 4 - putForExternalReadVersionedMethodLocal_id
- */
- public Object handlePutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand
putKeyValueCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - removeNodeMethodLocal_id
- 2 - removeNodeVersionedMethodLocal_id
- */
- public Object handleRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand
removeNodeCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - removeDataMethodLocal_id
- 2 - removeDataVersionedMethodLocal_id
- */
- public Object handleRemoveDataCommand(InvocationContext ctx, RemoveDataCommand
removeDataCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - evictNodeMethodLocal_id
- 2 - evictVersionedNodeMethodLocal_id
- */
- public Object handleEvictFqnCommand(InvocationContext ctx, EvictFqnCommand
evictFqnCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - invalidateMethodLocal_id
- */
- public Object handleInvalidateCommand(InvocationContext ctx, InvalidateCommand
invalidateCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - removeKeyMethodLocal_id
- 1 - removeKeyVersionedMethodLocal_id
- */
- public Object handleRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand
removeKeyCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - getDataMapMethodLocal_id
- */
- public Object handleGetDataMapCommand(InvocationContext ctx, GetDataMapCommand
getDataMapCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - existsMethod_id
- */
- public Object handleExistsNodeCommand(InvocationContext ctx, ExistsNodeCommand
existsNodeCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - getKeyValueMethodLocal_id
- */
- public Object handleGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand
getKeyValueCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - getNodeMethodLocal_id
- */
- public Object handleGetNodeCommand(InvocationContext ctx, GetNodeCommand
getNodeCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - getKeysMethodLocal_id
- */
- public Object handleGetKeysCommand(InvocationContext ctx, GetKeysCommand
getKeysCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - getChildrenNamesMethodLocal_id
- */
- public Object handleGetChildrenNamesCommand(InvocationContext ctx,
GetChildrenNamesCommand getChildrenNamesCacheCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - moveMethodLocal_id
- */
- public Object handleMoveCommand(InvocationContext ctx, MoveCommand moveCommand) throws
Throwable;
-
- /*
- equiv of old:
- 1 - dataGravitationMethod_id
- */
- public Object handleGravitateDataCommand(InvocationContext ctx, GravitateDataCommand
gravitateDataCommand) throws Throwable;
-
- /*
- prepareMethod_id
- */
- public Object handlePrepareCommand(InvocationContext ctx, PrepareCommand
prepareCommand) throws Throwable;
-
- /*
- rollbackMethod_id
- */
- public Object handleRollbackCommand(InvocationContext ctx, RollbackCommand
rollbackCommand) throws Throwable;
-
- /*
- commitMethod_id
- */
- public Object handleCommitCommand(InvocationContext ctx, CommitCommand commitCommand)
throws Throwable;
-
- /*
- optimisticPrepareMethod_id
- */
- public Object handleOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand optimisticPrepareCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - replicateMethod_id
- 2 - replicateAllMethod_id
- */
- public Object handleReplicateCommand(InvocationContext ctx, ReplicateCommand
replicateSingleCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - remoteAnnounceBuddyPoolNameMethod_id
- */
- public Object handleAnnounceBuddyPoolName(InvocationContext ctx,
AnnounceBuddyPoolNameCommand announceBuddyPoolNameCommand) throws Throwable;
-
- /*
- equiv of old:
- 1 - remoteRemoveFromBuddyGroupMethod_id
- */
- public Object handleRemoveFromBuddyGroupCommand(InvocationContext ctx,
RemoveFromBuddyGroupCommand removeFromBuddyGroupCommand) throws Throwable;
-
- /*
- 1 - remoteAssignToBuddyGroupMethod_id
- */
- public Object handleAssignToBuddyGroupCommand(InvocationContext ctx,
AssignToBuddyGroupCommand assignToBuddyGroupCommand) throws Throwable;
-
- /*
- 1 - dataGravitationCleanupMethod_id
- */
- public Object handleDataGravitationCleanupCommand(InvocationContext ctx,
DataGravitationCleanupCommand dataGravitationCleanupCommand) throws Throwable;
-
- /*
- 1 - clusteredGetMethod_id
- */
- public Object handleClusteredGetCommand(InvocationContext ctx, ClusteredGetCommand
clusteredGetCommand) throws Throwable;
-
- /*
- blockChannelMethodLocal_id
- */
- public Object handleBlockChannelCommand(InvocationContext ctx, BlockChannelCommand
blockChannelCommand) throws Throwable;
-
- /*
- unblockChannelMethodLocal_id
- */
- public Object handleUnblockChannelCommand(InvocationContext ctx, UnblockChannelCommand
unblockChannelCommand) throws Throwable;
-}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsFactory.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -7,16 +7,12 @@
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.channel.BlockChannelCommand;
import org.jboss.cache.commands.channel.UnblockChannelCommand;
-import org.jboss.cache.commands.remote.AnnounceBuddyPoolNameCommand;
-import org.jboss.cache.commands.remote.AssignToBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ClusteredGetCommand;
-import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
-import org.jboss.cache.commands.remote.RemoveFromBuddyGroupCommand;
-import org.jboss.cache.commands.remote.ReplicateCommand;
+import org.jboss.cache.commands.remote.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.factories.ComponentRegistry;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.transaction.GlobalTransaction;
Copied: core/trunk/src/main/java/org/jboss/cache/commands/CommandsVisitor.java (from rev
5546, core/trunk/src/main/java/org/jboss/cache/commands/CacheCommandsVisitor.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/CommandsVisitor.java
(rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/commands/CommandsVisitor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,204 @@
+package org.jboss.cache.commands;
+
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.commands.cachedata.*;
+import org.jboss.cache.commands.tx.PrepareCommand;
+import org.jboss.cache.commands.tx.RollbackCommand;
+import org.jboss.cache.commands.tx.CommitCommand;
+import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
+import org.jboss.cache.commands.remote.*;
+import org.jboss.cache.commands.channel.BlockChannelCommand;
+import org.jboss.cache.commands.channel.UnblockChannelCommand;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public interface CommandsVisitor
+{
+
+// put methods:
+// putMethodIds.add(putDataMethodLocal_id);
+// putMethodIds.add(putDataEraseMethodLocal_id);
+// putMethodIds.add(putKeyValMethodLocal_id);
+// putMethodIds.add(putDataEraseVersionedMethodLocal_id);
+// putMethodIds.add(putDataVersionedMethodLocal_id);
+// putMethodIds.add(putKeyValVersionedMethodLocal_id);
+// putMethodIds.add(putForExternalReadMethodLocal_id);
+// putMethodIds.add(putForExternalReadVersionedMethodLocal_id);
+// crudMethods
+// crudMethodIds.addAll(putMethodIds);
+// crudMethodIds.add(removeNodeMethodLocal_id);
+// crudMethodIds.add(removeKeyMethodLocal_id);
+// crudMethodIds.add(removeDataMethodLocal_id);
+// crudMethodIds.add(dataGravitationCleanupMethod_id);
+// crudMethodIds.add(moveMethodLocal_id);
+// crudMethodIds.add(removeNodeVersionedMethodLocal_id);
+// crudMethodIds.add(removeKeyVersionedMethodLocal_id);
+// crudMethodIds.add(removeDataVersionedMethodLocal_id);
+
+
+ /*
+ equiv of old:
+ 1 - putDataEraseMethodLocal_id
+ 2 - putDataMethodLocal_id
+ 3 - putDataEraseVersionedMethodLocal_id
+ 4 - putDataVersionedMethodLocal_id
+ */
+ public Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand
command) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - putKeyValMethodLocal_id
+ 2 - putKeyValVersionedMethodLocal_id
+ 3 - putForExternalReadMethodLocal_id
+ 4 - putForExternalReadVersionedMethodLocal_id
+ */
+ public Object handlePutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand
putKeyValueCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - removeNodeMethodLocal_id
+ 2 - removeNodeVersionedMethodLocal_id
+ */
+ public Object handleRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand
removeNodeCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - removeDataMethodLocal_id
+ 2 - removeDataVersionedMethodLocal_id
+ */
+ public Object handleRemoveDataCommand(InvocationContext ctx, RemoveDataCommand
removeDataCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - evictNodeMethodLocal_id
+ 2 - evictVersionedNodeMethodLocal_id
+ */
+ public Object handleEvictFqnCommand(InvocationContext ctx, EvictFqnCommand
evictFqnCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - invalidateMethodLocal_id
+ */
+ public Object handleInvalidateCommand(InvocationContext ctx, InvalidateCommand
invalidateCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - removeKeyMethodLocal_id
+ 1 - removeKeyVersionedMethodLocal_id
+ */
+ public Object handleRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand
removeKeyCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - getDataMapMethodLocal_id
+ */
+ public Object handleGetDataMapCommand(InvocationContext ctx, GetDataMapCommand
getDataMapCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - existsMethod_id
+ */
+ public Object handleExistsNodeCommand(InvocationContext ctx, ExistsNodeCommand
existsNodeCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - getKeyValueMethodLocal_id
+ */
+ public Object handleGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand
getKeyValueCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - getNodeMethodLocal_id
+ */
+ public Object handleGetNodeCommand(InvocationContext ctx, GetNodeCommand
getNodeCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - getKeysMethodLocal_id
+ */
+ public Object handleGetKeysCommand(InvocationContext ctx, GetKeysCommand
getKeysCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - getChildrenNamesMethodLocal_id
+ */
+ public Object handleGetChildrenNamesCommand(InvocationContext ctx,
GetChildrenNamesCommand getChildrenNamesCacheCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - moveMethodLocal_id
+ */
+ public Object handleMoveCommand(InvocationContext ctx, MoveCommand moveCommand) throws
Throwable;
+
+ /*
+ equiv of old:
+ 1 - dataGravitationMethod_id
+ */
+ public Object handleGravitateDataCommand(InvocationContext ctx, GravitateDataCommand
gravitateDataCommand) throws Throwable;
+
+ /*
+ prepareMethod_id
+ */
+ public Object handlePrepareCommand(InvocationContext ctx, PrepareCommand
prepareCommand) throws Throwable;
+
+ /*
+ rollbackMethod_id
+ */
+ public Object handleRollbackCommand(InvocationContext ctx, RollbackCommand
rollbackCommand) throws Throwable;
+
+ /*
+ commitMethod_id
+ */
+ public Object handleCommitCommand(InvocationContext ctx, CommitCommand commitCommand)
throws Throwable;
+
+ /*
+ optimisticPrepareMethod_id
+ */
+ public Object handleOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand optimisticPrepareCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - replicateMethod_id
+ 2 - replicateAllMethod_id
+ */
+ public Object handleReplicateCommand(InvocationContext ctx, ReplicateCommand
replicateSingleCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - remoteAnnounceBuddyPoolNameMethod_id
+ */
+ public Object handleAnnounceBuddyPoolName(InvocationContext ctx,
AnnounceBuddyPoolNameCommand announceBuddyPoolNameCommand) throws Throwable;
+
+ /*
+ equiv of old:
+ 1 - remoteRemoveFromBuddyGroupMethod_id
+ */
+ public Object handleRemoveFromBuddyGroupCommand(InvocationContext ctx,
RemoveFromBuddyGroupCommand removeFromBuddyGroupCommand) throws Throwable;
+
+ /*
+ 1 - remoteAssignToBuddyGroupMethod_id
+ */
+ public Object handleAssignToBuddyGroupCommand(InvocationContext ctx,
AssignToBuddyGroupCommand assignToBuddyGroupCommand) throws Throwable;
+
+ /*
+ 1 - dataGravitationCleanupMethod_id
+ */
+ public Object handleDataGravitationCleanupCommand(InvocationContext ctx,
DataGravitationCleanupCommand dataGravitationCleanupCommand) throws Throwable;
+
+ /*
+ 1 - clusteredGetMethod_id
+ */
+ public Object handleClusteredGetCommand(InvocationContext ctx, ClusteredGetCommand
clusteredGetCommand) throws Throwable;
+
+ /*
+ blockChannelMethodLocal_id
+ */
+ public Object handleBlockChannelCommand(InvocationContext ctx, BlockChannelCommand
blockChannelCommand) throws Throwable;
+
+ /*
+ unblockChannelMethodLocal_id
+ */
+ public Object handleUnblockChannelCommand(InvocationContext ctx, UnblockChannelCommand
unblockChannelCommand) throws Throwable;
+}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/DataVersionCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/DataVersionCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/DataVersionCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,22 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.jboss.cache.optimistic.DataVersion;
-
-/**
- * Commands that know how to deal with versioned data.
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public interface DataVersionCommand extends CacheCommand
-{
- public DataVersion getDataVersion();
-
- public void setDataVersion(DataVersion dataVersion);
-
- /**
- * Has data version set? (i.e. not null)
- * // todo: should this be an abstract class rather than an interface? isVersioned()
is implemented exactly the same way in all subclasses.
- */
- public boolean isVersioned();
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/EvictFqnCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/EvictFqnCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/EvictFqnCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,86 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.CacheData;
-import org.jboss.cache.optimistic.DataVersion;
-
-/**
- * Implements functionality defined by {@link
org.jboss.cache.CacheSPI#evict(org.jboss.cache.Fqn)}
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class EvictFqnCommand extends BaseCacheCommand implements DataVersionCommand
-{
- public static final int METHOD_ID = 8;
- public static final int VERSIONED_METHOD_ID = 9;
-
- /* dependencies*/
- protected CacheData cacheData;
-
- /* parameters*/
- protected Fqn fqn;
- protected DataVersion dataVersion;
-
- public EvictFqnCommand(Fqn fqn)
- {
- this.fqn = fqn;
- }
-
- @Inject
- public void initialize(CacheData cacheData)
- {
- this.cacheData = cacheData;
- }
-
- public Object perform(InvocationContext ctx)
- {
- return cacheData.evict(fqn);
- }
-
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
- {
- return handler.handleEvictFqnCommand(ctx, this);
- }
-
- public int getCommandId()
- {
- return isVersioned() ? VERSIONED_METHOD_ID : METHOD_ID;
- }
-
- public Fqn getFqn()
- {
- return fqn;
- }
-
- public DataVersion getDataVersion()
- {
- return dataVersion;
- }
-
- public void setDataVersion(DataVersion dataVersion)
- {
- this.dataVersion = dataVersion;
- }
-
- public boolean isVersioned()
- {
- return dataVersion != null;
- }
-
- public Object[] getParameters()
- {
- if (isVersioned())
- return new Object[]{fqn, dataVersion};
- else
- return new Object[]{fqn};
- }
-
- public void setState(int commandId, Object[] args)
- {
- fqn = (Fqn) args[0];
- if (commandId == VERSIONED_METHOD_ID) dataVersion = (DataVersion) args[1];
- }
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/GlobalTransactionCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/GlobalTransactionCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/GlobalTransactionCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,14 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.jboss.cache.transaction.GlobalTransaction;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public interface GlobalTransactionCommand extends CacheCommand
-{
- public GlobalTransaction getGlobalTransaction();
-
- void setGlobalTransaction(GlobalTransaction gtx);
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/GravitateDataCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/GravitateDataCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/GravitateDataCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,188 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.RPCManager;
-import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
-import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.buddyreplication.GravitateResult;
-import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.CacheData;
-import org.jboss.cache.marshall.NodeData;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- * Used with buddy replication's data gravitation interceptor. If marshalling is
necessary, ensure that the cache is
- * configured to use {@link
org.jboss.cache.config.Configuration#useRegionBasedMarshalling} and the {@link
org.jboss.cache.Region}
- * pertaining to the Fqn passed in is activated, and has an appropriate ClassLoader.
- * todo - this should not be a command as none relally visits it. It was inherited this
way from old CacheImpl
- */
-public class GravitateDataCommand extends BaseCacheCommand implements CacheCommand
-{
- public static final int METHOD_ID = 35;
- private static final Log log = LogFactory.getLog(GravitateDataCommand.class);
-
- /* dependencies */
- private CacheSPI spi; //todo ugly dependency, revisit
- private RPCManager rpcManager;
- private CacheData cacheData;
-
- /* parametres */
- private Fqn fqn;
- private boolean searchSubtrees;
-
- public GravitateDataCommand(Fqn fqn, boolean searchSubtrees)
- {
- this.fqn = fqn;
- this.searchSubtrees = searchSubtrees;
- }
-
- @Inject
- public void initialize(CacheSPI spi, RPCManager manager, CacheData cacheData)
- {
- this.spi = spi;
- this.rpcManager = manager;
- this.cacheData = cacheData;
- }
-
- public Object perform(InvocationContext ctx)
- {
- // for now, perform a very simple series of getData calls.
- if (log.isTraceEnabled()) log.trace("Caller is asking for " + fqn);
- try
- {
- ctx.setOriginLocal(false);
- // use a get() call into the cache to make sure cache loading takes place.
- // no need to cache the original skipDataGravitation setting here - it will
always be false of we got here!!
- ctx.getOptionOverrides().setSkipDataGravitation(true);
- Node actualNode = spi.getNode(fqn);
- ctx.getOptionOverrides().setSkipDataGravitation(false);
-
- if (log.isTraceEnabled()) log.trace("In local tree, this is " +
actualNode);
-
- Fqn backupNodeFqn = null;
- if (actualNode == null && searchSubtrees)
- {
- log.trace("Looking at backup trees.");
- NodeSPI backupSubtree =
cacheData.findNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
- if (backupSubtree != null)
- {
- // need to loop through backupSubtree's children
- Set childNames = backupSubtree.getChildrenNamesDirect();
- if (childNames != null)
- {
- for (Object childName : childNames)
- {
- // childName is the name of a buddy group since all child names in
this
- // collection are direct children of BUDDY_BACKUP_SUBTREE_FQN
- Fqn backupRoot =
Fqn.fromRelativeElements(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, childName);
- if (BuddyManager.isDeadBackupRoot(backupRoot))
- {
- //actualNode = searchDeadRoot(backupRoot, fqn);
- Set<Integer> deadChildNames = new
TreeSet<Integer>(spi.getChildrenNames(backupRoot));
- Integer[] elems = deadChildNames.toArray(new Integer[]{});
-
- // these are integers. we need to start with the highest/most
recent.
- for (int i = elems.length - 1; i > -1; i--)
- {
- Integer versionOfDefunctData = elems[i];
- backupNodeFqn =
Fqn.fromRelativeFqn(Fqn.fromRelativeElements(backupRoot, versionOfDefunctData), fqn);
-
- // use a get() call into the cache to make sure cache loading
takes place.
- ctx.getOptionOverrides().setSkipDataGravitation(true);
- actualNode = spi.peek(backupNodeFqn, false);
- ctx.getOptionOverrides().setSkipDataGravitation(false);
-
- // break out of the inner loop searching through the dead
node's various backups
- if (actualNode != null) break;
- }
- }
- else
- {
- backupNodeFqn = Fqn.fromRelativeFqn(backupRoot, fqn);
- // use a get() call into the cache to make sure cache loading
takes place.
- ctx.getOptionOverrides().setSkipDataGravitation(true);
- actualNode = spi.getNode(backupNodeFqn);
- ctx.getOptionOverrides().setSkipDataGravitation(false);
- }
-
- if (log.isTraceEnabled())
- log.trace("Looking for " + backupNodeFqn + ".
Search result: " + actualNode);
-
- // break out of outer loop searching through all available backups.
- if (actualNode != null) break;
- }
- }
- }
- }
-
- if (actualNode == null)
- {
- return GravitateResult.noDataFound();
- }
- else
- {
- // make sure we LOAD data for this node!!
- actualNode.getData();
- }
-
- if (backupNodeFqn == null && searchSubtrees)
- {
- backupNodeFqn =
BuddyFqnTransformer.getBackupFqn(BuddyManager.getGroupNameFromAddress(rpcManager.getLocalAddress()),
fqn);
- }
-
- List<NodeData> list = cacheData.getNodeData(new
LinkedList<NodeData>(), (NodeSPI) actualNode);
-
- return GravitateResult.subtreeResult(list, backupNodeFqn);
- }
- catch (RuntimeException re)
- {
- if (log.isTraceEnabled()) log.trace("Caught throwable", re);
- throw re;
- }
- finally
- {
- ctx.setOriginLocal(true);
- }
- }
-
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
- {
- return handler.handleGravitateDataCommand(ctx, this);
- }
-
- public int getCommandId()
- {
- return METHOD_ID;
- }
-
- public Fqn getFqn()
- {
- return fqn;
- }
-
- public boolean isSearchSubtrees()
- {
- return searchSubtrees;
- }
-
- public Object[] getParameters()
- {
- return new Object[]{fqn, searchSubtrees};
- }
-
- public void setState(int commandId, Object[] args)
- {
- fqn = (Fqn) args[0];
- searchSubtrees = (Boolean) args[1];
- }
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/InvalidateCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/InvalidateCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/InvalidateCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,158 +0,0 @@
-package org.jboss.cache.commands;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.config.Option;
-import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.CacheData;
-import org.jboss.cache.marshall.MethodCall;
-import org.jboss.cache.notifications.Notifier;
-import org.jboss.cache.optimistic.DataVersion;
-
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * Very much like an evict(), except that regardless of whether there is a child present,
this call will never
- * remove the node from memory - just remove its contents.
- * <p/>
- * Also, potentially throws a cache exception if data versioning is used and the node in
memory has a newer data
- * version than what is passed in.
- * <p/>
- * Finally, the data version of the in-memory node is updated to the version being
evicted to prevent versions
- * going out of sync.
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class InvalidateCommand extends EvictFqnCommand
-{
- private static final Log log = LogFactory.getLog(InvalidateCommand.class);
-
- /* dependencies*/
- private boolean isOptimisticLocking;
- private Notifier notifier;
- private CacheSPI cacheSpi;//todo this is ugly, revisit
- private TransactionManager transactionManager;
-
- public InvalidateCommand(Fqn fqn)
- {
- super(fqn);
- }
-
- @Inject
- public void initialize(CacheData cacheData, Notifier notifier, CacheSPI cacheSPI,
TransactionManager txManager, boolean isOptimisticLocking)
- {
- super.initialize(cacheData);
- this.notifier = notifier;
- this.cacheSpi = cacheSPI;
- this.transactionManager = txManager;
- this.isOptimisticLocking = isOptimisticLocking;
- }
-
- public Object perform(InvocationContext ctx)
- {
- Node node = cacheSpi.getNode(fqn); // force interceptor chain, load if necessary
from cache loader.
-
- if (node == null)
- {
- // if pessimistic locking, just return.
- if (!isOptimisticLocking) return null;
-
- // check if a tombstone already exists
- NodeSPI nodeSPI = cacheData.peek(fqn, false, true);
- if (nodeSPI == null)
- {
- if (dataVersion == null)
- {
- if (log.isTraceEnabled())
- log.trace("Would have created a tombstone since the node
doesn't exist, but the version to invalidate is null and hence cannot create a
tombstone!");
- return null;
- }
- if (log.isTraceEnabled())
- log.trace("Node doesn't exist; creating a tombstone with data
version " + dataVersion);
- // create the node we need.
- Map m = Collections.emptyMap();
- InvocationContext ic = cacheSpi.getInvocationContext();
- Option o = ic.getOptionOverrides();
- boolean origCacheModeLocal = o.isCacheModeLocal();
- o.setCacheModeLocal(true);
- o.setDataVersion(dataVersion);
- // if we are in a tx this call should happen outside of any tx
- try
- {
- Transaction suspended = null;
- if (transactionManager != null)
- {
- suspended = transactionManager.suspend();
- }
- cacheSpi.put(fqn, m);
- if (suspended != null) transactionManager.resume(suspended);
- ic.getOptionOverrides().setCacheModeLocal(origCacheModeLocal);
- }
- catch (Exception e)
- {
- log.error("Unable to create tombstone!", e);
- }
- nodeSPI = (NodeSPI) cacheData.getRoot().getChild(fqn);
- }
- node = nodeSPI;
- }
-
- if (isOptimisticLocking)
- removeData();
- else
- super.perform(ctx);
-
- // mark the node to be removed (and all children) as invalid so anyone holding a
direct reference to it will
- // be aware that it is no longer valid.
- ((NodeSPI) node).setValid(false, true);
-
- if (dataVersion != null)
- {
- NodeSPI n = cacheData.peek(fqn, false, true);
- n.setVersion(dataVersion);
- }
- return null;
- }
-
- public void removeData()
- throws CacheException
- {
- MethodCall undo_op = null;
- // Find the node. This will lock it (if <tt>locking</tt> is true) and
- // add the temporarily created parent nodes to the TX's node list if tx !=
null)
- NodeSPI n = cacheData.findNode(fqn, dataVersion);
- if (n == null)
- {
- log.warn("node " + fqn + " not found");
- return;
- }
- InvocationContext ctx = cacheSpi.getInvocationContext();
- notifier.notifyNodeEvicted(fqn, true, ctx);
- n.clearDataDirect();
- n.setDataLoaded(false);
-
- // FIXME Bela did this so GUI view can refresh the view after node is evicted. But
this breaks eviction policy, especially AOP!!!!
- notifier.notifyNodeEvicted(fqn, false, ctx);
- }
-
-
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
- {
- return handler.handleInvalidateCommand(ctx, this);
- }
-
- public DataVersion getVersionToInvalidate()
- {
- return dataVersion;
- }
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/MarshallableCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/MarshallableCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/MarshallableCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,29 +0,0 @@
-package org.jboss.cache.commands;
-
-/**
- * Declares methods to expose internals of the command such that a {@link
org.jboss.cache.marshall.Marshaller} is able to
- * marshall the command for streaming over the wire.
- *
- * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @since 2.2.0
- */
-public interface MarshallableCommand extends CacheCommand
-{
- /**
- * @return the method id of this command. This is compatible with pre-2.2.0
MethodCall ids.
- */
- int getCommandId();
-
- /**
- * @return an object array of arguments, compatible with pre-2.2.0 MethodCall args.
- */
- Object[] getParameters();
-
- /**
- * Sets the state of a command instance with unmarshalled command id and args.
- *
- * @param commandId command id to set. This is usually unused but *could* be used in
the event of a command having multiple IDs, such as {@link
org.jboss.cache.commands.cachedata.PutKeyValueCommand}.
- * @param args object array of args
- */
- void setState(int commandId, Object[] args);
-}
Deleted: core/trunk/src/main/java/org/jboss/cache/commands/TxCacheCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/TxCacheCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/TxCacheCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,12 +0,0 @@
-package org.jboss.cache.commands;
-
-/**
- * Base class for commands that also suppor rollback.
- *
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public interface TxCacheCommand extends CacheCommand
-{
- public abstract void rollback();
-}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/CacheDataCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/CacheDataCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/CacheDataCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,7 +2,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
/**
* Defines a command that manipulates data on cache.
Copied: core/trunk/src/main/java/org/jboss/cache/commands/cachedata/EvictFqnCommand.java
(from rev 5546, core/trunk/src/main/java/org/jboss/cache/commands/EvictFqnCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/cachedata/EvictFqnCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/EvictFqnCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,89 @@
+package org.jboss.cache.commands.cachedata;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.invocation.CacheData;
+import org.jboss.cache.optimistic.DataVersion;
+
+/**
+ * Implements functionality defined by {@link
org.jboss.cache.CacheSPI#evict(org.jboss.cache.Fqn)}
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public class EvictFqnCommand extends BaseCommand implements DataVersionCommand
+{
+ public static final int METHOD_ID = 8;
+ public static final int VERSIONED_METHOD_ID = 9;
+
+ /* dependencies*/
+ protected CacheData cacheData;
+
+ /* parameters*/
+ protected Fqn fqn;
+ protected DataVersion dataVersion;
+
+ public EvictFqnCommand(Fqn fqn)
+ {
+ this.fqn = fqn;
+ }
+
+ @Inject
+ public void initialize(CacheData cacheData)
+ {
+ this.cacheData = cacheData;
+ }
+
+ public Object perform(InvocationContext ctx)
+ {
+ return cacheData.evict(fqn);
+ }
+
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
+ {
+ return handler.handleEvictFqnCommand(ctx, this);
+ }
+
+ public int getCommandId()
+ {
+ return isVersioned() ? VERSIONED_METHOD_ID : METHOD_ID;
+ }
+
+ public Fqn getFqn()
+ {
+ return fqn;
+ }
+
+ public DataVersion getDataVersion()
+ {
+ return dataVersion;
+ }
+
+ public void setDataVersion(DataVersion dataVersion)
+ {
+ this.dataVersion = dataVersion;
+ }
+
+ public boolean isVersioned()
+ {
+ return dataVersion != null;
+ }
+
+ public Object[] getParameters()
+ {
+ if (isVersioned())
+ return new Object[]{fqn, dataVersion};
+ else
+ return new Object[]{fqn};
+ }
+
+ public void setState(int commandId, Object[] args)
+ {
+ fqn = (Fqn) args[0];
+ if (commandId == VERSIONED_METHOD_ID) dataVersion = (DataVersion) args[1];
+ }
+}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/ExistsNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/ExistsNodeCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/ExistsNodeCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.Node;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -17,7 +17,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ExistsNodeCommand extends BaseCacheCommand implements CacheDataCommand
+public class ExistsNodeCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 16;
@@ -46,7 +46,7 @@
return n != null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleExistsNodeCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetChildrenNamesCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetChildrenNamesCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetChildrenNamesCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -18,7 +18,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class GetChildrenNamesCommand extends BaseCacheCommand implements
CacheDataCommand
+public class GetChildrenNamesCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 23;
@@ -63,7 +63,7 @@
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleGetChildrenNamesCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetDataMapCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetDataMapCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetDataMapCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -14,7 +14,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class GetDataMapCommand extends BaseCacheCommand implements CacheDataCommand
+public class GetDataMapCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 24;
@@ -44,7 +44,7 @@
return n.getDataDirect();
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleGetDataMapCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeyValueCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeyValueCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeyValueCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,8 +5,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -17,7 +17,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class GetKeyValueCommand extends BaseCacheCommand implements CacheDataCommand
+public class GetKeyValueCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 26;
@@ -69,7 +69,7 @@
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleGetKeyValueCommand(ctx, this);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeysCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeysCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetKeysCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -17,7 +17,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class GetKeysCommand extends BaseCacheCommand implements CacheDataCommand
+public class GetKeysCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 25;
@@ -51,7 +51,7 @@
return new HashSet(keys);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleGetKeysCommand(ctx, this);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetNodeCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/GetNodeCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,8 +2,8 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -13,7 +13,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class GetNodeCommand extends BaseCacheCommand implements CacheDataCommand
+public class GetNodeCommand extends BaseCommand implements CacheDataCommand
{
public static final int METHOD_ID = 31;
@@ -41,7 +41,7 @@
return cacheData.findNode(fqn);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleGetNodeCommand(ctx, this);
}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/cachedata/InvalidateCommand.java
(from rev 5546, core/trunk/src/main/java/org/jboss/cache/commands/InvalidateCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/cachedata/InvalidateCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/InvalidateCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,152 @@
+package org.jboss.cache.commands.cachedata;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.*;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.config.Option;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.invocation.CacheData;
+import org.jboss.cache.notifications.Notifier;
+import org.jboss.cache.optimistic.DataVersion;
+
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * Very much like an evict(), except that regardless of whether there is a child present,
this call will never
+ * remove the node from memory - just remove its contents.
+ * <p/>
+ * Also, potentially throws a cache exception if data versioning is used and the node in
memory has a newer data
+ * version than what is passed in.
+ * <p/>
+ * Finally, the data version of the in-memory node is updated to the version being
evicted to prevent versions
+ * going out of sync.
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public class InvalidateCommand extends EvictFqnCommand
+{
+ private static final Log log = LogFactory.getLog(InvalidateCommand.class);
+
+ /* dependencies*/
+ private boolean isOptimisticLocking;
+ private Notifier notifier;
+ private CacheSPI cacheSpi;//todo this is ugly, revisit
+ private TransactionManager transactionManager;
+
+ public InvalidateCommand(Fqn fqn)
+ {
+ super(fqn);
+ }
+
+ @Inject
+ public void initialize(CacheData cacheData, Notifier notifier, CacheSPI cacheSPI,
TransactionManager txManager, boolean isOptimisticLocking)
+ {
+ super.initialize(cacheData);
+ this.notifier = notifier;
+ this.cacheSpi = cacheSPI;
+ this.transactionManager = txManager;
+ this.isOptimisticLocking = isOptimisticLocking;
+ }
+
+ public Object perform(InvocationContext ctx)
+ {
+ Node node = cacheSpi.getNode(fqn); // force interceptor chain, load if necessary
from cache loader.
+
+ if (node == null)
+ {
+ // if pessimistic locking, just return.
+ if (!isOptimisticLocking) return null;
+
+ // check if a tombstone already exists
+ NodeSPI nodeSPI = cacheData.peek(fqn, false, true);
+ if (nodeSPI == null)
+ {
+ if (dataVersion == null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Would have created a tombstone since the node
doesn't exist, but the version to invalidate is null and hence cannot create a
tombstone!");
+ return null;
+ }
+ if (log.isTraceEnabled())
+ log.trace("Node doesn't exist; creating a tombstone with data
version " + dataVersion);
+ // create the node we need.
+ Map m = Collections.emptyMap();
+ InvocationContext ic = cacheSpi.getInvocationContext();
+ Option o = ic.getOptionOverrides();
+ boolean origCacheModeLocal = o.isCacheModeLocal();
+ o.setCacheModeLocal(true);
+ o.setDataVersion(dataVersion);
+ // if we are in a tx this call should happen outside of any tx
+ try
+ {
+ Transaction suspended = null;
+ if (transactionManager != null)
+ {
+ suspended = transactionManager.suspend();
+ }
+ cacheSpi.put(fqn, m);
+ if (suspended != null) transactionManager.resume(suspended);
+ ic.getOptionOverrides().setCacheModeLocal(origCacheModeLocal);
+ }
+ catch (Exception e)
+ {
+ log.error("Unable to create tombstone!", e);
+ }
+ nodeSPI = (NodeSPI) cacheData.getRoot().getChild(fqn);
+ }
+ node = nodeSPI;
+ }
+
+ if (isOptimisticLocking)
+ removeData();
+ else
+ super.perform(ctx);
+
+ // mark the node to be removed (and all children) as invalid so anyone holding a
direct reference to it will
+ // be aware that it is no longer valid.
+ ((NodeSPI) node).setValid(false, true);
+
+ if (dataVersion != null)
+ {
+ NodeSPI n = cacheData.peek(fqn, false, true);
+ n.setVersion(dataVersion);
+ }
+ return null;
+ }
+
+ public void removeData()
+ throws CacheException
+ {
+ // Find the node. This will lock it (if <tt>locking</tt> is true) and
+ // add the temporarily created parent nodes to the TX's node list if tx !=
null)
+ NodeSPI n = cacheData.findNode(fqn, dataVersion);
+ if (n == null)
+ {
+ log.warn("node " + fqn + " not found");
+ return;
+ }
+ InvocationContext ctx = cacheSpi.getInvocationContext();
+ notifier.notifyNodeEvicted(fqn, true, ctx);
+ n.clearDataDirect();
+ n.setDataLoaded(false);
+
+ // FIXME Bela did this so GUI view can refresh the view after node is evicted. But
this breaks eviction policy, especially AOP!!!!
+ notifier.notifyNodeEvicted(fqn, false, ctx);
+ }
+
+
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
+ {
+ return handler.handleInvalidateCommand(ctx, this);
+ }
+
+ public DataVersion getVersionToInvalidate()
+ {
+ return dataVersion;
+ }
+}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/cachedata/MoveCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/MoveCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/MoveCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -4,9 +4,9 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -18,7 +18,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class MoveCommand extends BaseCacheCommand implements TxCacheCommand,
CacheDataCommand
+public class MoveCommand extends BaseCommand implements TxCacheCommand, CacheDataCommand
{
public static final int METHOD_ID = 36;
@@ -67,7 +67,7 @@
node.setFqn(newFqn);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleMoveCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutDataMapCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutDataMapCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutDataMapCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,11 +5,11 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -26,7 +26,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class PutDataMapCommand extends BaseCacheCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
+public class PutDataMapCommand extends BaseCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
{
public static final int METHOD_ID = 1;
public static final int ERASE_METHOD_ID = 2;
@@ -105,7 +105,7 @@
n.putAllDirect(oldData);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handlePutDataMapCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutKeyValueCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutKeyValueCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/PutKeyValueCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,11 +5,11 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -27,7 +27,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class PutKeyValueCommand extends BaseCacheCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
+public class PutKeyValueCommand extends BaseCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
{
public static final int METHOD_ID = 3;
public static final int VERSIONED_METHOD_ID = 39;
@@ -117,7 +117,7 @@
}
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handlePutKeyValueCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveDataCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveDataCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveDataCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,11 +5,11 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.*;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -27,7 +27,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveDataCommand extends BaseCacheCommand implements TxCacheCommand,
DataVersionCommand, GlobalTransactionCommand
+public class RemoveDataCommand extends BaseCommand implements TxCacheCommand,
DataVersionCommand, GlobalTransactionCommand
{
public static final int METHOD_ID = 7;
public static final int VERSIONED_METHOD_ID = 42;
@@ -152,7 +152,7 @@
nodeSPI.putAllDirect(originalData);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleRemoveDataCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveKeyCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveKeyCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveKeyCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,11 +5,11 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.notifications.Notifier;
@@ -27,7 +27,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveKeyCommand extends BaseCacheCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
+public class RemoveKeyCommand extends BaseCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
{
public static final int METHOD_ID = 6;
public static final int VERSIONED_METHOD_ID = 41;
@@ -100,7 +100,7 @@
targetNode.putDirect(key, oldValue);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleRemoveKeyCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/cachedata/RemoveNodeCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,11 +5,11 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
@@ -24,7 +24,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveNodeCommand extends BaseCacheCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
+public class RemoveNodeCommand extends BaseCommand implements TxCacheCommand,
CacheDataCommand, DataVersionCommand, GlobalTransactionCommand
{
public static final int METHOD_ID = 5;
public static final int VERSIONED_METHOD_ID = 40;
@@ -173,7 +173,7 @@
targetNode.setValid(true, true);
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleRemoveNodeCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/channel/BlockChannelCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/channel/BlockChannelCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/channel/BlockChannelCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,9 +1,9 @@
package org.jboss.cache.commands.channel;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
/**
* todo - this is only used by notification interceptor, guess it can be removed and
notifications
@@ -12,7 +12,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class BlockChannelCommand extends BaseCacheCommand implements CacheCommand
+public class BlockChannelCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 43;
@@ -25,7 +25,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleBlockChannelCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/channel/UnblockChannelCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/channel/UnblockChannelCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/channel/UnblockChannelCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,9 +1,9 @@
package org.jboss.cache.commands.channel;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
/**
* todo - this is only used by notification interceptor, guess it can be removed and
notifications
@@ -12,7 +12,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class UnblockChannelCommand extends BaseCacheCommand implements CacheCommand
+public class UnblockChannelCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 43;
@@ -26,7 +26,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleUnblockChannelCommand(ctx, this);
}
Copied:
core/trunk/src/main/java/org/jboss/cache/commands/functional/MarshallableCommand.java
(from rev 5546,
core/trunk/src/main/java/org/jboss/cache/commands/MarshallableCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/functional/MarshallableCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/functional/MarshallableCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,31 @@
+package org.jboss.cache.commands.functional;
+
+import org.jboss.cache.commands.CacheCommand;
+
+/**
+ * Declares methods to expose internals of the command such that a {@link
org.jboss.cache.marshall.Marshaller} is able to
+ * marshall the command for streaming over the wire.
+ *
+ * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
+ * @since 2.2.0
+ */
+public interface MarshallableCommand extends CacheCommand
+{
+ /**
+ * @return the method id of this command. This is compatible with pre-2.2.0
MethodCall ids.
+ */
+ int getCommandId();
+
+ /**
+ * @return an object array of arguments, compatible with pre-2.2.0 MethodCall args.
+ */
+ Object[] getParameters();
+
+ /**
+ * Sets the state of a command instance with unmarshalled command id and args.
+ *
+ * @param commandId command id to set. This is usually unused but *could* be used in
the event of a command having multiple IDs, such as {@link
org.jboss.cache.commands.cachedata.PutKeyValueCommand}.
+ * @param args object array of args
+ */
+ void setState(int commandId, Object[] args);
+}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/functional/TxCacheCommand.java
(from rev 5546, core/trunk/src/main/java/org/jboss/cache/commands/TxCacheCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/functional/TxCacheCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/functional/TxCacheCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,14 @@
+package org.jboss.cache.commands.functional;
+
+import org.jboss.cache.commands.CacheCommand;
+
+/**
+ * Base class for commands that also suppor rollback.
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public interface TxCacheCommand extends CacheCommand
+{
+ public abstract void rollback();
+}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/AnnounceBuddyPoolNameCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -4,9 +4,9 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import org.jgroups.Address;
@@ -14,7 +14,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class AnnounceBuddyPoolNameCommand extends BaseCacheCommand implements
CacheCommand
+public class AnnounceBuddyPoolNameCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 28;
private static final Log log = LogFactory.getLog(AnnounceBuddyPoolNameCommand.class);
@@ -52,7 +52,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleAnnounceBuddyPoolName(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/AssignToBuddyGroupCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -6,9 +6,9 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
import java.util.Map;
@@ -17,7 +17,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class AssignToBuddyGroupCommand extends BaseCacheCommand implements CacheCommand
+public class AssignToBuddyGroupCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 29;
private static final Log log = LogFactory.getLog(AssignToBuddyGroupCommand.class);
@@ -53,7 +53,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleAssignToBuddyGroupCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/ClusteredGetCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -3,9 +3,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.commands.cachedata.CacheDataCommand;
import org.jboss.cache.commands.cachedata.ExistsNodeCommand;
import org.jboss.cache.commands.cachedata.GetChildrenNamesCommand;
@@ -21,7 +21,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ClusteredGetCommand extends BaseCacheCommand implements CacheCommand
+public class ClusteredGetCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 22;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
@@ -82,7 +82,7 @@
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleClusteredGetCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/DataGravitationCleanupCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -6,13 +6,12 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.EvictFqnCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.*;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.RemoveNodeCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.CacheData;
import org.jboss.cache.invocation.CacheTransactionHelper;
@@ -29,7 +28,7 @@
* todo this calls other commands through the invocation chain, check wheter
direct call is not okay
* todo it is not natural for this command to extend TxCC, revisit
*/
-public class DataGravitationCleanupCommand extends BaseCacheCommand implements
TxCacheCommand, GlobalTransactionCommand
+public class DataGravitationCleanupCommand extends BaseCommand implements TxCacheCommand,
GlobalTransactionCommand
{
public static final int METHOD_ID = 34;
private static final Log log =
LogFactory.getLog(DataGravitationCleanupCommand.class);
@@ -140,7 +139,7 @@
}
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleDataGravitationCleanupCommand(ctx, this);
}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/remote/GravitateDataCommand.java
(from rev 5546,
core/trunk/src/main/java/org/jboss/cache/commands/GravitateDataCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/remote/GravitateDataCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/GravitateDataCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,191 @@
+package org.jboss.cache.commands.remote;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.RPCManager;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CacheCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
+import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.invocation.CacheData;
+import org.jboss.cache.marshall.NodeData;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ * Used with buddy replication's data gravitation interceptor. If marshalling is
necessary, ensure that the cache is
+ * configured to use {@link
org.jboss.cache.config.Configuration#useRegionBasedMarshalling} and the {@link
org.jboss.cache.Region}
+ * pertaining to the Fqn passed in is activated, and has an appropriate ClassLoader.
+ * todo - this should not be a command as none relally visits it. It was inherited this
way from old CacheImpl
+ */
+public class GravitateDataCommand extends BaseCommand implements CacheCommand
+{
+ public static final int METHOD_ID = 35;
+ private static final Log log = LogFactory.getLog(GravitateDataCommand.class);
+
+ /* dependencies */
+ private CacheSPI spi; //todo ugly dependency, revisit
+ private RPCManager rpcManager;
+ private CacheData cacheData;
+
+ /* parametres */
+ private Fqn fqn;
+ private boolean searchSubtrees;
+
+ public GravitateDataCommand(Fqn fqn, boolean searchSubtrees)
+ {
+ this.fqn = fqn;
+ this.searchSubtrees = searchSubtrees;
+ }
+
+ @Inject
+ public void initialize(CacheSPI spi, RPCManager manager, CacheData cacheData)
+ {
+ this.spi = spi;
+ this.rpcManager = manager;
+ this.cacheData = cacheData;
+ }
+
+ public Object perform(InvocationContext ctx)
+ {
+ // for now, perform a very simple series of getData calls.
+ if (log.isTraceEnabled()) log.trace("Caller is asking for " + fqn);
+ try
+ {
+ ctx.setOriginLocal(false);
+ // use a get() call into the cache to make sure cache loading takes place.
+ // no need to cache the original skipDataGravitation setting here - it will
always be false of we got here!!
+ ctx.getOptionOverrides().setSkipDataGravitation(true);
+ Node actualNode = spi.getNode(fqn);
+ ctx.getOptionOverrides().setSkipDataGravitation(false);
+
+ if (log.isTraceEnabled()) log.trace("In local tree, this is " +
actualNode);
+
+ Fqn backupNodeFqn = null;
+ if (actualNode == null && searchSubtrees)
+ {
+ log.trace("Looking at backup trees.");
+ NodeSPI backupSubtree =
cacheData.findNode(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN);
+ if (backupSubtree != null)
+ {
+ // need to loop through backupSubtree's children
+ Set childNames = backupSubtree.getChildrenNamesDirect();
+ if (childNames != null)
+ {
+ for (Object childName : childNames)
+ {
+ // childName is the name of a buddy group since all child names in
this
+ // collection are direct children of BUDDY_BACKUP_SUBTREE_FQN
+ Fqn backupRoot =
Fqn.fromRelativeElements(BuddyManager.BUDDY_BACKUP_SUBTREE_FQN, childName);
+ if (BuddyManager.isDeadBackupRoot(backupRoot))
+ {
+ //actualNode = searchDeadRoot(backupRoot, fqn);
+ Set<Integer> deadChildNames = new
TreeSet<Integer>(spi.getChildrenNames(backupRoot));
+ Integer[] elems = deadChildNames.toArray(new Integer[]{});
+
+ // these are integers. we need to start with the highest/most
recent.
+ for (int i = elems.length - 1; i > -1; i--)
+ {
+ Integer versionOfDefunctData = elems[i];
+ backupNodeFqn =
Fqn.fromRelativeFqn(Fqn.fromRelativeElements(backupRoot, versionOfDefunctData), fqn);
+
+ // use a get() call into the cache to make sure cache loading
takes place.
+ ctx.getOptionOverrides().setSkipDataGravitation(true);
+ actualNode = spi.peek(backupNodeFqn, false);
+ ctx.getOptionOverrides().setSkipDataGravitation(false);
+
+ // break out of the inner loop searching through the dead
node's various backups
+ if (actualNode != null) break;
+ }
+ }
+ else
+ {
+ backupNodeFqn = Fqn.fromRelativeFqn(backupRoot, fqn);
+ // use a get() call into the cache to make sure cache loading
takes place.
+ ctx.getOptionOverrides().setSkipDataGravitation(true);
+ actualNode = spi.getNode(backupNodeFqn);
+ ctx.getOptionOverrides().setSkipDataGravitation(false);
+ }
+
+ if (log.isTraceEnabled())
+ log.trace("Looking for " + backupNodeFqn + ".
Search result: " + actualNode);
+
+ // break out of outer loop searching through all available backups.
+ if (actualNode != null) break;
+ }
+ }
+ }
+ }
+
+ if (actualNode == null)
+ {
+ return GravitateResult.noDataFound();
+ }
+ else
+ {
+ // make sure we LOAD data for this node!!
+ actualNode.getData();
+ }
+
+ if (backupNodeFqn == null && searchSubtrees)
+ {
+ backupNodeFqn =
BuddyFqnTransformer.getBackupFqn(BuddyManager.getGroupNameFromAddress(rpcManager.getLocalAddress()),
fqn);
+ }
+
+ List<NodeData> list = cacheData.getNodeData(new
LinkedList<NodeData>(), (NodeSPI) actualNode);
+
+ return GravitateResult.subtreeResult(list, backupNodeFqn);
+ }
+ catch (RuntimeException re)
+ {
+ if (log.isTraceEnabled()) log.trace("Caught throwable", re);
+ throw re;
+ }
+ finally
+ {
+ ctx.setOriginLocal(true);
+ }
+ }
+
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
+ {
+ return handler.handleGravitateDataCommand(ctx, this);
+ }
+
+ public int getCommandId()
+ {
+ return METHOD_ID;
+ }
+
+ public Fqn getFqn()
+ {
+ return fqn;
+ }
+
+ public boolean isSearchSubtrees()
+ {
+ return searchSubtrees;
+ }
+
+ public Object[] getParameters()
+ {
+ return new Object[]{fqn, searchSubtrees};
+ }
+
+ public void setState(int commandId, Object[] args)
+ {
+ fqn = (Fqn) args[0];
+ searchSubtrees = (Boolean) args[1];
+ }
+}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/RemoveFromBuddyGroupCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -4,16 +4,16 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.factories.annotations.Inject;
/**
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RemoveFromBuddyGroupCommand extends BaseCacheCommand implements
CacheCommand
+public class RemoveFromBuddyGroupCommand extends BaseCommand implements CacheCommand
{
public static final int METHOD_ID = 30;
private static final Log log = LogFactory.getLog(RemoveFromBuddyGroupCommand.class);
@@ -46,7 +46,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleRemoveFromBuddyGroupCommand(ctx, this);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/remote/ReplicateCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,11 +1,9 @@
package org.jboss.cache.commands.remote;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.GravitateDataCommand;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.*;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.invocation.InterceptorChain;
@@ -20,7 +18,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class ReplicateCommand extends BaseCacheCommand implements CacheCommand
+public class ReplicateCommand extends BaseCommand implements CacheCommand
{
public static final int SINGLE_METHOD_ID = 13;
public static final int MULTIPLE_METHOD_ID = 14;
@@ -109,7 +107,7 @@
return cacheCommand instanceof GravitateDataCommand || cacheCommand instanceof
ClusteredGetCommand;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleReplicateCommand(ctx, this);
}
Copied: core/trunk/src/main/java/org/jboss/cache/commands/state/DataVersionCommand.java
(from rev 5546,
core/trunk/src/main/java/org/jboss/cache/commands/DataVersionCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/state/DataVersionCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/state/DataVersionCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,23 @@
+package org.jboss.cache.commands.state;
+
+import org.jboss.cache.optimistic.DataVersion;
+import org.jboss.cache.commands.CacheCommand;
+
+/**
+ * Commands that know how to deal with versioned data.
+ *
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public interface DataVersionCommand extends CacheCommand
+{
+ public DataVersion getDataVersion();
+
+ public void setDataVersion(DataVersion dataVersion);
+
+ /**
+ * Has data version set? (i.e. not null)
+ * // todo: should this be an abstract class rather than an interface? isVersioned()
is implemented exactly the same way in all subclasses.
+ */
+ public boolean isVersioned();
+}
Copied:
core/trunk/src/main/java/org/jboss/cache/commands/state/GlobalTransactionCommand.java
(from rev 5546,
core/trunk/src/main/java/org/jboss/cache/commands/GlobalTransactionCommand.java)
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/state/GlobalTransactionCommand.java
(rev 0)
+++
core/trunk/src/main/java/org/jboss/cache/commands/state/GlobalTransactionCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -0,0 +1,15 @@
+package org.jboss.cache.commands.state;
+
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jboss.cache.commands.CacheCommand;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public interface GlobalTransactionCommand extends CacheCommand
+{
+ public GlobalTransaction getGlobalTransaction();
+
+ void setGlobalTransaction(GlobalTransaction gtx);
+}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/CommitCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,16 +1,16 @@
package org.jboss.cache.commands.tx;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.BaseCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.transaction.GlobalTransaction;
/**
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class CommitCommand extends BaseCacheCommand implements GlobalTransactionCommand
+public class CommitCommand extends BaseCommand implements GlobalTransactionCommand
{
public static final int METHOD_ID = 11;
@@ -31,7 +31,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleCommitCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/tx/OptimisticPrepareCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,7 +2,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
+import org.jboss.cache.commands.CommandsVisitor;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jgroups.Address;
@@ -33,7 +33,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleOptimisticPrepareCommand(ctx, this);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/PrepareCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,10 +1,10 @@
package org.jboss.cache.commands.tx;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jgroups.Address;
@@ -16,7 +16,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class PrepareCommand extends BaseCacheCommand implements CacheCommand,
GlobalTransactionCommand
+public class PrepareCommand extends BaseCommand implements CacheCommand,
GlobalTransactionCommand
{
public static final int METHOD_ID = 10;
@@ -37,7 +37,7 @@
this.onePhaseCommit = onePhaseCommit;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handlePrepareCommand(ctx, this);
}
Modified: core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/commands/tx/RollbackCommand.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,17 +1,17 @@
package org.jboss.cache.commands.tx;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.BaseCacheCommand;
+import org.jboss.cache.commands.BaseCommand;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.CacheCommandsVisitor;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.CommandsVisitor;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.transaction.GlobalTransaction;
/**
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class RollbackCommand extends BaseCacheCommand implements CacheCommand,
GlobalTransactionCommand
+public class RollbackCommand extends BaseCommand implements CacheCommand,
GlobalTransactionCommand
{
public static final int METHOD_ID = 12;
@@ -31,7 +31,7 @@
return null;
}
- public Object accept(InvocationContext ctx, CacheCommandsVisitor handler) throws
Throwable
+ public Object accept(InvocationContext ctx, CommandsVisitor handler) throws Throwable
{
return handler.handleRollbackCommand(ctx, this);
}
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/visitors/AbstractCommandsVisitor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/visitors/AbstractCommandsVisitor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/visitors/AbstractCommandsVisitor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -17,7 +17,7 @@
* @author Mircea.Markus(a)jboss.com
* @since 2.2
*/
-public class AbstractCommandsVisitor implements CacheCommandsVisitor
+public class AbstractCommandsVisitor implements CommandsVisitor
{
public Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand
command) throws Throwable
{
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/visitors/DataVersionCommandsVisitor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/visitors/DataVersionCommandsVisitor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/visitors/DataVersionCommandsVisitor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,11 +2,11 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.cachedata.*;
-import org.jboss.cache.commands.DataVersionCommand;
+import org.jboss.cache.commands.state.DataVersionCommand;
/**
- * Similar to {@link AbstractCommandsVisitor} but delegates the handlers of {@link
org.jboss.cache.commands.DataVersionCommand}
- * to {@link
#handleDataVersionCommand(org.jboss.cache.InvocationContext,org.jboss.cache.commands.DataVersionCommand)}.
+ * Similar to {@link AbstractCommandsVisitor} but delegates the handlers of {@link
org.jboss.cache.commands.state.DataVersionCommand}
+ * to {@link #handleDataVersionCommand(org.jboss.cache.InvocationContext,
org.jboss.cache.commands.state.DataVersionCommand)}.
* All other handlers are delegated by default to
* {@link #handleDefault(org.jboss.cache.InvocationContext,
org.jboss.cache.commands.CacheCommand)}
*
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/visitors/GlobalTransactionCommandsVisitor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/commands/visitors/GlobalTransactionCommandsVisitor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/commands/visitors/GlobalTransactionCommandsVisitor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,7 +2,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.cachedata.*;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -45,6 +45,7 @@
* </ul>
* <p/>
* Cache configuration can only be changed and will only be reinjected if the cache is
not in the {@link org.jboss.cache.CacheStatus#STARTED} state.
+ * todo [mmarkus] remove dependecies on components from this class and move it elsewhere
(e.g. dependecy on CacgeSPI, Configuration etc)
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 2.1.0
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -9,7 +9,7 @@
import org.jboss.cache.cluster.ReplicationQueue;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.config.Option;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheMgmtInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -24,12 +24,11 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.base.ChainedInterceptor;
-import org.jboss.cache.commands.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
import org.jboss.cache.commands.cachedata.GetKeyValueCommand;
import org.jboss.cache.commands.cachedata.PutDataMapCommand;
import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
import org.jboss.cache.invocation.CacheData;
-import org.apache.commons.logging.LogFactory;
import java.util.HashMap;
import java.util.Map;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -5,7 +5,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.Modification;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.MoveCommand;
import org.jboss.cache.commands.cachedata.PutDataMapCommand;
import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CallInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,7 +2,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.PutDataMapCommand;
import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
import org.jboss.cache.commands.cachedata.RemoveDataCommand;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -15,7 +15,7 @@
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.GravitateDataCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/EvictionInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -8,14 +8,13 @@
package org.jboss.cache.interceptors;
import org.jboss.cache.*;
-import org.jboss.cache.commands.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.interceptors.base.ChainedInterceptor;
import org.jboss.cache.invocation.CacheData;
-import org.apache.commons.logging.LogFactory;
/**
* Eviction Interceptor.
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/Interceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -27,8 +27,8 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.EvictFqnCommand;
-import org.jboss.cache.commands.InvalidateCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.InvalidateCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.channel.BlockChannelCommand;
import org.jboss.cache.commands.channel.UnblockChannelCommand;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -13,8 +13,8 @@
import org.jboss.cache.cluster.ReplicationQueue;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.InvalidateCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.cachedata.InvalidateCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -13,7 +13,7 @@
import org.jboss.cache.NodeFactory;
import org.jboss.cache.NodeNotExistsException;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.config.Configuration;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -11,14 +11,10 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.EvictFqnCommand;
-import org.jboss.cache.commands.GravitateDataCommand;
-import org.jboss.cache.commands.cachedata.PutDataMapCommand;
-import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
-import org.jboss.cache.commands.cachedata.RemoveDataCommand;
-import org.jboss.cache.commands.cachedata.RemoveKeyCommand;
-import org.jboss.cache.commands.cachedata.RemoveNodeCommand;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
+import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PassivationInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -8,7 +8,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.notifications.Notifier;
import org.jboss.cache.interceptors.base.ChainedInterceptor;
-import org.jboss.cache.commands.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
import org.jboss.cache.loader.CacheLoader;
import java.util.Collections;
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -9,7 +9,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.NodeSPI;
-import org.jboss.cache.commands.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -13,8 +13,8 @@
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.DataVersionCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.state.DataVersionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.PrepareCommand;
@@ -31,7 +31,6 @@
import org.jboss.cache.transaction.OptimisticTransactionEntry;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TxUtil;
-import org.apache.commons.logging.LogFactory;
import javax.transaction.*;
import java.util.HashMap;
@@ -76,7 +75,7 @@
@Inject
- public void intialize(Configuration configuration, CommandsFactory commandsFactory,
RPCManager rpcManager,
+ public void intialize(Configuration configuration, RPCManager rpcManager,
CacheTransactionHelper transactionHelper, Notifier notifier,
InvocationContextContainer icc,
CacheLifecycleManager lifecycleManager)
{
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/base/SkipCheckChainedInterceptor.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -2,9 +2,9 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.cachedata.*;
-import org.jboss.cache.commands.EvictFqnCommand;
-import org.jboss.cache.commands.InvalidateCommand;
-import org.jboss.cache.commands.GravitateDataCommand;
+import org.jboss.cache.commands.cachedata.EvictFqnCommand;
+import org.jboss.cache.commands.cachedata.InvalidateCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.channel.BlockChannelCommand;
import org.jboss.cache.commands.channel.UnblockChannelCommand;
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -4,7 +4,7 @@
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.GravitateDataCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
import org.jboss.cache.commands.cachedata.*;
import org.jboss.cache.commands.channel.BlockChannelCommand;
import org.jboss.cache.commands.channel.UnblockChannelCommand;
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CacheMarshaller200.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -12,7 +12,7 @@
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.CacheCommand;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.optimistic.DefaultDataVersion;
import org.jboss.cache.transaction.GlobalTransaction;
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/MethodCallWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/MethodCallWrapper.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/MethodCallWrapper.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -1,6 +1,6 @@
package org.jboss.cache.marshall;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
/**
* This wrapper class is used when passing in {@link
org.jboss.cache.commands.CacheCommand}s into JGroups RPC APIs.
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -12,7 +12,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.cachedata.RemoveNodeCommand;
import org.jboss.cache.config.Option;
import org.jboss.cache.interceptors.OrderedSynchronizationHandler;
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionTable.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -10,7 +10,7 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.CacheException;
import org.jboss.cache.Fqn;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.lock.NodeLock;
import javax.transaction.Transaction;
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyManagerTest.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -8,7 +8,7 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.MarshallableCommand;
+import org.jboss.cache.commands.functional.MarshallableCommand;
import org.jboss.cache.commands.cachedata.PutKeyValueCommand;
import org.jboss.cache.commands.remote.ReplicateCommand;
import org.jboss.cache.config.BuddyReplicationConfig;
Modified:
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/test/java/org/jboss/cache/marshall/ReturnValueMarshallingTest.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -6,7 +6,7 @@
import org.jboss.cache.Region;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.GravitateDataCommand;
+import org.jboss.cache.commands.remote.GravitateDataCommand;
import org.jboss.cache.commands.cachedata.CacheDataCommand;
import org.jboss.cache.commands.remote.ClusteredGetCommand;
import org.jboss.cache.config.Configuration;
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/AbstractOptimisticTestCase.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -7,9 +7,8 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
-import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.TxCacheCommand;
-import org.jboss.cache.commands.DataVersionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
+import org.jboss.cache.commands.state.DataVersionCommand;
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
@@ -20,8 +19,6 @@
import org.jboss.cache.loader.DummySharedInMemoryCacheLoader;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.marshall.MethodCall;
-import org.jboss.cache.marshall.MethodCallFactory;
-import org.jboss.cache.marshall.MethodDeclarations;
import org.jboss.cache.misc.TestingUtil;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.jboss.cache.transaction.TransactionSetup;
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-04-14 12:26:47
UTC (rev 5547)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/CacheTest.java 2008-04-14 13:22:50
UTC (rev 5548)
@@ -11,8 +11,8 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.VersionedNode;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.GlobalTransactionCommand;
-import org.jboss.cache.commands.TxCacheCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
+import org.jboss.cache.commands.functional.TxCacheCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.invocation.NodeInvocationDelegate;
Modified:
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java 2008-04-14
12:26:47 UTC (rev 5547)
+++
core/trunk/src/test/java/org/jboss/cache/optimistic/OptimisticReplicationInterceptorTest.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -8,7 +8,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.commands.CacheCommand;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.commands.CommandsFactory;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.loader.SamplePojo;
Modified: core/trunk/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java 2008-04-14
12:26:47 UTC (rev 5547)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/TxInterceptorTest.java 2008-04-14
13:22:50 UTC (rev 5548)
@@ -8,7 +8,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.GlobalTransactionCommand;
+import org.jboss.cache.commands.state.GlobalTransactionCommand;
import org.jboss.cache.commands.tx.CommitCommand;
import org.jboss.cache.commands.tx.OptimisticPrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;