1 10 11 package org.mule.impl.internal.notifications; 12 13 import org.mule.impl.MuleDescriptor; 14 import org.mule.umo.UMODescriptor; 15 import org.mule.umo.manager.UMOServerNotification; 16 17 27 public class ComponentNotification extends UMOServerNotification 28 { 29 32 private static final long serialVersionUID = -8575741816897936674L; 33 public static final int COMPONENT_INITIALISED = COMPONENT_EVENT_ACTION_START_RANGE + 1; 34 public static final int COMPONENT_STARTED = COMPONENT_EVENT_ACTION_START_RANGE + 2; 35 public static final int COMPONENT_STOPPED = COMPONENT_EVENT_ACTION_START_RANGE + 3; 36 public static final int COMPONENT_PAUSED = COMPONENT_EVENT_ACTION_START_RANGE + 4; 37 public static final int COMPONENT_RESUMED = COMPONENT_EVENT_ACTION_START_RANGE + 5; 38 public static final int COMPONENT_DISPOSED = COMPONENT_EVENT_ACTION_START_RANGE + 6; 39 public static final int COMPONENT_STOPPING = COMPONENT_EVENT_ACTION_START_RANGE + 7; 40 41 private static final transient String [] ACTIONS = new String []{"initialised", "started", "stopped", 42 "paused", "resumed", "disposed", "stopping"}; 43 44 public ComponentNotification(UMODescriptor message, int action) 45 { 46 super(message, action); 47 resourceIdentifier = message.getName(); 48 } 49 50 protected String getPayloadToString() 51 { 52 return ((MuleDescriptor)source).getName(); 53 } 54 55 protected String getActionName(int action) 56 { 57 int i = action - COMPONENT_EVENT_ACTION_START_RANGE; 58 if (i - 1 > ACTIONS.length) 59 { 60 return String.valueOf(action); 61 } 62 return ACTIONS[i - 1]; 63 } 64 } 65 | Popular Tags |