public T get(Scope scope) { return super.get(this.scope); } }
@Override public <T> T getInstance(Class<T> clazz, String name) { crashIfClosed(); ConfigurationHolder.configuration.checkCyclesStart(clazz, name); T t; try { t = lookupProvider(clazz, name).get(this); } finally { ConfigurationHolder.configuration.checkCyclesEnd(clazz, name); } return t; }
public T get(Scope scope) { return super.get(this.scope); } }
public T get(Scope scope) { return super.get(this.scope); } }
@Override public T get() { //the first test avoids accessing a volatile when not needed if (isLazy && instance != null) { return instance; } //ensure both sync for DSL //and sync around provider //so that dev's providers don't deal with concurrency synchronized (this) { if (isLazy) { //DCL if (instance == null) { instance = providerInstance.get(scope); //gc providerInstance = null; } return instance; } return providerInstance.get(scope); } } }
@Override public <T> T getInstance(Class<T> clazz) { Configuration.instance.checkCyclesStart(clazz); T t = lookupProvider(clazz, null).get(this); Configuration.instance.checkCyclesEnd(clazz); return t; }
@Override public <T> T getInstance(Class<T> clazz, String name) { Configuration.instance.checkCyclesStart(clazz); T t = lookupProvider(clazz, name).get(this); Configuration.instance.checkCyclesEnd(clazz); return t; }
@Override public <T> T getInstance(Class<T> clazz, String name) { crashIfClosed(); ConfigurationHolder.configuration.checkCyclesStart(clazz, name); T t; try { t = lookupProvider(clazz, name).get(this); } finally { ConfigurationHolder.configuration.checkCyclesEnd(clazz, name); } return t; }