public static final class Hk2RequestScope.Instance extends Object implements RequestContext
Modifier and Type | Method and Description |
---|---|
boolean |
contains(ForeignDescriptor provider) |
<T> T |
get(ForeignDescriptor descriptor)
Get an inhabitant stored in the scope instance that matches the active descriptor .
|
Hk2RequestScope.Instance |
getReference()
Get a "new" reference of the scope instance.
|
<T> T |
put(ForeignDescriptor descriptor,
T value)
Store a new inhabitant for the given descriptor.
|
void |
release()
Release a single reference to the current request scope instance.
|
<T> void |
remove(ForeignDescriptor descriptor)
Remove a value for the descriptor if present in the scope instance store.
|
String |
toString() |
public Hk2RequestScope.Instance getReference()
release()
method is explicitly
called (once per each getReference()
method call).getReference
in interface RequestContext
public <T> T get(ForeignDescriptor descriptor)
T
- inhabitant type.descriptor
- inhabitant descriptor.null
if not matched.public <T> T put(ForeignDescriptor descriptor, T value)
T
- inhabitant type.descriptor
- inhabitant descriptor.value
- inhabitant value.null
if none stored.public <T> void remove(ForeignDescriptor descriptor)
descriptor
- key for the value to be removed.public boolean contains(ForeignDescriptor provider)
public void release()
Once all instance references are released, the instance will be recycled.
release
in interface RequestContext
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.