public static final class RequestScope.Instance
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private LazyUid |
id |
private java.util.concurrent.atomic.AtomicInteger |
referenceCounter
Holds the number of snapshots of this scope.
|
private java.util.Map<org.glassfish.hk2.api.ActiveDescriptor<?>,java.lang.Object> |
store
A map of injectable instances in this scope.
|
Modifier | Constructor and Description |
---|---|
private |
Instance() |
Modifier and Type | Method and Description |
---|---|
private <T> boolean |
contains(org.glassfish.hk2.api.ActiveDescriptor<T> provider) |
(package private) <T> T |
get(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor)
Get an inhabitant stored in the scope instance that matches the active descriptor .
|
private RequestScope.Instance |
getReference()
Get a "new" reference of the scope instance.
|
(package private) <T> T |
put(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor,
T value)
Store a new inhabitant for the given descriptor.
|
void |
release()
Release a single reference to the current request scope instance.
|
(package private) <T> void |
remove(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor)
Remove a value for the descriptor if present in the scope instance store.
|
java.lang.String |
toString() |
private final LazyUid id
private final java.util.Map<org.glassfish.hk2.api.ActiveDescriptor<?>,java.lang.Object> store
private final java.util.concurrent.atomic.AtomicInteger referenceCounter
private RequestScope.Instance getReference()
release()
method is explicitly
called (once per each getReference()
method call).<T> T get(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor)
T
- inhabitant type.descriptor
- inhabitant descriptor.null
if not matched.<T> T put(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor, T value)
T
- inhabitant type.descriptor
- inhabitant descriptor.value
- inhabitant value.null
if none stored.<T> void remove(org.glassfish.hk2.api.ActiveDescriptor<T> descriptor)
descriptor
- key for the value to be removed.private <T> boolean contains(org.glassfish.hk2.api.ActiveDescriptor<T> provider)
public void release()
public java.lang.String toString()
toString
in class java.lang.Object