請教:com.jdon.propsutil的getProperty()函式是做什麼用的?

oldbird發表於2004-07-09
private static String className = "com.jdon.controller.WebServiceFactory";
protected static ServiceFactory factory = null;

public static ServiceFactory getInstance() {
if (factory == null) {
synchronized (initLock) {
if (factory == null) {
try {
//Load the class and create an instance.
String confClassName = propsUtil.getProperty("serviceFactory.class");
if ((confClassName != null) && !confClassName.equals("")){
Debug.logVerbose( "confClassName is loaded:" + confClassName, module);
className = confClassName;
}

Class c = Class.forName(className);
factory = (ServiceFactory) c.newInstance();

} catch (Exception e) {
Debug.logError(" get factory instance error:" + e, module);
return null;
}
}
}
}
return factory;
}

這段程式碼呼叫了propsUtil的getproperty()方法,請問這個方法是什麼意思,應該怎麼實現呢?謝謝

相關文章