public class MapBasedScope extends Object implements com.google.inject.Scope
Provider which is specified at creation time of the scope. Each
time a scoped object is requested, the provider is queried to access the current scope
map. By returning different map instances, different scopes can be distinguished.| Modifier and Type | Method and Description |
|---|---|
<T> com.google.inject.Provider<T> |
scope(com.google.inject.Key<T> key,
com.google.inject.Provider<T> unscoped) |
static com.google.inject.Scope |
withMapSupplier(com.google.inject.Provider<Map<String,Object>> mapProvider)
Creates a new scope which stores all instances into the map provided by the passed
provider.
|
public static com.google.inject.Scope withMapSupplier(com.google.inject.Provider<Map<String,Object>> mapProvider)
mapProvider - Provider which supplies the map for storing scoped instances.public <T> com.google.inject.Provider<T> scope(com.google.inject.Key<T> key,
com.google.inject.Provider<T> unscoped)
scope in interface com.google.inject.ScopeCopyright © 2014–2018. All rights reserved.