|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Creator<T>
Encapsulates how to create an object.
Signature-wise it's the same as Inhabitant
but it carries an additional meaning.
Creators| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.sun.hk2.component.Holder |
|---|
Holder.Impl<T> |
| Method Summary | |
|---|---|
T |
create(Inhabitant onBehalfOf)
Creates a new instance. |
T |
get()
Short cut for |
void |
initialize(T t,
Inhabitant onBehalfOf)
Performs initialization of object, such as dependency injection. |
| Methods inherited from interface org.jvnet.hk2.component.Inhabitant |
|---|
companions, get, getSerializedMetadata, getSerializedMetadata, isInstantiated, lead, metadata, release, setCompanions, type, typeName |
| Method Detail |
|---|
T get()
throws ComponentException
T o = create(); initialize(o); return o;
get in interface Holder<T>get in interface Inhabitant<T>ComponentException
T create(Inhabitant onBehalfOf)
throws ComponentException
initialize(Object, Inhabitant)
right away. This 2-phase initialization allows us to handle
cycle references correctly.
onBehalfOf -
ComponentException
void initialize(T t,
Inhabitant onBehalfOf)
throws ComponentException
ComponentException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||