1 23 24 package com.sun.enterprise.admin.server.core; 25 26 import java.util.logging.Level ; 27 import java.util.logging.Logger ; 28 29 import com.sun.enterprise.admin.common.constant.AdminConstants; 30 31 import java.util.Hashtable ; 32 33 41 42 public final class ManualChangeManager { 43 46 static Logger logger = Logger.getLogger(AdminConstants.kLoggerName); 47 48 private static Hashtable result = new Hashtable (); 49 50 public static boolean hasHotChanged(String instance) { 51 ManualChangeStatus mcs = (ManualChangeStatus)result.get(instance); 52 if(mcs == null) return false; 54 return mcs.isChanged(); 55 } 56 57 private static boolean hasHotInitChanged(String instanceName) { 58 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 59 if(mcs == null) return false; 60 return mcs.isInitFileChanged(); 61 } 62 63 private static boolean hasHotRealmsKeyChanged(String instanceName) { 64 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 65 if(mcs == null) return false; 66 return mcs.isRealmsKeyFileChanged(); 67 } 68 69 private static boolean hasHotObjectChanged(String instanceName) { 70 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 71 if(mcs == null) return false; 72 return mcs.isObjectFileChanged(); 73 } 74 75 public static boolean hasHotXmlChanged(String instanceName) { 76 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 77 if(mcs == null) return false; 78 return mcs.isServerXmlFileChanged(); 79 } 80 81 private static boolean hasHotMimeChanged(String instanceName) { 82 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 83 if(mcs == null) return false; 84 return mcs.isMimeFileChanged(); 85 } 86 87 private static boolean hasHotVirtualServerConfFilesChanged(String instanceName) { 88 ManualChangeStatus mcs = getManualChangeStatus(instanceName); 89 if(mcs == null) return false; 90 return mcs.isVirtualServerConfFilesChanged(); 91 } 92 93 public static ManualChangeStatus getManualChangeStatus(String instance) { 94 return (ManualChangeStatus) result.get(instance); 95 } 96 97 public static void removeManualChangeStatus(String instance) { 98 result.remove(instance); 99 } 100 101 public static void removeServerXmlManualChangeStatus(String instance) { 102 ManualChangeStatus m = getManualChangeStatus(instance); 103 if(m != null) { 104 m.setServerXmlFileChanged(false); 105 } 106 } 107 108 public static void addManualChangeStatus(String instance, ManualChangeStatus mcs) { 109 result.put(instance, mcs); 110 } 111 } 112 | Popular Tags |