[jboss-cvs] JBossCache/src/org/jboss/cache ...
Vladmir Blagojevic
vladimir.blagojevic at jboss.com
Tue Dec 19 23:02:09 EST 2006
User: vblagojevic
Date: 06/12/19 23:02:09
Modified: src/org/jboss/cache TreeCache.java
Log:
[JBCACHE-315] added channel unblock callback
Revision Changes Path
1.295 +38 -6 JBossCache/src/org/jboss/cache/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/TreeCache.java,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -b -r1.294 -r1.295
--- TreeCache.java 18 Dec 2006 12:51:36 -0000 1.294
+++ TreeCache.java 20 Dec 2006 04:02:09 -0000 1.295
@@ -46,9 +46,9 @@
import org.jgroups.Channel;
import org.jgroups.ChannelClosedException;
import org.jgroups.ChannelNotConnectedException;
+import org.jgroups.ExtendedMembershipListener;
import org.jgroups.ExtendedMessageListener;
import org.jgroups.JChannel;
-import org.jgroups.MembershipListener;
import org.jgroups.Message;
import org.jgroups.MessageListener;
import org.jgroups.View;
@@ -95,11 +95,11 @@
* @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.294 2006/12/18 12:51:36 msurtani Exp $
+ * @version $Id: TreeCache.java,v 1.295 2006/12/20 04:02:09 vblagojevic Exp $
* <p/>
* @see <a href="http://labs.jboss.com/portal/jbosscache/docs">JBossCache doc</a>
*/
-public class TreeCache implements Cloneable, MembershipListener
+public class TreeCache implements Cloneable, ExtendedMembershipListener
{
private static final String CREATE_MUX_CHANNEL = "createMultiplexerChannel";
private static final String[] MUX_TYPES = {"java.lang.String", "java.lang.String"};
@@ -535,7 +535,7 @@
public void fetchPartialState(Object sources[], Fqn subtree) throws Exception
{
- if (subtree == null || subtree.isRoot())
+ if (subtree == null)
{
throw new IllegalArgumentException("Cannot fetch partial state. Invalid subtree " + subtree);
}
@@ -3182,9 +3182,14 @@
}
}
- public void _block()
+ private void _block()
{
- log.info("Invoking block on " + getLocalAddress());
+ //intentionally empty, used only for reflection in MethodDeclarations.blockChannelLocal
+ }
+
+ private void _unblock()
+ {
+ //intentionally empty, used only for reflection in MethodDeclarations.unblockChannelLocal
}
private void moveFqns(Node node, Fqn newBase)
@@ -3575,8 +3580,35 @@
*/
public void block()
{
+ if(log.isDebugEnabled())
+ {
+ log.debug("Block received at " + getLocalAddress());
+ }
MethodCall m = MethodCallFactory.create(MethodDeclarations.blockChannelLocal);
invokeMethod(m);
+ if(log.isDebugEnabled())
+ {
+ log.debug("Block processed at " + getLocalAddress());
+ }
+ }
+
+ /**
+ * Indicates that a channel has received a UNBLOCK event from FLUSH protocol.
+ *
+ *
+ */
+ public void unblock()
+ {
+ if(log.isDebugEnabled())
+ {
+ log.debug("UnBlock received at " + getLocalAddress());
+ }
+ MethodCall m = MethodCallFactory.create(MethodDeclarations.unblockChannelLocal);
+ invokeMethod(m);
+ if(log.isDebugEnabled())
+ {
+ log.debug("UnBlock processed at " + getLocalAddress());
+ }
}
/*------------------- End of MembershipListener ----------------------*/
More information about the jboss-cvs-commits
mailing list