1 23 24 package com.sun.enterprise.admin.event; 25 26 import com.sun.enterprise.admin.event.AdminEvent; 27 28 import com.sun.enterprise.util.i18n.StringManager; 30 31 35 public class DynamicReconfigEvent extends AdminEvent implements CommandEvent { 36 37 40 public static final int ACTION_DISABLED = 0; 41 public static final int ACTION_ENABLED = 1; 42 43 46 public static final String eventType = DynamicReconfigEvent.class.getName(); 47 48 51 private int actionType; 52 53 private static StringManager localStrings = StringManager.getManager( DynamicReconfigEvent.class ); 55 56 63 public DynamicReconfigEvent(String instance, int action) { 64 super(eventType, instance); 65 setAction(action); 66 } 67 68 69 72 public int getActionType() { 73 return actionType; 74 } 75 76 81 private void setAction(int action) { 82 boolean valid = false; 83 if (action==ACTION_ENABLED || 84 action==ACTION_DISABLED) 85 valid = true; 86 if (!valid) { 87 String msg = localStrings.getString( "admin.event.invalid_action", ""+action ); 88 throw new IllegalArgumentException ( msg ); 89 } 90 this.actionType = action; 91 } 92 93 } 94 | Popular Tags |