org.glassfish.hk2
Interface Provider<T>
public interface Provider<T>
Provides an instance of T either by creating a new one at each request
or returning an existing one.
- Author:
- Jerome Dochez
|
Method Summary |
T |
get()
The system calls this method to obtain a reference
to the component. |
get
T get()
throws ComponentException
- The system calls this method to obtain a reference
to the component.
- Returns:
- null is a valid return value. This is useful
when a factory primarily does a look-up and it fails
to find the specified component, yet you don't want that
by itself to be an error. If the injection wants
a non-null value (i.e., @Inject(optional=false)).
- Throws:
ComponentException - If the factory failed to get/create an instance
and would like to propagate the error to the caller.
Copyright © 2011 Oracle Corporation. All Rights Reserved.