Author: manik.surtani(a)jboss.com
Date: 2008-08-05 08:43:23 -0400 (Tue, 05 Aug 2008)
New Revision: 6512
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainer.java
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
Log:
Added proper exception propagation during buddy remote comms
use Cache.getRoot() instead of DataContainer.getRoot()
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-08-05 11:20:47 UTC
(rev 6511)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainer.java 2008-08-05 12:43:23 UTC
(rev 6512)
@@ -18,7 +18,9 @@
* Retrieves the root node.
*
* @return the root node
+ * @deprecated use Cache.getRoot();
*/
+ @Deprecated
NodeSPI getRoot();
/**
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08-05 11:20:47
UTC (rev 6511)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08-05 12:43:23
UTC (rev 6512)
@@ -109,6 +109,7 @@
}
}
+ @Deprecated
public NodeSPI getRoot()
{
return root;
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-08-05
11:20:47 UTC (rev 6511)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2008-08-05
12:43:23 UTC (rev 6512)
@@ -601,7 +601,7 @@
o = cache.getInvocationContext().getOptionOverrides();
o.setCacheModeLocal(true);
o.setSkipCacheStatusCheck(true);
- dataContainer.getRoot().addChild(Fqn.fromElements(BUDDY_BACKUP_SUBTREE,
newGroup.getGroupName()));
+ cache.put(Fqn.fromElements(BUDDY_BACKUP_SUBTREE, newGroup.getGroupName()), (Map)
Collections.emptyMap());
}
else
{
@@ -879,7 +879,14 @@
}
else
{
- log.error("Unable to communicate with Buddy for some reason",
e);
+ if (attemptsLeft > 0)
+ {
+ log.error("Unable to communicate with Buddy for some reason",
e);
+ }
+ else
+ {
+ throw new BuddyNotInitException("Unable to contact buddy after
" + UNINIT_BUDDIES_RETRIES + " retries");
+ }
}
}
}
Show replies by date