1 10 11 package org.mule.impl.internal.notifications; 12 13 import org.mule.umo.manager.UMOManager; 14 import org.mule.umo.manager.UMOServerNotification; 15 16 26 public class ManagerNotification extends UMOServerNotification implements BlockingServerEvent 27 { 28 31 private static final long serialVersionUID = -3246036188011581121L; 32 public static final int MANAGER_INITIALISNG = MANAGER_EVENT_ACTION_START_RANGE + 1; 33 public static final int MANAGER_INITIALISED = MANAGER_EVENT_ACTION_START_RANGE + 2; 34 public static final int MANAGER_STARTING = MANAGER_EVENT_ACTION_START_RANGE + 3; 35 public static final int MANAGER_STARTED = MANAGER_EVENT_ACTION_START_RANGE + 4; 36 public static final int MANAGER_STOPPING = MANAGER_EVENT_ACTION_START_RANGE + 5; 37 public static final int MANAGER_STOPPED = MANAGER_EVENT_ACTION_START_RANGE + 6; 38 public static final int MANAGER_DISPOSING = MANAGER_EVENT_ACTION_START_RANGE + 7; 39 public static final int MANAGER_DISPOSED = MANAGER_EVENT_ACTION_START_RANGE + 8; 40 public static final int MANAGER_DISPOSING_CONNECTORS = MANAGER_EVENT_ACTION_START_RANGE + 9; 41 public static final int MANAGER_DISPOSED_CONNECTORS = MANAGER_EVENT_ACTION_START_RANGE + 10; 42 43 private static final transient String [] ACTIONS = new String []{"initialising", "initialised", "starting", 44 "started", "stopping", "stopped", "disposing", "disposed", "disposing connectors", 45 "disposed connectors"}; 46 47 public ManagerNotification(UMOManager message, int action) 48 { 49 super(message, action); 50 resourceIdentifier = message.getId(); 51 } 52 53 protected String getPayloadToString() 54 { 55 return ((UMOManager)source).getId(); 56 } 57 58 protected String getActionName(int action) 59 { 60 int i = action - MANAGER_EVENT_ACTION_START_RANGE; 61 if (i - 1 > ACTIONS.length) 62 { 63 return String.valueOf(action); 64 } 65 return ACTIONS[i - 1]; 66 } 67 68 public String toString() 69 { 70 return EVENT_NAME + "{" + "action=" + getActionName(action) + ", resourceId=" + resourceIdentifier 71 + ", timestamp=" + timestamp + "}"; 72 } 73 } 74 | Popular Tags |