Hi,
I am new to clustering and not sure if I am missing something - I have read the
clustering documents, looked at the jboss source code and trawled the forum and cannot
seem to figure this out.
I have an Mbean that setCurrentState does not get called on when the node it is
running on gets restarted. There are 2 nodes (N1 and N2) in the cluster.
When Node N1 is shut down (after running in the cluster) and then restarted, the
getCurrentState method runs on N2, but the setCurrentState method does not run on N1.
Am I supposed to call the setCurrentState method myself in the startService method, am
I missing a dependency in the xml file, or is there something wrong?
The class is as follows :
public class StateSyncTest extends HAServiceMBeanSupport implements
HANotificationBroadcasterExampleMBean, HAPartition.HAPartitionStateTransfer {
Collection receivedMessages = new LinkedList();
String currentWord;
protected void startService() throws Exception {
super.startService();
addNotificationListener(notificationListener,null, null);
getMyPartition().subscribeToStateTransferEvents("BIGBOBBY", this);
}
private HAPartition getMyPartition() {
HAPartition partition = null;
try {
InitialContext context = new InitialContext();
partition = (HAPartition) context.lookup("/HAPartition/DefaultPartition");
} catch (NamingException e) {
log.error(e.getMessage());
}
return partition;
}
public Serializable getCurrentState() {
return "initial state";
}
public void setCurrentState(Serializable newState) {
setCurrentWord((String) newState);
}
public String getCurrentWord() {
return currentWord;
}
public void setCurrentWord(String currentWord) {
this.currentWord = currentWord;
}
}
MY xml is as follows:
jboss:service=DefaultPartition
Thanks in advance,
Dave_dave
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3853541#3853541
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3853541
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user