org.jboss.weld.bean
Class ManagedBean<T>

java.lang.Object
  extended by org.jboss.weld.bean.RIBean<T>
      extended by org.jboss.weld.bean.AbstractBean<T,java.lang.Class<T>>
          extended by org.jboss.weld.bean.AbstractClassBean<T>
              extended by org.jboss.weld.bean.ManagedBean<T>
Type Parameters:
T - The type (class) of the bean
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.PassivationCapable
Direct Known Subclasses:
DecoratorImpl, InterceptorImpl, NewManagedBean

public class ManagedBean<T>
extends AbstractClassBean<T>

Represents a simple bean

Author:
Pete Muir, Marius Bogoevici

Field Summary
 
Fields inherited from class org.jboss.weld.bean.AbstractClassBean
annotatedItem
 
Fields inherited from class org.jboss.weld.bean.AbstractBean
bindings, manager, name, scopeType, type, types
 
Fields inherited from class org.jboss.weld.bean.RIBean
BEAN_ID_PREFIX, BEAN_ID_SEPARATOR
 
Constructor Summary
protected ManagedBean(WeldClass<T> type, java.lang.String idSuffix, BeanManagerImpl manager)
          Constructor
 
Method Summary
protected  T applyInterceptors(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
           
protected  javax.enterprise.inject.spi.InjectionPoint attachCorrectInjectionPoint()
           
protected  void checkBeanImplementation()
          Validates the bean implementation
protected  void checkConstructor()
           
protected  void checkType()
          Validates the type
 T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Creates an instance of the bean
 void destroy(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Destroys an instance of the bean
 WeldConstructor<T> getConstructor()
          Returns the constructor
 java.lang.String getDescription()
          Gets a string representation
protected  java.lang.String getDescription(java.lang.String beanType)
           
 ManagedBean<?> getSpecializedBean()
           
protected  void initConstructor()
          Initializes the constructor
protected  void initDeclaredInterceptors()
           
 void initialize(BeanDeployerEnvironment environment)
          Initializes the bean and its metadata
protected  boolean isInterceptionCandidate()
           
static
<T> ManagedBean<T>
of(WeldClass<T> clazz, BeanManagerImpl manager)
          Creates a simple, annotation defined Web Bean
protected  void preSpecialize(BeanDeployerEnvironment environment)
           
protected  void specialize(BeanDeployerEnvironment environment)
           
 
Methods inherited from class org.jboss.weld.bean.AbstractClassBean
applyDecorators, defaultPostConstruct, defaultPreDestroy, flattenInterceptorBindings, getAnnotatedItem, getDecorators, getDefaultName, getInitializerMethods, getInjectableFields, getInjectionPoints, getInjectionTarget, getPostConstruct, getPreDestroy, getSuperclasses, hasDecorators, initDecorators, initInitializerMethods, initInjectableFields, initInterceptors, initPostConstruct, initPreDestroy, initProxyClassForDecoratedBean, initScopeType, initType, setInjectionTarget
 
Methods inherited from class org.jboss.weld.bean.AbstractBean
addInjectionPoint, addInjectionPoints, checkDelegateInjectionPoints, getAnnotatedInjectionPoints, getDelegateInjectionPoints, getMergedStereotypes, getName, getQualifiers, getScope, getStereotypes, getType, getTypes, initBindings, initDefaultBindings, initName, initPolicy, initPrimitive, initProxyable, initScopeTypeFromStereotype, initSerializable, initStereotypes, initTypes, isAlternative, isDependent, isInitialized, isNormalScoped, isNullable, isPrimitive, isProxyable, isSerializable, isSpecializing, postSpecialize
 
Methods inherited from class org.jboss.weld.bean.RIBean
equals, getBeanClass, getId, getManager, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedBean

protected ManagedBean(WeldClass<T> type,
                      java.lang.String idSuffix,
                      BeanManagerImpl manager)
Constructor

Parameters:
type - The type of the bean
manager - The Bean manager
Method Detail

of

public static <T> ManagedBean<T> of(WeldClass<T> clazz,
                                    BeanManagerImpl manager)
Creates a simple, annotation defined Web Bean

Type Parameters:
T - The type
Parameters:
clazz - The class
manager - the current manager
Returns:
A Web Bean

create

public T create(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Creates an instance of the bean

Returns:
The instance

attachCorrectInjectionPoint

protected javax.enterprise.inject.spi.InjectionPoint attachCorrectInjectionPoint()

destroy

public void destroy(T instance,
                    javax.enterprise.context.spi.CreationalContext<T> creationalContext)
Destroys an instance of the bean

Parameters:
instance - The instance

initialize

public void initialize(BeanDeployerEnvironment environment)
Initializes the bean and its metadata

Overrides:
initialize in class AbstractClassBean<T>

checkType

protected void checkType()
Validates the type

Overrides:
checkType in class AbstractClassBean<T>

checkBeanImplementation

protected void checkBeanImplementation()
Description copied from class: AbstractClassBean
Validates the bean implementation

Overrides:
checkBeanImplementation in class AbstractClassBean<T>

checkConstructor

protected void checkConstructor()

preSpecialize

protected void preSpecialize(BeanDeployerEnvironment environment)
Overrides:
preSpecialize in class AbstractClassBean<T>

specialize

protected void specialize(BeanDeployerEnvironment environment)
Overrides:
specialize in class AbstractBean<T,java.lang.Class<T>>

initConstructor

protected void initConstructor()
Initializes the constructor


getConstructor

public WeldConstructor<T> getConstructor()
Returns the constructor

Returns:
The constructor

getDescription

public java.lang.String getDescription()
Gets a string representation

Specified by:
getDescription in class RIBean<T>
Returns:
The string representation

getDescription

protected java.lang.String getDescription(java.lang.String beanType)

getSpecializedBean

public ManagedBean<?> getSpecializedBean()
Specified by:
getSpecializedBean in class AbstractBean<T,java.lang.Class<T>>

isInterceptionCandidate

protected boolean isInterceptionCandidate()
Specified by:
isInterceptionCandidate in class AbstractClassBean<T>

applyInterceptors

protected T applyInterceptors(T instance,
                              javax.enterprise.context.spi.CreationalContext<T> creationalContext)

initDeclaredInterceptors

protected void initDeclaredInterceptors()


Copyright © 2008-2009 Seam Framework. All Rights Reserved.