org.apache.webbeans.portable.creation
Class AbstractProducer<T>

java.lang.Object
  extended by org.apache.webbeans.portable.creation.AbstractProducer<T>
Type Parameters:
T - bean type info
All Implemented Interfaces:
javax.enterprise.inject.spi.Producer<T>
Direct Known Subclasses:
InjectionTargetProducer, ProducerBeansProducer

public abstract class AbstractProducer<T>
extends Object
implements javax.enterprise.inject.spi.Producer<T>

Abstract implementation of Producer contract.

Version:
$Rev: 1417373 $ $Date: 2012-12-05 12:57:25 +0100 (Mi, 05 Dez 2012) $

Field Summary
protected  OwbBean<T> bean
          Bean instance
 
Constructor Summary
protected AbstractProducer(OwbBean<T> bean)
          Create a new producer with given bean.
 
Method Summary
 void dispose(T instance)
          
protected
<X> X
getBean(Class<X> clazz)
          Returns actual bean instance.
protected  javax.enterprise.context.spi.CreationalContext<T> getCreationalContext()
          This is a quirks mode function :( The problem is that we also need the CC for detecting the interceptors for PreDestroy and PostConstruct methods for example.
 Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
          
 T produce(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bean

protected OwbBean<T> bean
Bean instance

Constructor Detail

AbstractProducer

protected AbstractProducer(OwbBean<T> bean)
Create a new producer with given bean.

Parameters:
bean - bean instance
Method Detail

getInjectionPoints

public Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()

Specified by:
getInjectionPoints in interface javax.enterprise.inject.spi.Producer<T>

produce

public T produce(javax.enterprise.context.spi.CreationalContext<T> creationalContext)

Specified by:
produce in interface javax.enterprise.inject.spi.Producer<T>

dispose

public void dispose(T instance)

Specified by:
dispose in interface javax.enterprise.inject.spi.Producer<T>

getCreationalContext

protected javax.enterprise.context.spi.CreationalContext<T> getCreationalContext()
This is a quirks mode function :( The problem is that we also need the CC for detecting the interceptors for PreDestroy and PostConstruct methods for example. But sadly the CDI SPI doesn't pass the CC :/

Returns:

getBean

protected <X> X getBean(Class<X> clazz)
Returns actual bean instance.

Type Parameters:
X - bean type info
Parameters:
clazz - bean type class
Returns:
actual bean


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.