1 10 11 package org.mule.impl.internal.notifications; 12 13 import org.mule.umo.manager.UMOServerNotification; 14 import org.mule.umo.model.UMOModel; 15 16 24 public class ModelNotification extends UMOServerNotification implements BlockingServerEvent 25 { 26 29 private static final long serialVersionUID = -1954880336427554435L; 30 31 public static final int MODEL_INITIALISING = MODEL_EVENT_ACTION_START_RANGE + 1; 32 public static final int MODEL_INITIALISED = MODEL_EVENT_ACTION_START_RANGE + 2; 33 public static final int MODEL_INITIALISING_LISTENERS = MODEL_EVENT_ACTION_START_RANGE + 3; 34 public static final int MODEL_INITIALISED_LISTENERS = MODEL_EVENT_ACTION_START_RANGE + 4; 35 public static final int MODEL_STARTING = MODEL_EVENT_ACTION_START_RANGE + 5; 36 public static final int MODEL_STARTED = MODEL_EVENT_ACTION_START_RANGE + 6; 37 public static final int MODEL_STOPPING = MODEL_EVENT_ACTION_START_RANGE + 7; 38 public static final int MODEL_STOPPED = MODEL_EVENT_ACTION_START_RANGE + 8; 39 public static final int MODEL_DISPOSING = MODEL_EVENT_ACTION_START_RANGE + 9; 40 public static final int MODEL_DISPOSED = MODEL_EVENT_ACTION_START_RANGE + 10; 41 42 private static final transient String [] ACTIONS = new String []{"initialising", "initialised", 43 "initialising listeners", "initialised listeners", "starting", "started", "stopping", "stopped", 44 "disposing", "disposed"}; 45 46 public ModelNotification(UMOModel message, int action) 47 { 48 super(message, action); 49 resourceIdentifier = message.getName(); 50 } 51 52 protected String getPayloadToString() 53 { 54 return ((UMOModel)source).getName(); 55 } 56 57 protected String getActionName(int action) 58 { 59 int i = action - MODEL_EVENT_ACTION_START_RANGE; 60 if (i - 1 > ACTIONS.length) 61 { 62 return String.valueOf(action); 63 } 64 return ACTIONS[i - 1]; 65 } 66 } 67 | Popular Tags |