public Object run() { return DiscoverSingleton.find(org.apache.commons.logging.LogFactory.class, org.apache.commons.logging.LogFactory.FACTORY_PROPERTIES, org.apache.commons.logging.LogFactory.FACTORY_DEFAULT); } });
public Object run() { return DiscoverSingleton.find(org.apache.commons.logging.LogFactory.class, org.apache.commons.logging.LogFactory.FACTORY_PROPERTIES, org.apache.commons.logging.LogFactory.FACTORY_DEFAULT); } });
public Object run() { return DiscoverSingleton.find(org.apache.commons.logging.LogFactory.class, org.apache.commons.logging.LogFactory.FACTORY_PROPERTIES, org.apache.commons.logging.LogFactory.FACTORY_DEFAULT); } });
public static LifecycleProviderFactory getLifecycleProviderFactory() { LifecycleProviderFactory instance = INSTANCE; if (instance != null) { return instance; } return (LifecycleProviderFactory) DiscoverSingleton.find(LifecycleProviderFactory.class, FACTORY_DEFAULT); }
/** * <p>Private singleton constructor.</p> */ private VersionOneGenerator() { super(); manager = (NodeManager) DiscoverSingleton.find( NodeManager.class, DEFAULT_NODEMANAGER_IMPL); }
/** * Find implementation of SPI. * * @param <T> Service Provider Interface type. * @param spiClass Service Provider Interface Class. * * @return Instance of a class implementing the SPI. * * @exception DiscoveryException Thrown if the name of a class implementing * the SPI cannot be found, if the class cannot be loaded and * instantiated, or if the resulting class does not implement * (or extend) the SPI. */ public static <T> T find(Class<T> spiClass) throws DiscoveryException { return find(null, new SPInterface<T>(spiClass), DiscoverClass.nullProperties, (DefaultClassHolder<T>) null); }
/** * Finds a singleton implementation for a given interface. * * @param interfaceDef * the interface definition to find an implementation for * @param configFile * the configuration file that specifies the appropriate implementation * @param defaultImpl * the default implementation to use * @return The instance of the implementation class */ public static Object findSingeltonImplementation( Class<?> interfaceDef, String configFile, String defaultImpl ) { try { Properties properties = new Properties(); InputStream resource = findResource( configFile ); properties.load( resource ); return DiscoverSingleton.find( interfaceDef, properties, defaultImpl ); } catch ( IOException e ) { final String message = "Could not load resource {0}. Try default discovery."; LOG.debug( LogMessage.getMessage( message, configFile ) ); LOG.trace( e ); return DiscoverSingleton.find( interfaceDef, configFile, defaultImpl ); } }
/** * Find implementation of SPI. * * @param <T> Service Provider Interface type * * @param spiClass Service Provider Interface Class. * * @param defaultImpl Default implementation. * * @return Instance of a class implementing the SPI. * * @exception DiscoveryException Thrown if the name of a class implementing * the SPI cannot be found, if the class cannot be loaded and * instantiated, or if the resulting class does not implement * (or extend) the SPI. */ public static <T> T find(Class<T> spiClass, String defaultImpl) throws DiscoveryException { return find(null, new SPInterface<T>(spiClass), DiscoverClass.nullProperties, new DefaultClassHolder<T>(defaultImpl)); }
/** * Find implementation of SPI. * * @param <T> Service Provider Interface type * * @param spiClass Service Provider Interface Class. * * @param properties Used to determine name of SPI implementation, * and passed to implementation.init() method if * implementation implements Service interface. * * @return Instance of a class implementing the SPI. * * @exception DiscoveryException Thrown if the name of a class implementing * the SPI cannot be found, if the class cannot be loaded and * instantiated, or if the resulting class does not implement * (or extend) the SPI. */ public static <T> T find(Class<T> spiClass, Properties properties) throws DiscoveryException { return find(null, new SPInterface<T>(spiClass), new PropertiesHolder(properties), (DefaultClassHolder<T>) null); }
private static synchronized WSAG4JConfigurationEnvironment getEnvironment() { SimpleLog.setLevel( SimpleLog.LOG_LEVEL_INFO ); if ( instance == null ) { SPInterface mssConfigSP = getWSAG4JSPI(); PropertiesHolder pHolder = new PropertiesHolder( WSAG4JEnvironment.DEFAULT_CONFIGURATION_FILE ); DefaultClassHolder cHolder = new DefaultClassHolder( WSAG4JEnvironment.class.getName() ); instance = (WSAG4JConfigurationEnvironment) DiscoverSingleton.find( null, mssConfigSP, pHolder, cHolder ); } return instance; }
/** * Find implementation of SPI. * * @param <T> Service Provider Interface type * * @param spiClass Service Provider Interface Class. * * @param properties Used to determine name of SPI implementation, * and passed to implementation.init() method if * implementation implements Service interface. * * @param defaultImpl Default implementation. * * @return Instance of a class implementing the SPI. * * @exception DiscoveryException Thrown if the name of a class implementing * the SPI cannot be found, if the class cannot be loaded and * instantiated, or if the resulting class does not implement * (or extend) the SPI. */ public static <T> T find(Class<T> spiClass, Properties properties, String defaultImpl) throws DiscoveryException { return find(null, new SPInterface<T>(spiClass), new PropertiesHolder(properties), new DefaultClassHolder<T>(defaultImpl)); }
/** * Find implementation of SPI. * * @param <T> Service Provider Interface type * * @param spiClass Service Provider Interface Class. * * @param propertiesFileName Used to determine name of SPI implementation, * and passed to implementation.init() method if * implementation implements Service interface. * * @param defaultImpl Default implementation. * * @return Instance of a class implementing the SPI. * * @exception DiscoveryException Thrown if the name of a class implementing * the SPI cannot be found, if the class cannot be loaded and * instantiated, or if the resulting class does not implement * (or extend) the SPI. */ public static <T> T find(Class<T> spiClass, String propertiesFileName, String defaultImpl) throws DiscoveryException { return find(null, new SPInterface<T>(spiClass), new PropertiesHolder(propertiesFileName), new DefaultClassHolder<T>(defaultImpl)); }