public class ObjectFactory extends InitializeObject
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ObjectFactory.InjectTraverser |
protected static class |
ObjectFactory.KeyDesc |
static class |
ObjectFactory.ObjectDesc |
protected static class |
ObjectFactory.ObjectInst |
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentMap<ObjectFactory.KeyDesc,ObjectFactory.ObjectInst> |
objectInstMap |
protected Set<ObjectFactory.ObjectInst> |
objectInsts |
mutex| Constructor and Description |
|---|
ObjectFactory() |
assertNotInitialized, initializeprotected final Set<ObjectFactory.ObjectInst> objectInsts
protected final ConcurrentMap<ObjectFactory.KeyDesc,ObjectFactory.ObjectInst> objectInstMap
protected void init()
throws Exception
init in class InitializeObjectExceptionprotected void validateFactory()
throws ObjectException
ObjectExceptionprotected int getMatchingCount(Class<?> type, Annotation[] qualifiers)
public <T> ObjectFactory register(Class<T> type, ObjectProducer<T> producer)
public <T> ObjectFactory register(Class<T> type, ObjectProducer<T> producer, ObjectScope scope)
public <T> ObjectFactory register(Class<T> type, ObjectProducer<T> producer, ObjectScope scope, Annotation... qualifiers)
public ObjectFactory register(Class<?> implClass)
public ObjectFactory register(Class<?> implClass, ObjectScope scope)
public ObjectFactory register(Class<?> implClass, ObjectScope scope, Annotation... qualifiers)
public ObjectFactory unregister(Class<?> implClass)
public ObjectFactory inject(Object obj) throws ObjectException
ObjectExceptionprotected Object[] createArguments(Parameter[] parameters) throws ObjectException
ObjectExceptionprotected Object produceObject(ObjectFactory.ObjectInst objInst) throws ObjectException
ObjectExceptionpublic <T> T getObject(Class<?> type) throws ObjectException
ObjectExceptionprotected ObjectFactory.ObjectInst getObjectInst(Class<?> type, Annotation[] qualifiers)
public <T> T getObject(Class<?> type, Annotation... qualifiers) throws ObjectException
ObjectExceptionpublic <T> T postConstruct(T obj)
throws ObjectException
ObjectExceptionpublic void preDestroy(Object obj) throws ObjectException
ObjectExceptionpublic void destroy()
throws ObjectException
destroy in interface InitializeSupportdestroy in class InitializeObjectObjectExceptionprotected void invokeMethod(Object obj, Class<? extends Annotation> annotationType) throws ObjectException
ObjectExceptionpublic Iterator<ObjectFactory.ObjectDesc> getDescIterator()
Copyright © 2017. All rights reserved.