This content has been marked as final.
Show 2 replies
-
1. Re: MBean not running setCurrentState on restart
dave_dave Nov 1, 2004 4:27 PM (in response to dave_dave)Sorry, the above should be:
Class code is: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:<mbean code="com.mm.mbean.HANotificationBroadcasterExample" name="mm.mbean:service=HANotificationBroadcasterExample"> <depends>jboss:service=DefaultPartition</depends> </mbean>
I am using jboss 4.0.0 and java 1.5 -
2. Re: MBean not running setCurrentState on restart
dave_dave Nov 2, 2004 7:36 AM (in response to dave_dave)Does no reply mean that I am doing something that is obviously stupid?