1 23 24 package com.sun.enterprise.admin.event; 25 26 import com.sun.enterprise.util.i18n.StringManager; 28 29 33 public class EjbTimerEvent extends AdminEvent implements CommandEvent { 34 35 38 public static final String EJB_TIMER_CALL_RESULT_ATTRNAME = "ejb_timer_call_result"; 39 40 43 public static final int ACTION_MIGRATETIMER = 1; 44 public static final int ACTION_LISTTIMERS = 2; 45 46 49 static final String eventType = EjbTimerEvent.class.getName(); 50 51 54 private int actionType; 55 private String from; 56 private String [] servers; 57 58 private static StringManager localStrings = StringManager.getManager( EjbTimerEvent.class ); 60 61 71 public EjbTimerEvent(String instance, int action, String serverFrom, String [] serverNames) { 72 this(eventType, instance, action, serverFrom, serverNames); 73 } 74 75 84 public EjbTimerEvent(String type, String instance, int action, String serverFrom, String [] serverNames) { 85 super(type, instance); 86 from = serverFrom; 87 servers = serverNames; 88 setAction(action); 89 } 90 91 94 public String getFromServerName() { 95 return from; 96 } 97 98 101 public String [] getServerNames() { 102 return servers; 103 } 104 105 108 public int getActionType() { 109 return actionType; 110 } 111 112 117 private void setAction(int action) { 118 boolean valid = false; 119 if (action==ACTION_MIGRATETIMER || 120 action==ACTION_LISTTIMERS ) 121 valid = true; 122 if (!valid) { 123 String msg = localStrings.getString( "admin.event.invalid_action", ""+action ); 124 throw new IllegalArgumentException ( msg ); 125 } 126 this.actionType = action; 127 } 128 129 } 130 | Popular Tags |