[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Fri Mar 16 18:07:04 EDT 2007
User: msurtani
Date: 07/03/16 18:07:04
Modified: src/org/jboss/cache Tag: Branch_JBossCache_1_4_0
TreeCache.java
Log:
Patched problems with 1.4.1.SP3
Revision Changes Path
No revision
No revision
1.195.2.56 +94 -55 JBossCache/src/org/jboss/cache/Attic/TreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Attic/TreeCache.java,v
retrieving revision 1.195.2.55
retrieving revision 1.195.2.56
diff -u -b -r1.195.2.55 -r1.195.2.56
--- TreeCache.java 7 Mar 2007 14:21:35 -0000 1.195.2.55
+++ TreeCache.java 16 Mar 2007 22:07:03 -0000 1.195.2.56
@@ -99,7 +99,7 @@
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
* @author Brian Stansberry
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Id: TreeCache.java,v 1.195.2.55 2007/03/07 14:21:35 msurtani Exp $
+ * @version $Id: TreeCache.java,v 1.195.2.56 2007/03/16 22:07:03 msurtani Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
@@ -3854,12 +3854,14 @@
if (fqn.isRoot())
{
// special treatment for removal of root node - just remove all children
- Set children = getChildrenNames(fqn);
+ Set children = _getChildrenNames(fqn);
+ // we need to preserve options
+ Option o = getInvocationContext().getOptionOverrides();
if (children != null)
{
for (Iterator i = children.iterator(); i.hasNext();)
{
- remove(new Fqn(fqn, i.next()));
+ remove(new Fqn(fqn, i.next()), o);
}
}
}
@@ -3885,7 +3887,7 @@
if (fqn.isRoot())
{
// special treatment for removal of root node - just remove all children
- Set children = getChildrenNames(fqn);
+ Set children = _getChildrenNames(fqn);
if (children != null)
{
for (Iterator i = children.iterator(); i.hasNext();)
@@ -5183,7 +5185,7 @@
return null;
}
- log.warn("replication failure with method_call " + method_call + " exception: " + ex);
+ log.warn("replication failure with method_call " + method_call + " exception", ex);
throw ex;
}
finally
@@ -5268,6 +5270,9 @@
public List _gravitateData(Fqn fqn, boolean searchSubtrees, boolean marshal)
throws CacheException
{
+ try
+ {
+ getInvocationContext().setOriginLocal(false);
// we need to get the state for this Fqn and it's sub-nodes.
// for now, perform a very simple series of getData calls.
@@ -5333,6 +5338,11 @@
}
return retval;
}
+ finally
+ {
+ getInvocationContext().setOriginLocal(true);
+ }
+ }
private List getNodeData(List list, DataNode node)
{
@@ -5355,29 +5365,58 @@
public void _remoteAssignToBuddyGroup(BuddyGroup group, Map state) throws Exception
{
+ try
+ {
+ // these are remote calls and as such, should have their origins marked as remote.
+ getInvocationContext().setOriginLocal(false);
if (buddyManager != null) buddyManager.handleAssignToBuddyGroup(group, state);
}
+ finally
+ {
+ getInvocationContext().setOriginLocal(true);
+ }
+ }
public void _remoteRemoveFromBuddyGroup(String groupName) throws BuddyNotInitException
{
+ try
+ {
+ // these are remote calls and as such, should have their origins marked as remote.
+ getInvocationContext().setOriginLocal(false);
if (buddyManager != null) buddyManager.handleRemoveFromBuddyGroup(groupName);
}
+ finally
+ {
+ getInvocationContext().setOriginLocal(true);
+ }
+ }
public void _remoteAnnounceBuddyPoolName(IpAddress address, String buddyPoolName)
{
+ try
+ {
+ // these are remote calls and as such, should have their origins marked as remote.
+ getInvocationContext().setOriginLocal(false);
if (buddyManager != null) buddyManager.handlePoolNameBroadcast(address, buddyPoolName);
}
+ finally
+ {
+ getInvocationContext().setOriginLocal(true);
+ }
+ }
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, new Object[]{null, primary, Boolean.FALSE});
backupDataCleanup = MethodCallFactory.create(MethodDeclarations.removeNodeMethodLocal, new Object[]{null, backup, Boolean.FALSE});
}
else
{
+ if (log.isTraceEnabled()) log.trace("DataGravitationCleanup: Evicting primary (" + primary + ") and backup (" + backup + ")");
primaryDataCleanup = MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, new Object[]{primary});
backupDataCleanup = MethodCallFactory.create(MethodDeclarations.evictNodeMethodLocal, new Object[]{backup});
}
More information about the jboss-cvs-commits
mailing list