new eventbus

Andreas Unterkircher <[email protected]>
Newsgroups gmane.comp.java.smartfrog.devel
Message-ID <[email protected]>
Hello,

SmartFrog 3.04.022_beta now allows to send Objects instead of string 
within WorkFlow. I make a small test to see if it works:

on the sender side:

sfStart:

...
testList = new LinkedList();
testList.add("item1");
System.out.println("List contains at send "+testList.size()); 
sendEvent(testList)
...


on the receiver side:

public void handleEvent(Object event) {
LinkedList list = (LinkedList)event;
System.out.println("List contains at receive " + list.size());
}

This works, I get as output:
List contains at send 1
List contains at receive 1

Now I naively try it with my own test class:

public class PBSnodeData  {
 public String hostname;
}

On the sender side:

...
nodeData = new PBSnodeData();
nodeData.hostname = sfResolve("hostname","",true);
...
System.out.println("nodeData.hostname at send "+nodeData.hostname); 
sendEvent(nodeData);

On the receiver side:

public void handleEvent(Object event) {
PBSnodeData nodeData = (PBSnodeData)event;
System.out.println("nodeData.hostname at receive "+nodeData.hostname);
}

But all I get in the output is:

nodeData.hostname at send testHost

It seems to me that handleEvent never gets called. What's wrong here ? Do 
I have to implement some additional interface with my class ? Thank you 
very much for your help.

Best regards,
Andreas



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.