use of org.eclipse.ecf.datashare.IChannelListener in project ecf by eclipse.
the class DatashareManagerApplication method createChannelListener.
/**
* Create a channel listener that simply prints out messages to System.out
*/
protected IChannelListener createChannelListener() {
return new IChannelListener() {
public void handleChannelEvent(IChannelEvent event) {
if (event instanceof IChannelMessageEvent) {
IChannelMessageEvent messageEvent = (IChannelMessageEvent) event;
// print to system out
System.out.println("Received message from " + messageEvent.getFromContainerID().getName() + "\n\tmessage=" + new String(messageEvent.getData()));
}
}
};
}
Aggregations