Author: manik.surtani(a)jboss.com
Date: 2008-01-02 11:01:52 -0500 (Wed, 02 Jan 2008)
New Revision: 4941
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java
core/trunk/src/test/java/org/jboss/cache/jmx/InterceptorRegistrationTest.java
Log:
moved remote-only calls to the RemoteCacheInvocationDelegate rather than the CacheImpl
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-02 11:56:56 UTC (rev
4940)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2008-01-02 16:01:52 UTC (rev
4941)
@@ -8,9 +8,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.buddyreplication.BuddyGroup;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.buddyreplication.BuddyNotInitException;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Option;
@@ -1946,13 +1944,14 @@
}
else
{
- if (rsp.getValue() instanceof Exception)
+ Object value = rsp.getValue();
+ if (value instanceof Exception && !(value instanceof
ReplicationException))
{
- if (log.isTraceEnabled())
- log.trace("Recieved exception'" + rsp.getValue() +
"' from " + rsp.getSender());
- throw (Exception) rsp.getValue();
+ // if we have any application-level exceptions make sure we throw them!!
+ if (log.isTraceEnabled()) log.trace("Recieved exception'" +
value + "' from " + rsp.getSender());
+ throw (Exception) value;
}
- retval.add(rsp.getValue());
+ retval.add(value);
}
}
return retval;
@@ -2873,62 +2872,6 @@
return list;
}
- // ------------- start: buddy replication specific 'lifecycle' method calls
-
- public void _remoteAssignToBuddyGroup(BuddyGroup group, Map<Fqn, byte[]> state)
throws Exception
- {
- if (buddyManager != null)
- buddyManager.handleAssignToBuddyGroup(group, state);
- else if (log.isWarnEnabled())
- log.warn("Received assignToBuddyGroup call from group owner [" +
group.getDataOwner() + "] but buddy replication is not enabled on this node!");
- }
-
- public void _remoteRemoveFromBuddyGroup(String groupName) throws
BuddyNotInitException
- {
- if (buddyManager != null)
- buddyManager.handleRemoveFromBuddyGroup(groupName);
- else if (log.isWarnEnabled())
- log.warn("Received removeFromBuddyGroup call for group name [" +
groupName + "] but buddy replication is not enabled on this node!");
-
- }
-
- public void _remoteAnnounceBuddyPoolName(Address address, String buddyPoolName)
- {
- if (buddyManager != null)
- buddyManager.handlePoolNameBroadcast(address, buddyPoolName);
- else if (log.isWarnEnabled())
- log.warn("Received annouceBuddyPoolName call from [" + address +
"] but buddy replication is not enabled on this node!");
- }
-
- public void _dataGravitationCleanup(GlobalTransaction gtx, Fqn primary, Fqn backup)
throws Exception
- {
-// MethodCall primaryDataCleanup, backupDataCleanup;
- if (buddyManager.isDataGravitationRemoveOnFind())
- {
- if (log.isTraceEnabled())
- log.trace("DataGravitationCleanup: Removing primary (" + primary +
") and backup (" + backup + ")");
- //primaryDataCleanup =
MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, primary, false);
- spi.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
- spi.removeNode(primary);
- //backupDataCleanup =
MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, backup, false);
- spi.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
- spi.removeNode(backup);
- }
- else
- {
- if (log.isTraceEnabled())
- log.trace("DataGravitationCleanup: Evicting primary (" + primary +
") and backup (" + backup + ")");
- //primaryDataCleanup =
MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, primary);
- spi.evict(primary, true);
- //backupDataCleanup =
MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, backup);
- spi.evict(backup, true);
- }
-
-// invokeMethod(primaryDataCleanup, true);
-// invokeMethod(backupDataCleanup, true);
- }
-
- // ------------- end: buddy replication specific 'lifecycle' method calls
/**
* Releases all locks for a FQN.
*/
@@ -3140,7 +3083,7 @@
*/
private void configureLogCategory()
{
- StringBuilder category = new StringBuilder(getClass().getSimpleName());
+ StringBuilder category = new StringBuilder(getClass().getName());
if (configuration != null)
{
String clusterName = configuration.getClusterName();
@@ -3151,12 +3094,12 @@
if (channel != null && channel.getLocalAddress() != null)
{
category.append('.');
- category.append(channel.getLocalAddress());
+ category.append(channel.getLocalAddress().toString().replace('.',
'_'));
}
}
}
// replace .s with _s otherwise Log4J will strip them out
- log = LogFactory.getLog(category.toString().replace('.', '_'));
+ log = LogFactory.getLog(category.toString());
}
/**
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-01-02
11:56:56 UTC (rev 4940)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -685,7 +685,6 @@
buddyGroup.removeBuddies(buddies);
// now broadcast a message to the removed buddies.
MethodCall membershipCall =
MethodCallFactory.create(MethodDeclarations.remoteRemoveFromBuddyGroupMethod,
buddyGroup.getGroupName());
- MethodCall replicateCall =
MethodCallFactory.create(MethodDeclarations.replicateMethod, membershipCall);
int attemptsLeft = UNINIT_BUDDIES_RETRIES;
int currentAttempt = 0;
@@ -694,7 +693,7 @@
{
try
{
- makeRemoteCall(buddies, replicateCall, true);
+ makeRemoteCall(buddies, membershipCall, true);
break;
}
catch (Exception e)
@@ -784,7 +783,6 @@
// now broadcast a message to the newly assigned buddies.
MethodCall membershipCall =
MethodCallFactory.create(MethodDeclarations.remoteAssignToBuddyGroupMethod, buddyGroup,
stateMap);
- MethodCall replicateCall =
MethodCallFactory.create(MethodDeclarations.replicateMethod, membershipCall);
int attemptsLeft = UNINIT_BUDDIES_RETRIES;
int currentAttempt = 0;
@@ -793,7 +791,7 @@
{
try
{
- makeRemoteCall(buddies, replicateCall, true);
+ makeRemoteCall(buddies, membershipCall, true);
break;
}
catch (Exception e)
@@ -943,11 +941,10 @@
}
MethodCall membershipCall =
MethodCallFactory.create(MethodDeclarations.remoteAnnounceBuddyPoolNameMethod,
buddyGroup.getDataOwner(), config.getBuddyPoolName());
- MethodCall replicateCall =
MethodCallFactory.create(MethodDeclarations.replicateMethod, membershipCall);
try
{
- makeRemoteCall(recipients, replicateCall, true);
+ makeRemoteCall(recipients, membershipCall, true);
}
catch (Exception e)
{
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -76,7 +76,12 @@
protected void replicateCall(List<Address> recipients, MethodCall call, boolean
sync, Option o) throws Throwable
{
+ replicateCall(recipients, call, sync, o, true);
+ }
+ protected void replicateCall(List<Address> recipients, MethodCall call, boolean
sync, Option o, boolean wrapMethodCallInReplicateMethod) throws Throwable
+ {
+
if (log.isTraceEnabled()) log.trace("Broadcasting call " + call + "
to recipient list " + recipients);
Transaction tx = null;
if (cache.getTransactionManager() != null && (tx =
cache.getTransactionManager().getTransaction()) != null)
@@ -108,12 +113,13 @@
long syncReplTimeout = o.getSyncReplTimeout();
if (syncReplTimeout < 0) syncReplTimeout =
configuration.getSyncReplTimeout();
+ MethodCall toCall = wrapMethodCallInReplicateMethod ? toCall =
MethodCallFactory.create(MethodDeclarations.replicateMethod, call) : call;
+
List rsps = rpcManager.callRemoteMethods(callRecipients,
- MethodDeclarations.replicateMethod,
- new Object[]{call},
+ toCall,
sync, // is synchronised?
true, // ignore self?
- syncReplTimeout);
+ (int) syncReplTimeout);
if (log.isTraceEnabled())
{
log.trace("responses=" + rsps);
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInterceptor.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -8,7 +8,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.*;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.buddyreplication.GravitateResult;
import org.jboss.cache.config.Configuration;
@@ -64,7 +68,7 @@
protected boolean skipMethodCall(InvocationContext ctx)
{
return MethodDeclarations.isBlockUnblockMethod(ctx.getMethodCall().getMethodId())
||
- ctx.getOptionOverrides().isSkipDataGravitation();
+ ctx.getOptionOverrides().isSkipDataGravitation();
}
protected Object handleGetChildrenNamesMethod(InvocationContext ctx, Fqn fqn) throws
Throwable
@@ -104,7 +108,8 @@
Object returnValue = nextInterceptor(ctx);
doPrepare(ctx.getGlobalTransaction(), ctx);
return returnValue;
- } catch (Throwable throwable)
+ }
+ catch (Throwable throwable)
{
transactionMods.remove(ctx.getGlobalTransaction());
throw throwable;
@@ -123,7 +128,8 @@
{
transactionMods.remove(ctx.getGlobalTransaction());
return nextInterceptor(ctx);
- } catch (Throwable throwable)
+ }
+ catch (Throwable throwable)
{
transactionMods.remove(ctx.getGlobalTransaction());
throw throwable;
@@ -137,7 +143,8 @@
doCommit(ctx.getGlobalTransaction(), ctx);
transactionMods.remove(ctx.getGlobalTransaction());
return nextInterceptor(ctx);
- } catch (Throwable throwable)
+ }
+ catch (Throwable throwable)
{
transactionMods.remove(ctx.getGlobalTransaction());
throw throwable;
@@ -153,7 +160,8 @@
if (BuddyManager.isBackupFqn(fqn))
{
log.info("Is call for a backup Fqn, not performing any gravitation.
Direct calls on internal backup nodes are *not* supported.");
- } else
+ }
+ else
{
if (cache.peek(fqn, false) == null)
{
@@ -183,12 +191,14 @@
// Clean up the other nodes
cleanBackupData(data, ctx.getGlobalTransaction(), ctx);
}
- } else
+ }
+ else
{
log.trace("No need to gravitate; have this already.");
}
}
- } else
+ }
+ else
{
if (log.isTraceEnabled())
{
@@ -314,7 +324,7 @@
// backupDataCleanup =
MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, new
Object[]{backup.backupFqn});
// }
- MethodCall cleanup =
MethodCallFactory.create(MethodDeclarations.dataGravitationCleanupMethod, gtx,
backup.primaryFqn, backup.backupFqn);
+ MethodCall cleanup =
MethodCallFactory.create(MethodDeclarations.dataGravitationCleanupMethod,
backup.primaryFqn, backup.backupFqn);
if (log.isTraceEnabled()) log.trace("Performing cleanup on [" +
backup.primaryFqn + "]");
@@ -327,7 +337,7 @@
if (log.isTraceEnabled()) log.trace("Performing cleanup on [" +
backup.backupFqn + "]");
// remove backup Fqn
//replicateCall(cache.getMembers(), backupDataCleanup, syncCommunications);
- replicateCall(cache.getMembers(), cleanup, syncCommunications,
ctx.getOptionOverrides());
+ replicateCall(cache.getMembers(), cleanup, syncCommunications,
ctx.getOptionOverrides(), false);
}
else
{
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/AbstractInvocationDelegate.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -59,7 +59,9 @@
*/
protected Object invoke(MethodCall call) throws CacheException
{
- return invoke(call, false);
+ assertIsConstructed();
+ InvocationContext ctx = invocationContextContainer.get();
+ return invoke(call, ctx.getOptionOverrides().isSkipCacheStatusCheck(), ctx);
}
/**
@@ -71,12 +73,18 @@
*/
protected Object invoke(MethodCall call, boolean skipCacheStatusCheck) throws
CacheException
{
- // never create a new one directly; always let the container do this if needed.
- InvocationContext ctx = invocationContextContainer.get();
+ assertIsConstructed();
+ return invoke(call, skipCacheStatusCheck, invocationContextContainer.get());
+ }
- // BR methods should NOT block on the cache being started, since the cache depends
on these completing to start.
- if (//!MethodDeclarations.isBuddyGroupOrganisationMethod(call.getMethodId())
&&
- !cache.getCacheStatus().allowInvocations() && !skipCacheStatusCheck)
+ private void assertIsConstructed()
+ {
+ if (invocationContextContainer == null) throw new IllegalStateException("The
cache has been destroyed!");
+ }
+
+ private Object invoke(MethodCall call, boolean skipCacheStatusCheck, InvocationContext
ctx) throws CacheException
+ {
+ if (!cache.getCacheStatus().allowInvocations() && !skipCacheStatusCheck)
{
// only throw an exception if this is a locally originating call - JBCACHE-1179
if (originLocal)
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/CacheInvocationDelegate.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -113,7 +113,8 @@
public List<Interceptor> getInterceptorChain()
{
- return
Collections.unmodifiableList(InterceptorChainFactory.asList(interceptorChain));
+ List interceptors = InterceptorChainFactory.asList(interceptorChain);
+ return interceptors == null ? Collections.emptyList() :
Collections.unmodifiableList(interceptors);
}
public void addInterceptor(Interceptor i, int position)
Modified:
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/main/java/org/jboss/cache/invocation/RemoteCacheInvocationDelegate.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -2,15 +2,20 @@
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
+import org.jboss.cache.buddyreplication.BuddyGroup;
+import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.buddyreplication.BuddyNotInitException;
+import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.marshall.MethodCall;
import org.jboss.cache.marshall.MethodCallFactory;
import org.jboss.cache.marshall.MethodDeclarations;
-import org.jboss.cache.transaction.GlobalTransaction;
+import org.jgroups.Address;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
/**
* A sublcass of CacheInvocationDelegate, used by remote instances to invoke methods on
current cache.
@@ -20,50 +25,101 @@
*/
public class RemoteCacheInvocationDelegate extends CacheInvocationDelegate
{
+ private BuddyManager buddyManager;
+
public RemoteCacheInvocationDelegate()
{
originLocal = false;
log = LogFactory.getLog(RemoteCacheInvocationDelegate.class);
}
- public Object _replicate(MethodCall methodCall) throws Throwable
+ @Inject
+ private void injectBuddyManager(BuddyManager buddyManager)
{
- if (methodCall.getMethodId() == MethodDeclarations.clusteredGetMethod_id)
- return invokeClusteredGet(methodCall);
- else if (methodCall.getMethodId() ==
MethodDeclarations.dataGravitationCleanupMethod_id)
+ this.buddyManager = buddyManager;
+ }
+
+ // ------------- start: buddy replication specific 'lifecycle' method calls
+
+ public void assignToBuddyGroup(BuddyGroup group, Map<Fqn, byte[]> state) throws
Exception
+ {
+ if (buddyManager != null)
+ buddyManager.handleAssignToBuddyGroup(group, state);
+ else if (log.isWarnEnabled())
+ log.warn("Received assignToBuddyGroup call from group owner [" +
group.getDataOwner() + "] but buddy replication is not enabled on this node!");
+ }
+
+ public void removeFromBuddyGroup(String groupName) throws BuddyNotInitException
+ {
+ if (buddyManager != null)
+ buddyManager.handleRemoveFromBuddyGroup(groupName);
+ else if (log.isWarnEnabled())
+ log.warn("Received removeFromBuddyGroup call for group name [" +
groupName + "] but buddy replication is not enabled on this node!");
+
+ }
+
+ public void announceBuddyPoolName(Address address, String buddyPoolName)
+ {
+ if (buddyManager != null)
+ buddyManager.handlePoolNameBroadcast(address, buddyPoolName);
+ else if (log.isWarnEnabled())
+ log.warn("Received annouceBuddyPoolName call from [" + address +
"] but buddy replication is not enabled on this node!");
+ }
+
+ public void dataGravitationCleanup(Fqn primary, Fqn backup) throws Exception
+ {
+// MethodCall primaryDataCleanup, backupDataCleanup;
+ if (buddyManager.isDataGravitationRemoveOnFind())
{
- Object[] args = methodCall.getArgs();
- cache._dataGravitationCleanup((GlobalTransaction) args[0], (Fqn) args[1], (Fqn)
args[2]);
- return null;
+ if (log.isTraceEnabled())
+ log.trace("DataGravitationCleanup: Removing primary (" + primary +
") and backup (" + backup + ")");
+ //primaryDataCleanup =
MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, primary, false);
+ getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ removeNode(primary);
+ //backupDataCleanup =
MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, backup, false);
+ getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ removeNode(backup);
}
-
else
{
- try
+ if (log.isTraceEnabled())
+ log.trace("DataGravitationCleanup: Evicting primary (" + primary +
") and backup (" + backup + ")");
+ //primaryDataCleanup =
MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, primary);
+ evict(primary, true);
+ //backupDataCleanup =
MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, backup);
+ evict(backup, true);
+ }
+ }
+
+ // ------------- end: buddy replication specific 'lifecycle' method calls
+
+
+ public Object _replicate(MethodCall methodCall) throws Throwable
+ {
+ try
+ {
+ Object retVal = invoke(methodCall);
+ // we only need to return values for a set of remote calls; not every call.
+ if (MethodDeclarations.returnValueForRemoteCall(methodCall.getMethodId()))
{
- Object retVal = invoke(methodCall);
- // we only need to return values for a set of remote calls; not every call.
- if (MethodDeclarations.returnValueForRemoteCall(methodCall.getMethodId()))
- {
- return retVal;
- }
- else
- {
- return null;
- }
+ return retVal;
}
- catch (Throwable ex)
+ else
{
- if (methodCall.getMethodId() !=
MethodDeclarations.putForExternalReadMethodLocal_id
- || methodCall.getMethodId() !=
MethodDeclarations.putForExternalReadVersionedMethodLocal_id)
- {
- if
(!MethodDeclarations.isBuddyGroupOrganisationMethod(methodCall.getMethodId()) &&
log.isWarnEnabled())
- log.warn("replication failure with methodCall " + methodCall
+ " exception", ex);
- throw ex;
- }
- else return null;
+ return null;
}
}
+ catch (Throwable ex)
+ {
+ if (methodCall.getMethodId() !=
MethodDeclarations.putForExternalReadMethodLocal_id
+ || methodCall.getMethodId() !=
MethodDeclarations.putForExternalReadVersionedMethodLocal_id)
+ {
+ if
(!MethodDeclarations.isBuddyGroupOrganisationMethod(methodCall.getMethodId()) &&
log.isWarnEnabled())
+ log.warn("replication failure with methodCall " + methodCall +
" exception", ex);
+ throw ex;
+ }
+ else return null;
+ }
}
/**
@@ -74,12 +130,6 @@
for (MethodCall methodCall : methodCalls) _replicate(methodCall);
}
- public Object invokeClusteredGet(MethodCall call)
- {
- Object[] args = call.getArgs();
- return clusteredGet((MethodCall) args[0], (Boolean) args[1]);
- }
-
public void block()
{
MethodCall m = MethodCallFactory.create(MethodDeclarations.blockChannelLocal);
Modified: core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-01-02 11:56:56
UTC (rev 4940)
+++ core/trunk/src/main/java/org/jboss/cache/jmx/CacheJmxWrapper.java 2008-01-02 16:01:52
UTC (rev 4941)
@@ -676,11 +676,11 @@
{
cacheStatus = CacheStatus.DESTROYING;
- cache.destroy();
-
// The cache is destroyed, so we shouldn't leave the interceptors
// in JMX, even if we didn't register them in create
unregisterInterceptors();
+
+ cache.destroy();
}
finally
{
@@ -955,7 +955,7 @@
{
try
{
- log.debug("Unreqistering interceptors");
+ log.debug("Unregistering interceptors");
JmxUtil.unregisterInterceptors(server, cache.getInterceptorChain(),
getCacheObjectName());
interceptorsRegistered = false;
}
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java 2008-01-02
11:56:56 UTC (rev 4940)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/MethodDeclarations.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -272,11 +272,11 @@
// ------------ buddy replication
- remoteAnnounceBuddyPoolNameMethod =
CacheImpl.class.getDeclaredMethod("_remoteAnnounceBuddyPoolName", Address.class,
String.class);
- remoteRemoveFromBuddyGroupMethod =
CacheImpl.class.getDeclaredMethod("_remoteRemoveFromBuddyGroup", String.class);
- remoteAssignToBuddyGroupMethod =
CacheImpl.class.getDeclaredMethod("_remoteAssignToBuddyGroup", BuddyGroup.class,
Map.class);
+ remoteAnnounceBuddyPoolNameMethod =
RemoteCacheInvocationDelegate.class.getDeclaredMethod("announceBuddyPoolName",
Address.class, String.class);
+ remoteRemoveFromBuddyGroupMethod =
RemoteCacheInvocationDelegate.class.getDeclaredMethod("removeFromBuddyGroup",
String.class);
+ remoteAssignToBuddyGroupMethod =
RemoteCacheInvocationDelegate.class.getDeclaredMethod("assignToBuddyGroup",
BuddyGroup.class, Map.class);
- dataGravitationCleanupMethod =
CacheImpl.class.getDeclaredMethod("_dataGravitationCleanup",
GlobalTransaction.class, Fqn.class, Fqn.class);
+ dataGravitationCleanupMethod =
RemoteCacheInvocationDelegate.class.getDeclaredMethod("dataGravitationCleanup",
Fqn.class, Fqn.class);
dataGravitationMethod =
CacheSPI.class.getDeclaredMethod("gravitateData", Fqn.class, boolean.class);
// ------------ move() api
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/InterceptorRegistrationTest.java
===================================================================
---
core/trunk/src/test/java/org/jboss/cache/jmx/InterceptorRegistrationTest.java 2008-01-02
11:56:56 UTC (rev 4940)
+++
core/trunk/src/test/java/org/jboss/cache/jmx/InterceptorRegistrationTest.java 2008-01-02
16:01:52 UTC (rev 4941)
@@ -22,23 +22,24 @@
package org.jboss.cache.jmx;
+import org.jboss.cache.config.Configuration;
import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
-import org.jboss.cache.config.Configuration;
-
/**
* Tests the interceptor registration function of CacheJmxWrapper.
*
* @author <a href="brian.stansberry(a)jboss.com">Brian
Stansberry</a>
* @version $Revision$
*/
+@Test(groups = "functional")
public class InterceptorRegistrationTest extends CacheJmxWrapperTestBase
{
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* cache.start();
* wrapper creation and registration.
*
@@ -71,7 +72,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* cache.start();
* wrapper creation and and start
* wrapper registration.
@@ -105,7 +106,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* Cache not injected
* wrapper registered;
* wrapper created and started.
@@ -137,7 +138,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* Cache not injected
* wrapper created and started.
* wrapper registered
@@ -172,7 +173,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* cache constructed;
* wrapper constructed and registered with manageCacheLifecycle=true
* wrapper created and started
@@ -205,7 +206,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* cache constructed;
* wrapper constructed and registered
* wrapper created and started
@@ -236,7 +237,7 @@
/**
* Confirms interceptor mbeans are registered if the following events
* occur:
- *
+ * <p/>
* cache constructed;
* wrapper created and started
* wrapper registered