Package org.glassfish.jersey.inject.hk2
Class ImmediateHk2InjectionManager
java.lang.Object
org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager
org.glassfish.jersey.inject.hk2.ImmediateHk2InjectionManager
- All Implemented Interfaces:
InjectionManager
Implementation of
InjectionManager
that is able to register and inject services.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
CompletesInjectionManager
and the underlying DI provider.void
Registers a collection of beans represented using fields in the provided descriptors.void
Registers a provider.void
Registers beans which are included inBinder
.void
Registers one bean represented using fields in the provided descriptor.Methods inherited from class org.glassfish.jersey.inject.hk2.AbstractHk2InjectionManager
createAndInitialize, createForeignDescriptor, getAllInstances, getAllServiceHolders, getInstance, getInstance, getInstance, getInstance, getInstance, getServiceLocator, inject, inject, isRegistrable, preDestroy, shutdown
-
Constructor Details
-
ImmediateHk2InjectionManager
ImmediateHk2InjectionManager(Object parent) Constructor with parent.- Parameters:
parent
- parent of typeInjectionManager
orServiceLocator
.
-
-
Method Details
-
completeRegistration
Description copied from interface:InjectionManager
CompletesInjectionManager
and the underlying DI provider. All registered components are bound to injection manager and after an invocation of this method all components are available using e.g.InjectionManager.getInstance(Class)
.- Throws:
IllegalStateException
-
register
Description copied from interface:InjectionManager
Registers one bean represented using fields in the provided descriptor. The final bean can be direct bean or factory object which will create the bean at the time of injection.InjectionManager
is able to register a bean represented by a class or direct instance.- Parameters:
binding
- one descriptor.- See Also:
-
register
Description copied from interface:InjectionManager
Registers a collection of beans represented using fields in the provided descriptors. The final bean can be direct bean or factory object which will create the bean at the time of injection.InjectionManager
is able to register a bean represented by a class or direct instance.- Parameters:
descriptors
- collection of descriptors.- See Also:
-
register
Description copied from interface:InjectionManager
Registers beans which are included inBinder
.Binder
can contains all descriptors extendingBinding
or other binders which are installed together in tree-structure. This method will get all descriptors bound in the given binder and register them in the order how the binders are installed together. In the tree structure, the deeper on the left side will be processed first.- Parameters:
binder
- collection of descriptors.- See Also:
-
register
Description copied from interface:InjectionManager
Registers a provider. An implementation of theInjectionManager
should test whether the type of the object can be registered using the methodInjectionManager.isRegistrable(Class)
. Then a caller has an certainty that the instance of the tested class can be registered inInjectionManager
. IfInjectionManager
is not able to register the provider thenIllegalArgumentException
is thrown.- Parameters:
provider
- object that can be registered inInjectionManager
.
-