/** * Constructs an instance of the specified class with the passed * in config. This bypasses the cache and the configuration object. * * * @param klass The class being created. * @param name An arbitrary name for the object. Can be null. * @param conf The configuration for the object. * @param runtimeParams * @return The object */ public <T> T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams) throws ConfigurationException { return constructInternal(klass, name, conf, runtimeParams).getRight(); }
/** * Constructs an instance of the specified class with the passed * in config. This bypasses the cache and the configuration object. * * * @param klass The class being created. * @param name An arbitrary name for the object. Can be null. * @param conf The configuration for the object. * @param runtimeParams * @return The object */ public <T> T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams) throws ConfigurationException { return constructInternal(klass, name, conf, runtimeParams).getRight(); }
return (T) cache.get(key); } else { Pair<Provider, T> pair = constructInternal(klass, name, config, runtimeParams); if (pair.getLeft().getScope() == Provider.Scope.SINGLETON) { cache.put(key, pair.getRight());
return (T) cache.get(key); } else { Pair<Provider, T> pair = constructInternal(klass, name, config, runtimeParams); if (pair.getLeft().getScope() == Provider.Scope.SINGLETON) { cache.put(key, pair.getRight());