Top Inners Fields Constructors Methods
org.jvnet.hk2.internal

public Class ClazzCreator<T>

extends Object
implements Creator<T>
Class Inheritance
All Implemented Interfaces
org.jvnet.hk2.internal.Creator
Type Parameters
<T>
The type of object this creator creates
Imports
java.lang.reflect.AnnotatedElement, .Constructor, .Field, .Method, java.util.Collections, .LinkedHashMap, .LinkedHashSet, .LinkedList, .List, .Map, .Set, org.aopalliance.intercept.ConstructorInterceptor, .MethodInterceptor, org.glassfish.hk2.api.ActiveDescriptor, .ClassAnalyzer, .Injectee, .InjectionResolver, .InstanceLifecycleEventType, .MultiException, .PostConstruct, .PreDestroy, .ServiceHandle, org.glassfish.hk2.utilities.reflection.ReflectionHelper

Author
jwells

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private List<SystemInjecteeImpl>
private final Class<?>
private final ServiceLocatorImpl
private ClazzCreator.ResolutionInfo
private final Set<ClazzCreator.ResolutionInfo>
private final Set<ClazzCreator.ResolutionInfo>
private Method
private Method
private ActiveDescriptor<?>
private final Set<ClazzCreator.ResolutionInfo>
private final Set<ClazzCreator.ResolutionInfo>

Constructor Summary

AccessConstructor and Description
pack-priv
ClazzCreator(ServiceLocatorImpl locator, Class<?> implClass)

Method Summary

Modifier and TypeMethod and Description
public T
create(ServiceHandle<?> root, SystemDescriptor<?> eventThrower)

Implements org.jvnet.hk2.internal.Creator.create.

Creates an instance of the given type

private Object
public void
dispose(T instance)

Implements org.jvnet.hk2.internal.Creator.dispose.

Disposes the given instance

private void
private void
pack-priv Class<?>
public List<Injectee>
getInjectees()

Implements org.jvnet.hk2.internal.Creator.getInjectees.

Returns all the injectees needed prior to creating this object

pack-priv ServiceLocatorImpl
pack-priv ActiveDescriptor<?>
pack-priv void
initialize(ActiveDescriptor<?> selfDescriptor, String analyzerName, Collector collector)

pack-priv void
initialize(ActiveDescriptor<?> selfDescriptor, Collector collector)

private void
private void
private void
private void
pack-priv void
resetSelfDescriptor(ActiveDescriptor<?>
The descriptor that should replace our self descriptor
selfDescriptor
)

This is done because sometimes when creating the creator we do not know what the true system descriptor will be

private void
resolve(Map<SystemInjecteeImpl, Object> addToMe, InjectionResolver<?> resolver, SystemInjecteeImpl injectee, ServiceHandle<?> root, Collector errorCollection)

private Map<SystemInjecteeImpl, Object>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

allInjecteesback to summary
private List<SystemInjecteeImpl> allInjectees
implClassback to summary
private final Class<?> implClass
locatorback to summary
private final ServiceLocatorImpl locator
myConstructorback to summary
private ClazzCreator.ResolutionInfo myConstructor
myFieldsback to summary
private final Set<ClazzCreator.ResolutionInfo> myFields
myInitializersback to summary
private final Set<ClazzCreator.ResolutionInfo> myInitializers
postConstructMethodback to summary
private Method postConstructMethod
preDestroyMethodback to summary
private Method preDestroyMethod
selfDescriptorback to summary
private ActiveDescriptor<?> selfDescriptor
superFieldsback to summary
private final Set<ClazzCreator.ResolutionInfo> superFields
superInitializersback to summary
private final Set<ClazzCreator.ResolutionInfo> superInitializers

Constructor Detail

ClazzCreatorback to summary
pack-priv ClazzCreator(ServiceLocatorImpl locator, Class<?> implClass)

Method Detail

createback to summary
public T create(ServiceHandle<?> root, SystemDescriptor<?> eventThrower)

Implements org.jvnet.hk2.internal.Creator.create.

Doc from org.jvnet.hk2.internal.Creator.create.

Creates an instance of the given type

Annotations
@SuppressWarnings:unchecked
@Override
createMeback to summary
private Object createMe(Map<SystemInjecteeImpl, Object> resolved) throws Throwable
disposeback to summary
public void dispose(T instance)

Implements org.jvnet.hk2.internal.Creator.dispose.

Doc from org.jvnet.hk2.internal.Creator.dispose.

Disposes the given instance

Annotations
@Override
fieldMeback to summary
private void fieldMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable
fieldParentsback to summary
private void fieldParents(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable
getImplClassback to summary
pack-priv Class<?> getImplClass()
getInjecteesback to summary
public List<Injectee> getInjectees()

Implements org.jvnet.hk2.internal.Creator.getInjectees.

Doc from org.jvnet.hk2.internal.Creator.getInjectees.

Returns all the injectees needed prior to creating this object

Annotations
@Override
getServiceLocatorback to summary
pack-priv ServiceLocatorImpl getServiceLocator()
getUnderlyingDescriptorback to summary
pack-priv ActiveDescriptor<?> getUnderlyingDescriptor()
initializeback to summary
pack-priv void initialize(ActiveDescriptor<?> selfDescriptor, String analyzerName, Collector collector)
initializeback to summary
pack-priv void initialize(ActiveDescriptor<?> selfDescriptor, Collector collector)
methodMeback to summary
private void methodMe(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable
methodParentsback to summary
private void methodParents(Map<SystemInjecteeImpl, Object> resolved, T t) throws Throwable
postConstructMeback to summary
private void postConstructMe(T t) throws Throwable
preDestroyMeback to summary
private void preDestroyMe(T t) throws Throwable
resetSelfDescriptorback to summary
pack-priv 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:ActiveDescriptor<?>

The descriptor that should replace our self descriptor

resolveback to summary
private void resolve(Map<SystemInjecteeImpl, Object> addToMe, InjectionResolver<?> resolver, SystemInjecteeImpl injectee, ServiceHandle<?> root, Collector errorCollection)
resolveAllDependenciesback to summary
private Map<SystemInjecteeImpl, Object> resolveAllDependencies(final ServiceHandle<?> root) throws MultiException, IllegalStateException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

org.jvnet.hk2.internal back to summary

private Class ClazzCreator.ResolutionInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final AnnotatedElement
private final List<SystemInjecteeImpl>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

baseElementback to summary
private final AnnotatedElement baseElement
injecteesback to summary
private final List<SystemInjecteeImpl> injectees

Constructor Detail

ResolutionInfoback to summary
private ResolutionInfo(AnnotatedElement baseElement, List<SystemInjecteeImpl> injectees)

Method Detail

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override