[jboss-cvs] JBossAS SVN: r76669 - in projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework: server and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 5 12:13:35 EDT 2008


Author: pferraro
Date: 2008-08-05 12:13:35 -0400 (Tue, 05 Aug 2008)
New Revision: 76669

Added:
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/EventListener.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAService.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingleton.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonElectionPolicy.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonLifecycle.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonMBean.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFacility.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFactory.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEvent.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEventFactory.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceImpl.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceRpcHandler.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonImpl.java
   projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonRpcHandler.java
Log:
Pojo versions of HAServiceMBeanSupport and HASingletonSupport services.

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/EventListener.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/EventListener.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/EventListener.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+import java.util.EventObject;
+
+/**
+ * Generic event listener interface for handling an event.
+ * @param <E> the event to be handled by this listener
+ * @author Paul Ferraro
+ */
+public interface EventListener<E extends EventObject> extends java.util.EventListener
+{
+   void handleEvent(E event) throws Exception;
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAService.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAService.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HAService.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+import java.util.EventObject;
+
+
+/**
+ * Basic interface for clustered services
+ * 
+ * @author Paul Ferraro
+ *
+ * @param <E> type of event generated by this service
+ */
+public interface HAService<E extends EventObject> extends EventListener<E>
+{
+   /**
+    * Get the underlying partition used by this service.
+    * 
+    * @return the partition
+    */
+   HAPartition getHAPartition();
+
+   String getServiceHAName();
+   
+   void setHAPartition(HAPartition partition);
+
+   void setServiceHAName(String name);
+
+   /**
+    * Test whether the thread context classloader should be used in RPC calls.
+    * 
+    * @return whether the thread context classloader should be used in RPC calls.
+    */
+   boolean isRegisterThreadContextClassLoader();
+   
+   /**
+    * Sets a flag specifying whether the calling thread's context classloader
+    * should be used when making RPC calls.  This flag must be set before the
+    * RPC handler is registered in startService().  The default value is false.
+    * This would typically be used in conjunction with a scoped classloader.
+    * 
+    * @param register whether to use the thread context classloader when
+    * registering the service's RPC handler. 
+    * 
+    */
+   void setRegisterThreadContextClassLoader(boolean register);
+
+   void create() throws Exception;
+   void start() throws Exception;
+   void stop();
+   void destroy();
+}
\ No newline at end of file

Copied: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingleton.java (from rev 76614, trunk/cluster/src/main/org/jboss/ha/singleton/HASingleton.java)
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingleton.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingleton.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+import java.util.EventObject;
+
+/**
+ * Basic interface for HA-Singleton services.
+ * 
+ * @author Paul Ferraro
+ */
+public interface HASingleton<E extends EventObject> extends HAService<E>, HASingletonLifecycle, HASingletonMBean
+{
+   /** Notifications emitted locally by an HASingleton to indicate state transitions */
+   String HASINGLETON_STARTING_NOTIFICATION = "org.jboss.ha.singleton.starting";
+   String HASINGLETON_STARTED_NOTIFICATION  = "org.jboss.ha.singleton.started";   
+   String HASINGLETON_STOPPING_NOTIFICATION = "org.jboss.ha.singleton.stopping";
+   String HASINGLETON_STOPPED_NOTIFICATION  = "org.jboss.ha.singleton.stopped";
+   
+   /** 
+    * Sets the policy used to determine which cluster node will
+    * become the master when the service topology changes. Injection of common 
+    * attributes into the election policy should be done during createService() 
+    * method call.
+    * 
+    * @param policy the policy. Can be <code>null</code>. 
+    */
+   void setElectionPolicy(HASingletonElectionPolicy policy);
+   
+   /** 
+    * Gets the policy used to determine which cluster node will
+    * become the master when the service topology changes.
+    * 
+    * @return the policy. Can be <code>null</code>. 
+    */
+   HASingletonElectionPolicy getElectionPolicy();
+
+   /**
+    * Gets whether this singleton will stop and restart itself if it is the
+    * master and a cluster merge occurs.
+    * <p/>
+    * A restart allows the service to reset any state that may
+    * have gotten out-of-sync with the rest of the cluster while
+    * the just-merged split was in effect.
+    * 
+    * @return <code>true</code> if a restart will occur, <code>false</code>
+    *         otherwise
+    */
+   boolean getRestartOnMerge();
+
+   /**
+    * Sets whether this singleton will stop and restart itself if it is the
+    * master and a cluster merge occurs.
+    * <p/>
+    * A restart allows the service to reset any state that may
+    * have gotten out-of-sync with the rest of the cluster while
+    * the just-merged split was in effect.
+    * 
+    * @param restartOnMerge <code>true</code> if a restart should occur, 
+    *                       <code>false</code> otherwise. Default is
+    *                       <code>true</code>.
+    */
+   void setRestartOnMerge(boolean restartOnMerge);
+}


Property changes on: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingleton.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Copied: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonElectionPolicy.java (from rev 76534, trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java)
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonElectionPolicy.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonElectionPolicy.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,20 @@
+package org.jboss.ha.framework.interfaces;
+
+import java.util.List;
+
+/**
+ * HASingletonElectionPolicy.
+ * 
+ * @author <a href="mailto:Alex.Fu at novell.com">Alex Fu</a>
+ * @author Brian Stansberry
+ * @author <a href="mailto:galder.zamarreno at jboss.com">Galder Zamarreno</a>
+ * @author Paul Ferraro
+ */
+public interface HASingletonElectionPolicy
+{
+   /**
+    * Return the elected master node.
+    * @return the master node or null if there're no possible master nodes.
+    */
+   ClusterNode elect(List<ClusterNode> nodes);
+}
\ No newline at end of file


Property changes on: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonElectionPolicy.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonLifecycle.java (from rev 76534, trunk/cluster/src/main/org/jboss/ha/singleton/HASingleton.java)
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonLifecycle.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonLifecycle.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+/**
+ * Basic interface for clustered singleton services 
+ * 
+ * @author  Ivelin Ivanov <ivelin at apache.org>
+ * @version $Revision$
+ */
+public interface HASingletonLifecycle
+{
+   /**
+    * Invoked when this mbean is elected to run the singleton service,
+    * or in other words when this node is elected for master.
+    */
+   void startSingleton();
+
+   /**
+    * Invoked when this mbean is elected to no longer run the singleton service,
+    * or in other words when this node is elected for slave.
+    */
+   void stopSingleton();
+}


Property changes on: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonLifecycle.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Copied: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonMBean.java (from rev 76534, trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonMBean.java)
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonMBean.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonMBean.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.interfaces;
+
+/**
+ * HA-Singleton interface.
+ * Only one mbean is active at any point in time, cluster-wide.
+ * <p> 
+ * The service provides a simple way for a concrete mbean to detect whether
+ * or not it is the active one in the cluster.
+ * <p>
+ * Concrete mbeans would usually do activities like regular clean up of database tables
+ * or saving statistics about cluster usage.         
+ * 
+ * @author <a href="mailto:ivelin at apache.org">Ivelin Ivanov</a>
+ * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @version $Revision$
+ */
+public interface HASingletonMBean
+{
+   /** True if this cluster node has the active mbean singleton, false otherwise */
+   boolean isMasterNode();
+}


Property changes on: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/interfaces/HASingletonMBean.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFacility.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFacility.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFacility.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+
+/**
+ * Generic facility for handling events.
+ * @param <E> the event to be handled by this facility
+ * @author Paul Ferraro
+ */
+public interface EventFacility<E extends EventObject>
+{
+   void notifyListeners(E event);
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFactory.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFactory.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/EventFactory.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+
+/**
+ * Generic factory for creating events.
+ * @param <E> the type of event created by this factory
+ * @author Paul Ferraro
+ */
+public interface EventFactory<E extends EventObject>
+{
+   E createEvent(Object source, String type);
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEvent.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEvent.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEvent.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+
+/**
+ * Basic event for use by a clustered service.
+ * @author Paul Ferraro
+ */
+public class HAServiceEvent extends EventObject
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = 402026827378491266L;
+
+   private String type;
+   
+   /**
+    * Create a new HAServiceEvent.
+    * 
+    * @param source
+    */
+   public HAServiceEvent(Object source, String type)
+   {
+      super(source);
+      
+      this.type = type;
+   }
+   
+   public String getType()
+   {
+      return this.type;
+   }
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEventFactory.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEventFactory.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceEventFactory.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+/**
+ * Event factory implementation that create {@link HAServiceEvent}s.
+ * @author Paul Ferraro
+ */
+public class HAServiceEventFactory implements EventFactory<HAServiceEvent>
+{
+   /**
+    * @see org.jboss.ha.framework.server.EventFactory#createEvent(HAService, java.lang.String)
+    */
+   public HAServiceEvent createEvent(Object source, String type)
+   {
+      return new HAServiceEvent(source, type);
+   }
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceImpl.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceImpl.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceImpl.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,300 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.io.Serializable;
+import java.util.EventObject;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
+import org.jboss.ha.framework.interfaces.EventListener;
+import org.jboss.ha.framework.interfaces.HAPartition;
+import org.jboss.ha.framework.interfaces.HAService;
+import org.jboss.logging.Logger;
+
+/**
+ * Base class for clustered services.
+ * Provides clustered event facility.
+ * 
+ * @param <E> type of event generated by this service
+ * @author Paul Ferraro
+ */
+public class HAServiceImpl<E extends EventObject> implements HAService<E>, EventFacility<E>, DistributedReplicantManager.ReplicantListener
+{
+   private static final Class<?>[] HANDLE_EVENT_TYPES = new Class[] { EventObject.class };
+   private static final String REPLICANT_TOKEN = "";
+   
+   protected final Logger log = Logger.getLogger(this.getClass());
+   
+   private final HAServiceRpcHandler<E> rpcHandler = new RpcHandler();
+   private final EventFacility<E> eventFacility;
+   private final EventFactory<E> eventFactory;
+   private final List<EventListener<E>> eventListeners = new CopyOnWriteArrayList<EventListener<E>>();
+   
+   private volatile HAPartition partition;
+   private volatile String name;
+   private volatile boolean registerClassLoader = false;
+   
+   public HAServiceImpl(EventFactory<E> eventFactory, EventFacility<E> eventFacility)
+   {
+      this.eventFactory = eventFactory;
+      this.eventFacility = eventFacility;
+   }
+   
+   public HAServiceImpl(EventFactory<E> eventFactory)
+   {
+      this.eventFactory = eventFactory;      
+      this.eventFacility = this;
+   }
+   
+   public void addEventListener(EventListener<E> listener)
+   {
+      this.eventListeners.add(listener);
+   }
+   
+   public void removeEventListener(EventListener<E> listener)
+   {
+      this.eventListeners.remove(listener);
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.server.EventFacility#notifyListeners(java.util.EventObject)
+    */
+   public void notifyListeners(E event)
+   {
+      for (EventListener<E> listener: this.eventListeners)
+      {
+         try
+         {
+            listener.handleEvent(event);
+         }
+         catch (Exception e)
+         {
+            this.log.warn(e.getMessage(), e);
+         }
+      }
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#getHAPartition()
+    */
+   public HAPartition getHAPartition()
+   {
+      return this.partition;
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#setHAPartition(org.jboss.ha.framework.interfaces.HAPartition)
+    */
+   public void setHAPartition(HAPartition partition)
+   {
+      this.partition = partition;
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#isRegisterThreadContextClassLoader()
+    */
+   public boolean isRegisterThreadContextClassLoader()
+   {
+      return this.registerClassLoader;
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#setRegisterThreadContextClassLoader(boolean)
+    */
+   public void setRegisterThreadContextClassLoader(boolean registerClassLoader)
+   {
+      this.registerClassLoader = registerClassLoader;
+   }
+   
+   public String getServiceHAName()
+   {
+      return this.name;
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#setServiceHAName(java.lang.String)
+    */
+   public void setServiceHAName(String name)
+   {
+      this.name = name;
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.EventListener#handleEvent(java.util.EventObject)
+    */
+   public void handleEvent(E event) throws Exception
+   {
+      this.callAsyncMethodOnPartition("handleEvent", new Object[] { event }, HANDLE_EVENT_TYPES);
+   }
+
+   protected HAServiceRpcHandler<E> getRpcHandler()
+   {
+      return this.rpcHandler;
+   }
+   
+   protected EventFactory<E> getEventFactory()
+   {
+      return this.eventFactory;
+   }
+   
+   protected EventFacility<E> getEventFacility()
+   {
+      return this.eventFacility;
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#create()
+    */
+   public void create() throws Exception
+   {
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#start()
+    */
+   public void start() throws Exception
+   {
+      this.registerRPCHandler();
+
+      this.registerDRMListener();
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#stop()
+    */
+   public void stop()
+   {
+      try
+      {
+         this.unregisterDRMListener();
+   
+         this.unregisterRPCHandler();
+      }
+      catch (Exception e)
+      {
+         this.log.error("Failed to stop service.", e);
+      }
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HAService#destroy()
+    */
+   public void destroy()
+   {
+   }
+
+   @SuppressWarnings("unchecked")
+   protected <T> List<T> callMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception
+   {
+       return this.partition.callMethodOnCluster(this.name, methodName, args, types, true);
+   }
+
+   protected void callAsyncMethodOnPartition(String methodName, Object[] args, Class<?>[] types) throws Exception
+   {
+      this.partition.callAsynchMethodOnCluster(this.name, methodName, args, types, true);
+   }
+   
+   protected void registerRPCHandler()
+   {
+      if (this.isRegisterThreadContextClassLoader())
+      {
+         this.partition.registerRPCHandler(this.name, this.getRpcHandler(), Thread.currentThread().getContextClassLoader());
+      }
+      else
+      {
+         this.partition.registerRPCHandler(this.name, this.getRpcHandler());
+      }
+   }
+
+   protected void unregisterRPCHandler()
+   {
+      this.partition.unregisterRPCHandler(this.name, this.getRpcHandler());
+   }
+   
+   protected void registerDRMListener() throws Exception
+   {
+      DistributedReplicantManager drm = this.partition.getDistributedReplicantManager();
+      
+      drm.registerListener(this.name, this);
+
+      // this ensures that the DRM knows that this node has the MBean deployed
+      drm.add(this.name, this.getReplicant());
+   }
+   
+   protected void unregisterDRMListener() throws Exception
+   {
+      DistributedReplicantManager drm = this.partition.getDistributedReplicantManager();
+
+      // remove replicant node
+      drm.remove(this.name);
+     
+      // unregister
+      drm.unregisterListener(this.name, this);
+   }
+
+   /**
+    * @return the object to be registered with the {@link org.jboss.ha.framework.interfaces.DistributedReplicantManager}.
+    */
+   protected Serializable getReplicant()
+   {
+      return REPLICANT_TOKEN;
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener#replicantsChanged(java.lang.String, java.util.List, int, boolean)
+    */
+   @SuppressWarnings("unchecked")
+   public void replicantsChanged(String key, List newReplicants, int newReplicantsViewId, boolean merge)
+   {
+      if (key.equals(this.name))
+      {
+         // This synchronized block was added when the internal behavior of
+         // DistributedReplicantManagerImpl was changed so that concurrent
+         // replicantsChanged notifications are possible. Synchronization
+         // ensures that this change won't break non-thread-safe
+         // subclasses of HAServiceMBeanSupport.
+         synchronized (this)
+         {
+            // change in the topology callback
+            this.partitionTopologyChanged(newReplicants, newReplicantsViewId, merge);
+         }
+      }
+   }
+   
+   protected void partitionTopologyChanged(List<?> newReplicants, int newReplicantsViewId, boolean merge)
+   {
+      this.log.debug("partitionTopologyChanged(). cluster view id: " + newReplicantsViewId);
+   }
+   
+   protected class RpcHandler implements HAServiceRpcHandler<E>
+   {
+      /**
+       * @see org.jboss.ha.framework.interfaces.HAService.RpcHandler#handleNotification(java.lang.Object)
+       */
+      public void handleEvent(E event) throws Exception
+      {
+         HAServiceImpl.this.getEventFacility().notifyListeners(event);
+      }      
+   }
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceRpcHandler.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceRpcHandler.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HAServiceRpcHandler.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+
+import org.jboss.ha.framework.interfaces.EventListener;
+
+/**
+ * Defines the RPC methods used by clustered services.
+ * This object will be passed to {@link org.jboss.ha.framework.interfaces.HAPartition#registerRPCHandler(String, Object)}.
+ * This object will also be used to implement a client-side stub.
+ * @param <E> the event generated by this service
+ * @author Paul Ferraro
+ */
+public interface HAServiceRpcHandler<E extends EventObject> extends EventListener<E>
+{
+
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonImpl.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonImpl.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonImpl.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,287 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.jboss.ha.framework.interfaces.ClusterNode;
+import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
+import org.jboss.ha.framework.interfaces.HASingleton;
+import org.jboss.ha.framework.interfaces.HASingletonElectionPolicy;
+import org.jboss.ha.framework.interfaces.HASingletonLifecycle;
+
+/**
+ * Base class for HA-singleton based services.
+ * 
+ * @author Paul Ferraro
+ */
+public class HASingletonImpl<E extends EventObject> extends HAServiceImpl<E> implements HASingleton<E>, HASingletonRpcHandler<E>
+{
+   private final AtomicBoolean master = new AtomicBoolean(false);
+   private final HASingletonRpcHandler<E> rpcHandler = new RpcHandler();
+   private final HASingletonLifecycle singletonLifecycle;
+   
+   private volatile HASingletonElectionPolicy electionPolicy;
+   private volatile boolean restartOnMerge = true;
+   
+   public HASingletonImpl(EventFactory<E> eventFactory, EventFacility<E> eventHandler, HASingletonLifecycle singletonLifecycle)
+   {
+      super(eventFactory, eventHandler);
+      
+      this.singletonLifecycle = singletonLifecycle;
+   }
+   
+   public HASingletonImpl(EventFactory<E> eventFactory)
+   {
+      super(eventFactory);
+      
+      this.singletonLifecycle = this;
+   }
+   
+   public HASingletonElectionPolicy getElectionPolicy()
+   {
+      return this.electionPolicy;
+   }
+   
+   public void setElectionPolicy(HASingletonElectionPolicy electionPolicy)
+   {
+      this.electionPolicy = electionPolicy;
+   }
+   
+   public boolean getRestartOnMerge()
+   {
+      return this.restartOnMerge;
+   }
+   
+   public void setRestartOnMerge(boolean restart)
+   {
+      this.restartOnMerge = restart;
+   }
+   
+   public boolean isMasterNode()
+   {
+      return this.master.get();
+   }
+   
+   /**
+    * @see org.jboss.ha.framework.interfaces.HASingletonLifecycle#startSingleton()
+    */
+   public void startSingleton()
+   {
+      this.log.debug("startSingleton() : elected for master singleton node");
+   }
+
+   /**
+    * @see org.jboss.ha.framework.interfaces.HASingletonLifecycle#stopSingleton()
+    */
+   public void stopSingleton()
+   {
+      this.log.debug("stopSingleton() : another node in the partition (if any) is elected for master");
+   }
+
+   /**
+    * When topology changes, a new master is elected based on the result
+    * of the isDRMMasterReplica() call.
+    * 
+    * @see org.jboss.ha.framework.server.HAServiceImpl#partitionTopologyChanged(java.util.List, int, boolean)
+    * @see org.jboss.ha.framework.interfaces.DistributedReplicantManager#isMasterReplica(String)
+    */
+   @Override
+   protected void partitionTopologyChanged(List<?> newReplicants, int newViewID, boolean merge)
+   {
+      boolean isElectedNewMaster = this.elected();
+      
+      boolean isMaster = this.master.get();
+      
+      this.log.debug("partitionTopologyChanged, isElectedNewMaster=" + isElectedNewMaster + ", isMasterNode=" + isMaster + ", viewID=" + newViewID);
+      
+      if (isElectedNewMaster)
+      {
+         // if this node is already the master, don't bother electing it again
+         if (isMaster)
+         {
+            // JBAS-4229
+            if (this.restartOnMerge && merge)
+            {
+               this.restartMaster();
+            }
+         }
+         // just becoming master
+         else
+         {
+            this.makeThisNodeMaster();
+         }
+      }
+      // transition from master to slave
+      else if (isMaster)
+      {
+         this.stopIfMaster();
+      }
+      System.out.println("partitionTopologyChanged, isElectedNewMaster=" + isElectedNewMaster
+            + ", wasMasterNode=" + isMaster + ", viewID=" + newViewID + ", isMaster = " + this.master.get());
+   }
+
+   private boolean elected()
+   {
+      if (this.electionPolicy == null)
+      {
+         return this.isDRMMasterReplica();
+      }
+      
+      ClusterNode electedNode = this.election();
+      
+      return (electedNode != null) ? electedNode.equals(this.getHAPartition().getClusterNode()) : false;
+   }
+   
+   private ClusterNode election()
+   {
+      List<ClusterNode> candidates = this.getElectionCandidates();
+      
+      if ((candidates == null) || candidates.isEmpty()) return null;
+      
+      return (candidates.size() == 1) ? candidates.get(0) : this.electionPolicy.elect(candidates);
+   }
+   
+   protected List<ClusterNode> getElectionCandidates()
+   {
+      return this.getHAPartition().getDistributedReplicantManager().lookupReplicantsNodes(this.getServiceHAName());
+   }
+   
+   /**
+    * @see org.jboss.ha.singleton.HASingleton.RpcHandler#stopOldMaster()
+    */
+   public void stopOldMaster() throws Exception
+   {
+      // ovidiu 09/02/04 - temporary solution for Case 1843, use an asynchronous
+      // distributed call.
+      //callMethodOnPartition("_stopOldMaster", new Object[0], new Class[0]);
+      this.callAsyncMethodOnPartition("stopOldMaster", new Object[0], new Class[0]);
+   }
+
+   protected boolean isDRMMasterReplica()
+   {
+      DistributedReplicantManager drm = this.getHAPartition().getDistributedReplicantManager();
+
+      return drm.isMasterReplica(this.getServiceHAName());
+   }
+   
+   protected void makeThisNodeMaster()
+   {
+      try
+      {
+         // stop the old master (if there is one) before starting the new one
+         this.stopOldMaster();
+
+         this.startNewMaster();
+      }
+      catch (Exception ex)
+      {
+         this.log.error("stopOldMaster failed. New master singleton will not start.", ex);
+
+         ex.printStackTrace(System.err);
+      }
+   }
+   
+   protected void startNewMaster()
+   {
+      this.log.debug("startNewMaster, isMasterNode=" + this.master);
+      
+      this.master.set(true);
+      
+      // notify starting
+      this.sendLocalEvent(HASINGLETON_STARTING_NOTIFICATION);
+
+      // start new master
+      this.singletonLifecycle.startSingleton();
+      
+      // notify started
+      this.sendLocalEvent(HASINGLETON_STARTED_NOTIFICATION);
+   }
+   
+   protected void restartMaster()
+   {
+      this.stopIfMaster();
+      this.startNewMaster();
+   }
+
+   protected void stopIfMaster()
+   {
+      this.log.debug("stopIfMaster, isMasterNode=" + this.master.get());
+      
+      try
+      {
+         // since this is a cluster call, all nodes will hear it
+         // so if the node is not the master, then ignore
+         if (this.master.compareAndSet(true, false))
+         {
+            // notify stopping
+            this.sendLocalEvent(HASINGLETON_STOPPING_NOTIFICATION);
+            
+            // stop the singleton
+            this.singletonLifecycle.stopSingleton();
+            
+            // notify stopped
+            this.sendLocalEvent(HASINGLETON_STOPPED_NOTIFICATION);
+         }
+      }
+      catch (Exception ex)
+      {
+         this.log.error("stopIfMaster failed. Will still try to start new master. " +
+            "You need to examine the reason why the old master wouldn't stop and resolve it. " +
+            "It is bad that the old singleton may still be running while we are starting a new one, " +
+            "so you need to resolve this ASAP.", ex);
+      }
+   }
+
+   private void sendLocalEvent(String type)
+   {
+      E event = this.getEventFactory().createEvent(this, type);
+      
+      try
+      {
+         this.getEventFacility().notifyListeners(event);
+      }
+      catch (Exception e)
+      {
+         this.log.warn("Failed to send local event: " + event, e);
+      }
+   }
+   
+   @Override
+   protected HAServiceRpcHandler<E> getRpcHandler()
+   {
+      return this.rpcHandler;
+   }
+   
+   protected class RpcHandler extends HAServiceImpl<E>.RpcHandler implements HASingletonRpcHandler<E>
+   {
+      /**
+       * @see org.jboss.ha.singleton.HASingleton.RpcHandler#stopOldMaster()
+       */
+      public void stopOldMaster()
+      {
+         HASingletonImpl.this.stopIfMaster();
+      }
+   }
+}

Added: projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonRpcHandler.java
===================================================================
--- projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonRpcHandler.java	                        (rev 0)
+++ projects/cluster/ha-server-api/trunk/src/main/java/org/jboss/ha/framework/server/HASingletonRpcHandler.java	2008-08-05 16:13:35 UTC (rev 76669)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.framework.server;
+
+import java.util.EventObject;
+
+
+/**
+ * Defines the RPC methods used by HA-singleton services.
+ * @author Paul Ferraro
+ */
+public interface HASingletonRpcHandler<E extends EventObject> extends HAServiceRpcHandler<E>
+{
+   void stopOldMaster() throws Exception;
+}




More information about the jboss-cvs-commits mailing list