|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.hk2.HK2
public class HK2
Entry point to the HK2 services runtime. Users should start with get()
to get an implementation of the HK2 runtime.
| Constructor Summary | |
|---|---|
HK2(HK2Provider provider)
Provides an HK2 APIs implementation using the provided HK2Provider
instance as the implementation backend. |
|
| Method Summary | |
|---|---|
Services |
create(Services parent,
java.lang.Class<? extends Module>... moduleTypes)
Creates a new Services instances to register and lookup services to and from. |
Services |
create(Services parent,
Module... modules)
Creates a new Services instances to register and lookup services to and from. |
static HK2 |
get()
Entry point to the HK2 public APIs, will initialize the implementation and return a valid instance that can be used to configure modules bindings. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HK2(HK2Provider provider)
HK2 APIs implementation using the provided HK2Provider
instance as the implementation backend.
This is a very advanced usage pattern when HK2Provider implementations
are customized to provide specific domain features.
provider - the HK2 public APIs implementation backend.| Method Detail |
|---|
public static HK2 get()
ServiceLoader for further reference.
Module types or instances with or null if
an implementation cannot be found.
java.lang.RuntimeException - if an implementation cannot be instantiated.
public Services create(Services parent,
java.lang.Class<? extends Module>... moduleTypes)
Services instances to register and lookup services to and from.
Module will be instantiated in the order of the their declaration unless some
modules have explicit dependencies on other modules through a Inject
annotation.
Module are components and will follow normal HK2 activation and injection
procedure prior to the Module.configure(BinderFactory) call.
Module that are named using the Service.name()
annotation attribute will be added to the returned Services instance under
the name + Module contract identity. The returned Services instance will
also be registered using the optional Module name if present.
Returned instance of Services is not automatically added to the parent (if not null)
as an indexed Services instances. Users should use the parent's
Services.bindDynamically() method to register children
services.
parent - the parent Services instances to delegate lookup to.moduleTypes - array of Module types that will be configured with in the
returned Services instance.
Services instance configured with all the Module services
public Services create(Services parent,
Module... modules)
Services instances to register and lookup services to and from.
Module instances will not be injected before the Module.configure(BinderFactory) call.
Returned instance of Services is not automatically added to the parent (if not null)
as an indexed Services instances. Users should use the parent's
Services.bindDynamically() method to register children
services.
parent - the parent Services instances to delegate lookup to.modules - array of Module that will be configured with in the
returned Services instance.
Services instance configured with all the Module services
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||