org.apache.webbeans.component
Class ProducerFieldBean<T>

java.lang.Object
  extended by org.apache.webbeans.component.AbstractOwbBean<T>
      extended by org.apache.webbeans.component.AbstractProducerBean<T>
          extended by org.apache.webbeans.component.ProducerFieldBean<T>
Type Parameters:
T - Type of the field decleration
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, IBeanHasParent<T>, OwbBean<T>
Direct Known Subclasses:
ResourceBean

public class ProducerFieldBean<T>
extends AbstractProducerBean<T>
implements IBeanHasParent<T>

Defines the producer field component implementation.


Field Summary
 
Fields inherited from class org.apache.webbeans.component.AbstractProducerBean
ownerComponent
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
apiTypes, enabled, implQualifiers, implScopeType, injectionPoints, name, nullable, passivatingId, returnType, scopeClass, serializable, specializedBean, stereoTypeClasses, stereoTypes, webBeansType
 
Constructor Summary
ProducerFieldBean(InjectionTargetBean<?> ownerComponent, Class<T> returnType)
          Defines the new producer field component.
 
Method Summary
protected  void checkNullInstance(Object instance)
          Check null instance.
protected  void checkScopeType()
          Check scope type passivation controls.
protected  T createDefaultInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Default producer method creation.
protected  T createInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates the instance of the bean that has a specific implementation type.
 Type[] getActualTypeArguments()
          Returns actual type arguments.
 Field getCreatorField()
          Gets creator field.
 String getId()
          get the unique Id of the bean.
 boolean isPassivationCapable()
          True if passivation capable false otherwise.
 void setProducerField(Field field)
          Set producer field.
 String toString()
          
 
Methods inherited from class org.apache.webbeans.component.AbstractProducerBean
destroyBean, destroyInstance, dispose, getInjectionPoints, getParent, getParentInstance, getParentInstanceFromContext, isPassivationCapable, validatePassivationDependencies
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
addApiType, addInjectionPoint, addQualifier, addStereoType, create, createNewInstance, destroy, destroyCreatedInstance, equals, getBeanClass, getImplQualifiers, getImplScopeType, getInjectionPoint, getLogger, getManager, getName, getOwbStereotypes, getQualifiers, getReturnType, getScope, getStereotypes, getTypes, getWebBeansContext, getWebBeansType, hashCode, isAlternative, isDependent, isEnabled, isNullable, isSerializable, isSpecializedBean, setEnabled, setImplScopeType, setName, setNullable, setSerializable, setSpecializedBean
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.webbeans.component.IBeanHasParent
dispose, getParent
 

Constructor Detail

ProducerFieldBean

public ProducerFieldBean(InjectionTargetBean<?> ownerComponent,
                         Class<T> returnType)
Defines the new producer field component.

Parameters:
returnType - type of the field decleration
Method Detail

createInstance

protected T createInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates the instance of the bean that has a specific implementation type. Each subclass must define its own create mechanism.

Overrides:
createInstance in class AbstractProducerBean<T>
Parameters:
creationalContext - the contextual instance shall be created in
Returns:
instance of the bean

createDefaultInstance

protected T createDefaultInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Default producer method creation.

Parameters:
creationalContext - creational context
Returns:
producer method instance

getCreatorField

public Field getCreatorField()
Gets creator field.

Returns:
creator field

getActualTypeArguments

public Type[] getActualTypeArguments()
Returns actual type arguments.

Returns:
actual type arguments

setProducerField

public void setProducerField(Field field)
Set producer field.

Parameters:
field - producer field

checkNullInstance

protected void checkNullInstance(Object instance)
Check null instance.

Parameters:
instance - bean instance

checkScopeType

protected void checkScopeType()
Check scope type passivation controls.


isPassivationCapable

public boolean isPassivationCapable()
Description copied from interface: OwbBean
True if passivation capable false otherwise.

Specified by:
isPassivationCapable in interface OwbBean<T>
Overrides:
isPassivationCapable in class AbstractOwbBean<T>
Returns:
true if this bean is passivation capable

getId

public String getId()
Description copied from class: AbstractOwbBean
get the unique Id of the bean. This will get used as reference on passivation. Gets id of the bean.

Specified by:
getId in interface OwbBean<T>
Overrides:
getId in class AbstractOwbBean<T>
Returns:
id of the bean

toString

public String toString()

Overrides:
toString in class AbstractOwbBean<T>


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