T - The provider return typepublic class ScopedProvider<T> extends StdProvider<T> implements Provider<T>
The providers cannot be re-scoped
injected| Modifier | Constructor and Description |
|---|---|
protected |
ScopedProvider() |
|
ScopedProvider(Provider<T> provider,
Scope scope) |
| Modifier and Type | Method and Description |
|---|---|
T |
get() |
Scope |
getScope() |
Provider<T> |
getScoped() |
Provider<T> |
getUnscoped() |
void |
inject(ProvisionStack stack,
InjectorImpl injector)
Used by standard providers and some other
providers to delegate the injection to the
wrapped provider (when it's a wrapper provider)
or injecting some provider properties without
checking everything
|
boolean |
requiresJitScoping() |
Provider<T> |
withScope(Key<?> match,
Scope scope)
Adds the control of scoping the provider.
|
get, isInjected, onBind, setInjectedpublic Provider<T> withScope(Key<?> match, Scope scope)
StdProvider
Scopes the provider with the given scope
withScope in class StdProvider<T>match - The key used to match the scopescope - The scope to applypublic void inject(ProvisionStack stack, InjectorImpl injector)
StdProviderUsed by standard providers and some other providers to delegate the injection to the wrapped provider (when it's a wrapper provider) or injecting some provider properties without checking everything
inject in class StdProvider<T>stack - The thread injection stack (passed as argument
instead of getting it from the thread-local held
by the injector)injector - The injector used to inject this providerpublic T get()
public Scope getScope()
public boolean requiresJitScoping()