Package org.jboss.cache.notifications.event

Examples of org.jboss.cache.notifications.event.NodeEvent


   @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;
View Full Code Here


      break;
    case CACHE_STOPPED:
      debugCache("Cache stopped");
      break;
    case NODE_CREATED:
      NodeEvent event = (NodeEvent) e;
      debugCache("Created node " + event.getFqn());
      break;
    case NODE_MODIFIED:
      NodeEvent event1 = (NodeEvent) e;
      debugCache("Modified node " + event1.getFqn());;
      break;
    case NODE_REMOVED:
      NodeEvent event2 = (NodeEvent) e;
      debugCache("Removed node " + event2.getFqn());
      break;
    case NODE_EVICTED:
      NodeEvent event3 = (NodeEvent) e;
      debugCache("Evicted node " + event3.getFqn());
      break;
    case VIEW_CHANGED:
      ViewChangedEvent event4 = (ViewChangedEvent) e;
      debugCache("View changed " + event4.getNewView().getMembers());
      break;
View Full Code Here

   @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;
View Full Code Here

   @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;
View Full Code Here

TOP

Related Classes of org.jboss.cache.notifications.event.NodeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.