@NodeActivated
@NodePassivated
@ViewChanged
public void broadcast(Event e)
{
NodeEvent ne;
Notification n = null;
switch (e.getType())
{
case CACHE_STARTED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_CACHE_STARTED, broadcaster, seq(), MSG_CACHE_STARTED);
n.setUserData(serviceName);
break;
case CACHE_STOPPED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_CACHE_STOPPED, broadcaster, seq(), MSG_CACHE_STOPPED);
n.setUserData(serviceName);
break;
case NODE_CREATED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_CREATED, broadcaster, seq(), MSG_NODE_CREATED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre(), ne.isOriginLocal()});
break;
case NODE_EVICTED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_EVICTED, broadcaster, seq(), MSG_NODE_EVICTED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre(), ne.isOriginLocal()});
break;
case NODE_LOADED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_LOADED, broadcaster, seq(), MSG_NODE_LOADED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre()});
break;
case NODE_MODIFIED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_MODIFIED, broadcaster, seq(), MSG_NODE_MODIFIED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre(), ne.isOriginLocal()});
break;
case NODE_REMOVED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_REMOVED, broadcaster, seq(), MSG_NODE_REMOVED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre(), ne.isOriginLocal()});
break;
case NODE_MOVED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_MOVED, broadcaster, seq(), MSG_NODE_MOVED);
NodeMovedEvent nme = (NodeMovedEvent) e;
n.setUserData(new Object[]{nme.getFqn().toString(), nme.getTargetFqn().toString(), e.isPre()});
break;
case NODE_VISITED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_VISITED, broadcaster, seq(), MSG_NODE_VISITED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre()});
break;
case NODE_ACTIVATED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_ACTIVATED, broadcaster, seq(), MSG_NODE_ACTIVATED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre()});
break;
case NODE_PASSIVATED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_NODE_PASSIVATED, broadcaster, seq(), MSG_NODE_PASSIVATED);
ne = (NodeEvent) e;
n.setUserData(new Object[]{ne.getFqn().toString(), e.isPre()});
break;
case VIEW_CHANGED:
n = new Notification(CacheNotificationBroadcaster.NOTIF_VIEW_CHANGED, broadcaster, seq(), MSG_VIEW_CHANGED);
n.setUserData(((ViewChangedEvent) e).getNewView().toString());
break;