Package org.jvnet.hk2.internal
Class ClazzCreator<T>
- java.lang.Object
-
- org.jvnet.hk2.internal.ClazzCreator<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classClazzCreator.ResolutionInfo
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<SystemInjecteeImpl>allInjecteesprivate java.lang.Class<?>implClassprivate ServiceLocatorImpllocatorprivate ClazzCreator.ResolutionInfomyConstructorprivate java.util.Set<ClazzCreator.ResolutionInfo>myFieldsprivate java.util.Set<ClazzCreator.ResolutionInfo>myInitializersprivate java.lang.reflect.MethodpostConstructMethodprivate java.lang.reflect.MethodpreDestroyMethodprivate ActiveDescriptor<?>selfDescriptor
-
Constructor Summary
Constructors Constructor Description ClazzCreator(ServiceLocatorImpl locator, java.lang.Class<?> implClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(ServiceHandle<?> root, SystemDescriptor<?> eventThrower)Creates an instance of the given typeprivate java.lang.ObjectcreateMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved)voiddispose(T instance)Disposes the given instanceprivate voidfieldMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved, T t)(package private) java.lang.Class<?>getImplClass()java.util.List<Injectee>getInjectees()Returns all the injectees needed prior to creating this object(package private) ServiceLocatorImplgetServiceLocator()(package private) ActiveDescriptor<?>getUnderlyingDescriptor()(package private) voidinitialize(ActiveDescriptor<?> selfDescriptor, java.lang.String analyzerName, Collector collector)(package private) voidinitialize(ActiveDescriptor<?> selfDescriptor, Collector collector)private voidmethodMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved, T t)private voidpostConstructMe(T t)private voidpreDestroyMe(T t)(package private) voidresetSelfDescriptor(ActiveDescriptor<?> selfDescriptor)This is done because sometimes when creating the creator we do not know what the true system descriptor will beprivate voidresolve(java.util.Map<SystemInjecteeImpl,java.lang.Object> addToMe, InjectionResolver<?> resolver, SystemInjecteeImpl injectee, ServiceHandle<?> root, Collector errorCollection)private java.util.Map<SystemInjecteeImpl,java.lang.Object>resolveAllDependencies(ServiceHandle<?> root)java.lang.StringtoString()
-
-
-
Field Detail
-
locator
private final ServiceLocatorImpl locator
-
implClass
private final java.lang.Class<?> implClass
-
myInitializers
private final java.util.Set<ClazzCreator.ResolutionInfo> myInitializers
-
myFields
private final java.util.Set<ClazzCreator.ResolutionInfo> myFields
-
selfDescriptor
private ActiveDescriptor<?> selfDescriptor
-
myConstructor
private ClazzCreator.ResolutionInfo myConstructor
-
allInjectees
private java.util.List<SystemInjecteeImpl> allInjectees
-
postConstructMethod
private java.lang.reflect.Method postConstructMethod
-
preDestroyMethod
private java.lang.reflect.Method preDestroyMethod
-
-
Constructor Detail
-
ClazzCreator
ClazzCreator(ServiceLocatorImpl locator, java.lang.Class<?> implClass)
-
-
Method Detail
-
initialize
void initialize(ActiveDescriptor<?> selfDescriptor, java.lang.String analyzerName, Collector collector)
-
initialize
void initialize(ActiveDescriptor<?> selfDescriptor, Collector collector)
-
resetSelfDescriptor
void resetSelfDescriptor(ActiveDescriptor<?> selfDescriptor)
This is done because sometimes when creating the creator we do not know what the true system descriptor will be- Parameters:
selfDescriptor- The descriptor that should replace our self descriptor
-
resolve
private void resolve(java.util.Map<SystemInjecteeImpl,java.lang.Object> addToMe, InjectionResolver<?> resolver, SystemInjecteeImpl injectee, ServiceHandle<?> root, Collector errorCollection)
-
resolveAllDependencies
private java.util.Map<SystemInjecteeImpl,java.lang.Object> resolveAllDependencies(ServiceHandle<?> root) throws MultiException, java.lang.IllegalStateException
- Throws:
MultiExceptionjava.lang.IllegalStateException
-
createMe
private java.lang.Object createMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
fieldMe
private void fieldMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved, T t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
methodMe
private void methodMe(java.util.Map<SystemInjecteeImpl,java.lang.Object> resolved, T t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
postConstructMe
private void postConstructMe(T t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
preDestroyMe
private void preDestroyMe(T t) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
create
public T create(ServiceHandle<?> root, SystemDescriptor<?> eventThrower)
Description copied from interface:CreatorCreates an instance of the given type
-
dispose
public void dispose(T instance)
Description copied from interface:CreatorDisposes the given instance
-
getInjectees
public java.util.List<Injectee> getInjectees()
Description copied from interface:CreatorReturns all the injectees needed prior to creating this object- Specified by:
getInjecteesin interfaceCreator<T>- Returns:
- a List of all the injectees
-
getServiceLocator
ServiceLocatorImpl getServiceLocator()
-
getImplClass
java.lang.Class<?> getImplClass()
-
getUnderlyingDescriptor
ActiveDescriptor<?> getUnderlyingDescriptor()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-