org.glassfish.hk2
Interface ScopeInstance


Deprecated.

@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.

Author:
Jerome Dochez
See Also:
Scope.current()

Method Summary
<T> boolean
contains(Provider<T> provider)
          Deprecated. Returns true if this scope instance contains a stored inhabitant for a given provider, returns false otherwise.
<T> T
get(Provider<T> provider)
          Deprecated. Retrieves a stored inhabitant if present in the scope instance.
<T> T
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

get

<T> T get(Provider<T> provider)
Deprecated. 
Retrieves a stored inhabitant if present in the scope instance. Otherwise returns 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.

Type Parameters:
T - the requested inhabitant instance type.
Parameters:
provider - the Provider instance we request the inhabitant for.
Returns:
the instance of T for that provider. Method may return 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.
See Also:
contains(org.glassfish.hk2.Provider)

contains

<T> boolean contains(Provider<T> provider)
Deprecated. 
Returns 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.

Type Parameters:
T - the requested inhabitant instance type.
Parameters:
provider - the Provider instance we request the inhabitant for.
Returns:
true if this scope instance contains an inhabitant value for the specified Provider instance.
See Also:
get(org.glassfish.hk2.Provider)

put

<T> T put(Provider<T> provider,
          T value)
Deprecated. 
Stores a inhabitant component instance.

Type Parameters:
T - type of the component.
Parameters:
provider - component description as an Provider.
value - inhabitant component instance. May be null.
Returns:
the previous value associated with this provider (if any).

release

void release()
Deprecated. 
release the backend storage and call PreDestroy.preDestroy() on all instantiated components that implement the PreDestroy interface.



Copyright © 2013 Oracle Corporation. All Rights Reserved.