[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/framework/server ClusterPartitionMBean.java ClusterPartition.java
User: patriot1burke Date: 01/12/31 12:41:17 Modified:src/main/org/jboss/ha/framework/server ClusterPartitionMBean.java ClusterPartition.java Log: switch back to create/start instead of crazy mbean refs Revision ChangesPath 1.5 +2 -5 jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java Index: ClusterPartitionMBean.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ClusterPartitionMBean.java2001/11/26 15:52:55 1.4 +++ ClusterPartitionMBean.java2001/12/31 20:41:17 1.5 @@ -18,7 +18,7 @@ * * @author mailto:[EMAIL PROTECTED]";>Bill Burke. * @author mailto:[EMAIL PROTECTED]";>Sacha Labourey. - * @version $Revision: 1.4 $ + * @version $Revision: 1.5 $ * * Revisions: */ @@ -51,11 +51,8 @@ boolean getDeadlockDetection(); void setDeadlockDetection(boolean doit); - Collection getSynchronizedMBeans(); - void setSynchronizedMBeans(Collection syncMBeans); - // Access to the underlying HAPartition without going through JNDI // HAPartition getHAPartition (); -} \ No newline at end of file +} 1.10 +9 -61 jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartition.java Index: ClusterPartition.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartition.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ClusterPartition.java 2001/12/29 16:20:12 1.9 +++ ClusterPartition.java 2001/12/31 20:41:17 1.10 @@ -23,7 +23,7 @@ * * @author mailto:[EMAIL PROTECTED]";>Bill Burke. * @author mailto:[EMAIL PROTECTED]";>Sacha Labourey. - * @version $Revision: 1.9 $ + * @version $Revision: 1.10 $ * * Revisions: */ @@ -36,7 +36,6 @@ // Attributes - protected final Collection syncMBeans = new java.util.ArrayList(); protected String partitionName = org.jboss.metadata.ClusterConfigMetaData.DEFAULT_PARTITION; protected String jgProps = "UDP:" + @@ -103,32 +102,16 @@ return this.partition; } - public synchronized void setSynchronizedMBeans(Collection syncMBeans) - { - log.info("SynchronizedMBeans set to " + syncMBeans); - synchronized (this.syncMBeans) - { - this.syncMBeans.clear(); - this.syncMBeans.addAll(syncMBeans); - } - } - - public Collection getSynchronizedMBeans() - { - synchronized (syncMBeans) - { - return new java.util.ArrayList(syncMBeans); - } - } - // ServiceMBeanSupport overrides --- public String getName() { return partitionName; } + - public void startService() throws Exception + public void createService() + throws Exception { log.info ("Creating JavaGroups JChannel"); this.channel = new JavaGroups.JChannel(jgProps); @@ -143,21 +126,11 @@ log.info("...Initing HAPartition..."); partition.init(); log.info("...HAPartition initialized."); - - synchronized (syncMBeans) //noone should be modifying this ever after it is set originally - { - for (Iterator i = syncMBeans.iterator(); i.hasNext(); ) - { -ObjectName mbean = (ObjectName)i.next(); -log.info("registering " + mbean); -getServer().invoke(mbean, - "partitionInitializationPhase", - new Object[] {partition}, - new String[] {"org.jboss.ha.framework.interfaces.HAPartition"}); -log.info("registered " + mbean); - } // end of for () - } + } + public void startService() + throws Exception + { log.info("Starting ClusterPartition: " + partitionName); log.info(" Connecting to channel"); @@ -166,39 +139,14 @@ log.info(" Starting channel"); partition.start(); - synchronized (syncMBeans) //noone should be modifying this ever after it is set originally - { - for (Iterator i = syncMBeans.iterator(); i.hasNext(); ) - { -ObjectName mbean = (ObjectName)i.next(); -log.info("registering " + mbean); -getServer().invoke(mbean, - "startPartitionService", -
[JBoss-dev] CVS update: jbossmx/src/main/org/jboss/ha/framework/server ClusterPartitionMBean.java ClusterPartition.java
User: patriot1burke Date: 01/11/19 15:13:49 Modified:src/main/org/jboss/ha/framework/server ClusterPartitionMBean.java ClusterPartition.java Log: implemented 2-phase initialization under new mbean code (removal of init()) Revision ChangesPath 1.3 +34 -30 jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java Index: ClusterPartitionMBean.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ClusterPartitionMBean.java2001/11/11 19:04:25 1.2 +++ ClusterPartitionMBean.java2001/11/19 23:13:49 1.3 @@ -1,30 +1,34 @@ -package org.jboss.ha.framework.server; - -import org.jboss.ha.framework.interfaces.HAPartition; - -public interface ClusterPartitionMBean - extends org.jboss.system.ServiceMBean -{ - // Constants - - public static final String OBJECT_NAME = ":service=HANaming"; - - public String getPartitionName(); - public void setPartitionName(String newName); - - public String getPartitionProperties(); // i.e. JavaGroups properties - public void setPartitionProperties(String newProps); - - public boolean getDeadlockDetection(); - public void setDeadlockDetection(boolean doit); - - // Access to the underlying HAPartition without going through JNDI - // - public HAPartition getHAPartition (); -} - - - - - - - +package org.jboss.ha.framework.server; + +import java.util.Collection; +import org.jboss.ha.framework.interfaces.HAPartition; + +public interface ClusterPartitionMBean + extends org.jboss.system.ServiceMBean +{ + // Constants - + static final String OBJECT_NAME = ":service=ClusterPartition"; + + String getPartitionName(); + void setPartitionName(String newName); + + String getPartitionProperties(); // i.e. JavaGroups properties + void setPartitionProperties(String newProps); + + boolean getDeadlockDetection(); + void setDeadlockDetection(boolean doit); + + Collection getSynchronizedMBeans(); + void setSynchronizedMBeans(Collection syncMBeans); + + // Access to the underlying HAPartition without going through JNDI + // + HAPartition getHAPartition (); +} + + + + + + + 1.7 +63 -3 jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartition.java Index: ClusterPartition.java === RCS file: /cvsroot/jboss/jbossmx/src/main/org/jboss/ha/framework/server/ClusterPartition.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- ClusterPartition.java 2001/11/12 19:59:17 1.6 +++ ClusterPartition.java 2001/11/19 23:13:49 1.7 @@ -10,6 +10,9 @@ import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.MalformedObjectNameException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; import org.jboss.metadata.ClusterConfigMetaData; @@ -24,12 +27,13 @@ * * @author [EMAIL PROTECTED] * @author [EMAIL PROTECTED] - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * * Revisions: */ public class ClusterPartition extends ServiceMBeanSupport implements ClusterPartitionMBean { + protected final Collection syncMBeans = new ArrayList(); protected String partitionName = ClusterConfigMetaData.DEFAULT_PARTITION; protected String jgProps = /* @@ -58,7 +62,7 @@ "GMS:" + "STATE_TRANSFER(trace=true):" + "QUEUE"; -protected HAPartitionImpl partition; + protected HAPartitionImpl partition; protected boolean deadlock_detection = false; protected JChannel channel; @@ -103,6 +107,23 @@ return new ObjectName(OBJECT_NAME); } + public Collection getSynchronizedMBeans() + { + synchronized (syncMBeans) + { + return new ArrayList(syncMBeans); + } + } + + public synchronized void setSynchronizedMBeans(Collection syncMBeans) + { + log.info("SynchronizedMBeans set to " + syncMBeans); + synchronized (this.syncMBeans) + { + this.syncMBeans.clear(); + this.syncMBeans.addAll(syncMBeans); + } + } public HAPartition getHAPartition () { return this.partition; @@ -124,6 +145,20 @@ partition.init(); log.info("...HAPartition initialized."); + synchronized (syncMBeans) //noone should