Package org.jvnet.hk2.internal
Class FactoryCreator<T>
- java.lang.Object
-
- org.jvnet.hk2.internal.FactoryCreator<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ConcurrentHashMap<ThreadSpecificObject<ActiveDescriptor<?>>,java.lang.Object>
cycleFinder
private ActiveDescriptor<?>
factoryDescriptor
private InstantiationServiceImpl
instantiationService
private ServiceLocator
locator
private static java.lang.Object
MAP_VALUE
-
Constructor Summary
Constructors Constructor Description FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
create(ServiceHandle<?> root, SystemDescriptor<?> eventThrower)
Creates an instance of the given typevoid
dispose(T instance)
Disposes the given instanceprivate ServiceHandle<Factory<T>>
getFactoryHandle()
java.util.List<Injectee>
getInjectees()
Returns all the injectees needed prior to creating this objectjava.lang.String
toString()
-
-
-
Field Detail
-
MAP_VALUE
private static final java.lang.Object MAP_VALUE
-
cycleFinder
private final java.util.concurrent.ConcurrentHashMap<ThreadSpecificObject<ActiveDescriptor<?>>,java.lang.Object> cycleFinder
-
locator
private final ServiceLocator locator
-
factoryDescriptor
private final ActiveDescriptor<?> factoryDescriptor
-
instantiationService
private final InstantiationServiceImpl instantiationService
-
-
Constructor Detail
-
FactoryCreator
FactoryCreator(ServiceLocator locator, ActiveDescriptor<?> factoryDescriptor)
-
-
Method Detail
-
getInjectees
public java.util.List<Injectee> getInjectees()
Description copied from interface:Creator
Returns all the injectees needed prior to creating this object- Specified by:
getInjectees
in interfaceCreator<T>
- Returns:
- a List of all the injectees
-
getFactoryHandle
private ServiceHandle<Factory<T>> getFactoryHandle()
-
create
public T create(ServiceHandle<?> root, SystemDescriptor<?> eventThrower) throws MultiException
Description copied from interface:Creator
Creates an instance of the given type- Specified by:
create
in interfaceCreator<T>
- Returns:
- an instance of the given type
- Throws:
MultiException
- if the creator threw an exception during construction
-
dispose
public void dispose(T instance)
Description copied from interface:Creator
Disposes the given instance
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-