KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cluster > partition > AbstractHAPartitionStateTransfer


1 package org.jboss.test.cluster.partition;
2
3 import java.io.Serializable JavaDoc;
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 JavaDoc transferredState;
14
15    public void setCurrentState(Serializable JavaDoc newState)
16    {
17       this.transferredState = newState;
18    }
19
20    public Object JavaDoc getTransferredState()
21    {
22       return this.transferredState;
23    }
24
25    protected void setupPartition() throws Exception JavaDoc
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 JavaDoc
36    {
37       super.createService();
38       setupPartition();
39    }
40    
41 }
42
Popular Tags