private static synchronized Map<String, StopWatchFactory> getFactories() { if( c_factories == null ) configure(); return c_factories; }
private static synchronized Map<String, StopWatchFactory> getFactories() { if( c_factories == null ) configure(); return c_factories; }
/** * Does the default configuration by trying to locate the default * config file as defined in the System properties. */ private static void configure() { String propertyFile = System.getProperty( SYSTEM_PROPERTY, PROPERTYFILENAME ); InputStream in = findConfigFile( propertyFile, "/com/ecyrd/speed4j/default_speed4j.properties"); configure(in); }
/** * Does the default configuration by trying to locate the default * config file as defined in the System properties. */ private static void configure() { String propertyFile = System.getProperty( SYSTEM_PROPERTY, PROPERTYFILENAME ); InputStream in = findConfigFile( propertyFile, "/com/ecyrd/speed4j/default_speed4j.properties"); configure(in); }
public static StopWatchFactory getInstance(String configFileName, String loggerName) throws ConfigurationException { StopWatchFactory swf = getFactories().get(loggerName); if( swf == null ) { configure( findConfigFile( configFileName ) ); swf = getFactories().get(loggerName); if( swf == null ) { throw new ConfigurationException("No logger by the name "+loggerName+" found."); } } return swf; }
public static StopWatchFactory getInstance(String configFileName, String loggerName) throws ConfigurationException { StopWatchFactory swf = getFactories().get(loggerName); if( swf == null ) { configure( findConfigFile( configFileName ) ); swf = getFactories().get(loggerName); if( swf == null ) { throw new ConfigurationException("No logger by the name "+loggerName+" found."); } } return swf; }