1 package org.jboss.test.cluster.partition; 2 3 import java.io.Serializable ; 4 5 import org.jboss.ha.framework.interfaces.HAPartition; 6 import org.jboss.ha.jmx.HAServiceMBeanSupport; 7 8 public abstract class AbstractHAPartitionStateTransfer 9 extends HAServiceMBeanSupport 10 implements HAPartitionStateTransferMBean 11 { 12 private HAPartition haPartition; 13 private Object transferredState; 14 15 public void setCurrentState(Serializable newState) 16 { 17 this.transferredState = newState; 18 } 19 20 public Object getTransferredState() 21 { 22 return this.transferredState; 23 } 24 25 protected void setupPartition() throws Exception 26 { 27 if (haPartition == null) 28 { 29 super.setupPartition(); 30 haPartition = getPartition(); 31 haPartition.subscribeToStateTransferEvents(getServiceHAName(), this); 32 } 33 } 34 35 protected void createService() throws Exception 36 { 37 super.createService(); 38 setupPartition(); 39 } 40 41 } 42 | Popular Tags |