[jboss-cvs] JBoss Messaging SVN: r3474 - in trunk/src/main/org/jboss/messaging/newcore/intf: cluster and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 11 08:25:44 EST 2007


Author: timfox
Date: 2007-12-11 08:25:44 -0500 (Tue, 11 Dec 2007)
New Revision: 3474

Added:
   trunk/src/main/org/jboss/messaging/newcore/intf/cluster/
   trunk/src/main/org/jboss/messaging/newcore/intf/cluster/ClusterMessage.java
   trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupCoordinator.java
   trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupHandler.java
   trunk/src/main/org/jboss/messaging/newcore/intf/cluster/StateHandler.java
Log:
Added start at clustering abstraction


Added: trunk/src/main/org/jboss/messaging/newcore/intf/cluster/ClusterMessage.java
===================================================================
--- trunk/src/main/org/jboss/messaging/newcore/intf/cluster/ClusterMessage.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/newcore/intf/cluster/ClusterMessage.java	2007-12-11 13:25:44 UTC (rev 3474)
@@ -0,0 +1,13 @@
+package org.jboss.messaging.newcore.intf.cluster;
+
+/**
+ * 
+ * A ClusterRequest
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface ClusterMessage
+{
+   void execute();
+}

Added: trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupCoordinator.java
===================================================================
--- trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupCoordinator.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupCoordinator.java	2007-12-11 13:25:44 UTC (rev 3474)
@@ -0,0 +1,33 @@
+package org.jboss.messaging.newcore.intf.cluster;
+
+import java.util.List;
+
+/**
+ * 
+ * A GroupCoordinator
+ * 
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface GroupCoordinator
+{
+   /**
+    * Join the cluster with the specified id
+    * @param id
+    * @return The state
+    * @throws Exception
+    */
+   Object join(int id, StateHandler handler) throws Exception;
+   
+   void leave(int id) throws Exception;
+   
+   void sendToAll(ClusterMessage request, boolean sychronous) throws Exception;
+   
+   List<Integer> getMembers();
+   
+   void registerHandler(GroupHandler handler);
+   
+   void unregisterHandler(GroupHandler handler);
+      
+}

Added: trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupHandler.java
===================================================================
--- trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupHandler.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/newcore/intf/cluster/GroupHandler.java	2007-12-11 13:25:44 UTC (rev 3474)
@@ -0,0 +1,17 @@
+package org.jboss.messaging.newcore.intf.cluster;
+
+import java.util.List;
+
+/**
+ * 
+ * A GroupHandler
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface GroupHandler
+{
+   void membersChanged(List<Integer> newMembers);
+   
+   void onMessage(int fromNodeId, ClusterMessage message);
+}

Added: trunk/src/main/org/jboss/messaging/newcore/intf/cluster/StateHandler.java
===================================================================
--- trunk/src/main/org/jboss/messaging/newcore/intf/cluster/StateHandler.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/newcore/intf/cluster/StateHandler.java	2007-12-11 13:25:44 UTC (rev 3474)
@@ -0,0 +1,13 @@
+package org.jboss.messaging.newcore.intf.cluster;
+
+/**
+ * 
+ * A StateHandler
+ * 
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ */
+public interface StateHandler
+{
+   Object getState();
+}




More information about the jboss-cvs-commits mailing list