|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@Deprecated public interface ScopeInstance
A particular instantiation of a Scope
. Will be
used to store and retrieve components for that particular
Scope
For example, for the "request scope", an instance
of ScopeInstance
is created for each request.
Scope.current()
Method Summary | ||
---|---|---|
|
contains(Provider<T> provider)
Deprecated. Returns true if this scope instance contains a stored inhabitant
for a given provider, returns false otherwise. |
|
|
get(Provider<T> provider)
Deprecated. Retrieves a stored inhabitant if present in the scope instance. |
|
|
put(Provider<T> provider,
T value)
Deprecated. Stores a inhabitant component instance. |
|
void |
release()
Deprecated. release the backend storage and call PreDestroy.preDestroy()
on all instantiated components that implement the PreDestroy interface. |
Method Detail |
---|
<T> T get(Provider<T> provider)
null
. Note that null
returned value may be a valid
inhabitant value stored in the scope instance. To check if this is the case
contains(org.glassfish.hk2.Provider)
method can be used.
T
- the requested inhabitant instance type.provider
- the Provider
instance we request the inhabitant for.
null
in case the null
inhabitant value has been stored in the scope
or in case the inhabitant instance has never been stored in the scope.contains(org.glassfish.hk2.Provider)
<T> boolean contains(Provider<T> provider)
true
if this scope instance contains a stored inhabitant
for a given provider, returns false
otherwise. Note that this method
will return true
even if the previously stored inhabitant value is
null
.
T
- the requested inhabitant instance type.provider
- the Provider
instance we request the inhabitant for.
true
if this scope instance contains an inhabitant value
for the specified Provider
instance.get(org.glassfish.hk2.Provider)
<T> T put(Provider<T> provider, T value)
T
- type of the component.provider
- component description as an Provider
.value
- inhabitant component instance. May be null
.
void release()
PreDestroy.preDestroy()
on all instantiated components that implement the PreDestroy
interface.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |