public abstract class AbstractMemberProducer<X,T> extends AbstractProducer<T>
Producer
s backing producer fields and producer methods.Constructor and Description |
---|
AbstractMemberProducer(EnhancedAnnotatedMember<T,? super X,? extends Member> enhancedMember,
DisposalMethod<?,?> disposalMethod) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkDeclaringBean() |
protected void |
checkProducerReturnType(EnhancedAnnotatedMember<T,? super X,? extends Member> enhancedMember)
Validates the producer method
|
void |
dispose(T instance)
Destroys the instance.
|
abstract AnnotatedMember<? super X> |
getAnnotated() |
abstract Bean<T> |
getBean()
Returns a
Bean this producer is associated with or null if no such bean exists. |
abstract BeanManagerImpl |
getBeanManager() |
abstract Bean<X> |
getDeclaringBean() |
DisposalMethod<?,?> |
getDisposalMethod() |
protected Object |
getReceiver(CreationalContext<?> productCreationalContext,
CreationalContext<?> receiverCreationalContext)
Gets the receiver of the product.
|
protected boolean |
isTypeSerializable(Object object) |
T |
produce(CreationalContext<T> ctx)
Causes an instance to be produced via the
Producer . |
protected abstract T |
produce(Object receiver,
CreationalContext<T> ctx) |
protected abstract DefinitionException |
producerCannotHaveWildcardBeanType(Object member) |
protected abstract DefinitionException |
producerWithTypeVariableBeanTypeMustBeDependent(Object member) |
String |
toString() |
checkDelegateInjectionPoints, equals, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getInjectionPoints
public AbstractMemberProducer(EnhancedAnnotatedMember<T,? super X,? extends Member> enhancedMember, DisposalMethod<?,?> disposalMethod)
protected void checkDeclaringBean()
protected void checkProducerReturnType(EnhancedAnnotatedMember<T,? super X,? extends Member> enhancedMember)
protected abstract DefinitionException producerCannotHaveWildcardBeanType(Object member)
protected abstract DefinitionException producerWithTypeVariableBeanTypeMustBeDependent(Object member)
protected Object getReceiver(CreationalContext<?> productCreationalContext, CreationalContext<?> receiverCreationalContext)
productCreationalContext
- the creational context of the produced instancereceiverCreationalContext
- the creational context of the receiverpublic void dispose(T instance)
Producer
Destroys the instance.
If the Producer
represents a class, then this operation does nothing.
If the Producer
represents a producer field or method, this calls the disposer method, if any, on a contextual
instance of the bean that declares the disposer method or performs any additional required cleanup, if any, to destroy
state associated with a resource.
instance
- The instance to disposepublic T produce(CreationalContext<T> ctx)
Producer
Causes an instance to be produced via the Producer
.
If the Producer
represents a class, this will invoke the constructor annotated Inject
if it
exists, or the constructor with no parameters otherwise. If the class has interceptors, produce() is responsible
for building the interceptors and decorators of the instance.
If the Producer
represents a producer field or method, this will invoke the producer method on, or access the
producer field of, a contextual instance of the bean that declares the producer.
ctx
- The CreationalContext
to use for the produced objectpublic DisposalMethod<?,?> getDisposalMethod()
protected boolean isTypeSerializable(Object object)
public abstract BeanManagerImpl getBeanManager()
public abstract Bean<T> getBean()
AbstractProducer
Bean
this producer is associated with or null if no such bean exists.getBean
in class AbstractProducer<T>
public abstract AnnotatedMember<? super X> getAnnotated()
getAnnotated
in class AbstractProducer<T>
protected abstract T produce(Object receiver, CreationalContext<T> ctx)
Copyright © 2014. All Rights Reserved.