public static final class Hk2RequestScope.Instance extends Object implements RequestContext
Modifier and Type | Method and Description |
---|---|
boolean |
contains(org.glassfish.jersey.internal.inject.ForeignDescriptor provider) |
<T> T |
get(org.glassfish.jersey.internal.inject.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(org.glassfish.jersey.internal.inject.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(org.glassfish.jersey.internal.inject.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(org.glassfish.jersey.internal.inject.ForeignDescriptor descriptor)
T
- inhabitant type.descriptor
- inhabitant descriptor.null
if not matched.public <T> T put(org.glassfish.jersey.internal.inject.ForeignDescriptor descriptor, T value)
T
- inhabitant type.descriptor
- inhabitant descriptor.value
- inhabitant value.null
if none stored.public <T> void remove(org.glassfish.jersey.internal.inject.ForeignDescriptor descriptor)
descriptor
- key for the value to be removed.public boolean contains(org.glassfish.jersey.internal.inject.ForeignDescriptor provider)
public void release()
Once all instance references are released, the instance will be recycled.
release
in interface RequestContext
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.