1 10 11 package org.mule.impl.internal.notifications; 12 13 import org.mule.umo.UMOMessage; 14 import org.mule.umo.manager.UMOServerNotification; 15 16 import java.util.HashMap ; 17 import java.util.Map ; 18 19 25 26 public class AdminNotification extends UMOServerNotification 27 { 28 31 private static final long serialVersionUID = -53091546441476249L; 32 public static final int ACTION_RECEIVE = ADMIN_EVENT_ACTION_START_RANGE + 1; 33 public static final int ACTION_DISPATCH = ADMIN_EVENT_ACTION_START_RANGE + 2; 34 public static final int ACTION_SEND = ADMIN_EVENT_ACTION_START_RANGE + 3; 35 public static final int ACTION_INVOKE = ADMIN_EVENT_ACTION_START_RANGE + 4; 36 37 private static final transient String [] ACTIONS = new String []{"receive event", "dispatch event", 38 "send event", "invoke component"}; 39 40 private Map properties = new HashMap (); 41 private UMOMessage message; 42 43 public AdminNotification(UMOMessage message, int action, String resourceIdentifier) 44 { 45 super(message, action, resourceIdentifier); 46 this.message = message; 47 } 48 49 public UMOMessage getMessage() 50 { 51 return message; 52 } 53 54 public void setProperty(Object key, Object value) 55 { 56 properties.put(key, value); 57 } 58 59 public Object getProperty(Object key) 60 { 61 return properties.get(key); 62 } 63 64 public Map getProperties() 65 { 66 return properties; 67 } 68 69 protected String getActionName(int action) 70 { 71 int i = action - ADMIN_EVENT_ACTION_START_RANGE; 72 if (i - 1 > ACTIONS.length) 73 { 74 return String.valueOf(action); 75 } 76 return ACTIONS[i - 1]; 77 } 78 } 79 | Popular Tags |