first commit
This commit is contained in:
36
hrmsEjb/org/apache/struts/config/ModuleConfigFactory.java
Normal file
36
hrmsEjb/org/apache/struts/config/ModuleConfigFactory.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package org.apache.struts.config;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.struts.util.RequestUtils;
|
||||
|
||||
public abstract class ModuleConfigFactory {
|
||||
public abstract ModuleConfig createModuleConfig(String paramString);
|
||||
|
||||
public static String getFactoryClass() {
|
||||
return factoryClass;
|
||||
}
|
||||
|
||||
public static void setFactoryClass(String factoryClass) {
|
||||
ModuleConfigFactory.factoryClass = factoryClass;
|
||||
clazz = null;
|
||||
}
|
||||
|
||||
public static ModuleConfigFactory createFactory() {
|
||||
try {
|
||||
if (clazz == null)
|
||||
clazz = RequestUtils.applicationClass(factoryClass);
|
||||
ModuleConfigFactory factory = clazz.newInstance();
|
||||
return factory;
|
||||
} catch (Throwable t) {
|
||||
LOG.error("ModuleConfigFactory.createFactory", t);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected static Class clazz = null;
|
||||
|
||||
private static Log LOG = LogFactory.getLog(ModuleConfigFactory.class);
|
||||
|
||||
protected static String factoryClass = "org.apache.struts.config.impl.DefaultModuleConfigFactory";
|
||||
}
|
Reference in New Issue
Block a user