1 10 11 package org.mule.impl.internal.notifications; 12 13 import org.mule.umo.manager.UMOServerNotification; 14 15 27 public class CustomNotification extends UMOServerNotification 28 { 29 32 private static final long serialVersionUID = 762448139858484536L; 33 34 42 public CustomNotification(Object message, int action) 43 { 44 super(message, action); 45 if (action < CUSTOM_EVENT_ACTION_START_RANGE && action > 0) 46 { 47 throw new IllegalArgumentException ( 48 "Action range must be greater than CUSTOM_ACTION_START_RANGE (" 49 + CUSTOM_EVENT_ACTION_START_RANGE + ")"); 50 } 51 } 52 53 public CustomNotification(Object message, int action, String resourceId) 54 { 55 super(message, action, resourceId); 56 if (action < CUSTOM_EVENT_ACTION_START_RANGE && action > 0) 57 { 58 throw new IllegalArgumentException ( 59 "Action range must be greater than CUSTOM_ACTION_START_RANGE (" 60 + CUSTOM_EVENT_ACTION_START_RANGE + ")"); 61 } 62 } 63 64 protected String getActionName(int action) 65 { 66 int i = action - CUSTOM_EVENT_ACTION_START_RANGE; 67 if (i - 1 >= getActionNames().length || i < 0) 68 { 69 return String.valueOf(action); 70 } 71 return getActionNames()[i - 1]; 72 } 73 74 protected String [] getActionNames() 75 { 76 return new String []{}; 77 } 78 } 79 | Popular Tags |