public class PropertyConfigurator extends Object implements Configurator
Allows the configuration of log4j from an external file. See doConfigure(String, LoggerRepository) for the expected format.
public static void configure(String configFilename)
public static void configure(URL configURL)
Read configuration options from url configURL.
public static void configure(Properties properties)
Read configuration options from properties. See doConfigure(String, LoggerRepository) for the expected format.
public void doConfigure(String configFileName,
LoggerRepository hierarchy)
Read configuration from a file. The existing configuration is not cleared nor reset. If you require a different behavior, then call resetConfiguration method before calling doConfigure.
注意上面的这句话:The existing configuration is not cleared nor reset
/*
* Returns the singleton instance of the EJBHomeFactory
**/
public static EJBHomeFactory getFactory() throws NamingException {
if (EJBHomeFactory.aFactorySingleton == null) {
EJBHomeFactory.aFactorySingleton = new EJBHomeFactory();
}
return EJBHomeFactory.aFactorySingleton;
}