1 package org.apache.turbine.modules; 2 3 18 19 import java.util.Hashtable ; 20 21 import org.apache.turbine.Turbine; 22 import org.apache.turbine.TurbineConstants; 23 import org.apache.turbine.util.RunData; 24 25 34 public abstract class GenericLoader 35 extends Hashtable 36 { 37 38 private boolean reload = false; 39 40 41 private boolean isCaching = true; 42 43 44 private static final String TURBINE_PACKAGE = "org.apache.turbine.modules"; 45 46 49 public GenericLoader() 50 { 51 super(); 52 isCaching = Turbine.getConfiguration() 53 .getBoolean(TurbineConstants.MODULE_CACHE_KEY, 54 TurbineConstants.MODULE_CACHE_DEFAULT); 55 } 56 57 60 public GenericLoader(int i) 61 { 62 super(i); 63 isCaching = Turbine.getConfiguration() 64 .getBoolean(TurbineConstants.MODULE_CACHE_KEY, 65 TurbineConstants.MODULE_CACHE_DEFAULT); 66 } 67 68 73 public boolean cache() 74 { 75 return this.isCaching; 76 } 77 78 84 public abstract void exec(RunData data, String name) 85 throws Exception ; 86 87 96 97 105 public boolean reload() 106 { 107 return this.reload; 108 } 109 110 119 public GenericLoader setReload(boolean reload) 120 { 121 this.reload = reload; 122 return this; 123 } 124 125 131 public static String getBasePackage() 132 { 133 return TURBINE_PACKAGE; 134 } 135 } 136 | Popular Tags |