org.glassfish.hk2
Interface Binding<T>


public interface Binding<T>

A Binding represents a single registered entry in the HK2 Services registry that provides a facility to get to contextual provider instances.

Bindings represent something that is registered in Services whereas a Provider provides the runtime services for the given registered Binding entry in the correct context appropriate for the caller.

Author:
Jerome Dochez, Jeff Trent, Mason Taube

Method Summary
 Descriptor getDescriptor()
          The Descriptor fully characterizes the attributes of this Provider.
 Provider<T> getProvider()
          Return a Provider with providing contextual information on how the provider will be used.
 Provider<T> getProvider(Context ctx)
          Return a Provider optionally providing contextual information for how the component provider will be used (e.g., for contextual injection, etc).
 

Method Detail

getDescriptor

Descriptor getDescriptor()
The Descriptor fully characterizes the attributes of this Provider.

Returns:
a non-null Descriptor describing the complete set of attributes of the provider.

getProvider

Provider<T> getProvider(Context ctx)
Return a Provider optionally providing contextual information for how the component provider will be used (e.g., for contextual injection, etc).

The return value may be unique based on the provided contextual information. Caller's should therefore not assume identity equality in the return value.

Parameters:
ctx - contextual information for how the provider will be used, or null
Returns:
a non-null component provider instance

getProvider

Provider<T> getProvider()
Return a Provider with providing contextual information on how the provider will be used. Equivalent to calling getProvider(null).

Returns:
a non-null component provider instance


Copyright © 2011 Oracle Corporation. All Rights Reserved.