org.apache.webbeans.ejb.component
Class EjbBean<T>

java.lang.Object
  extended by org.apache.webbeans.component.AbstractOwbBean<T>
      extended by org.apache.webbeans.component.AbstractInjectionTargetBean<T>
          extended by org.apache.webbeans.ejb.component.EjbBean<T>
All Implemented Interfaces:
javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, EnterpriseBeanMarker, InjectionTargetBean<T>, OwbBean<T>

public class EjbBean<T>
extends AbstractInjectionTargetBean<T>
implements EnterpriseBeanMarker

Defines bean contract for the session beans.

Version:
$Rev$ $Date$

Field Summary
 
Fields inherited from class org.apache.webbeans.component.AbstractInjectionTargetBean
decorators, inheritedMetaData, injectionTarget, interceptorStack
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
apiTypes, enabled, implQualifiers, implScopeType, injectionPoints, name, nullable, returnType, serializable, specializedBean, stereoTypes, webBeansType
 
Constructor Summary
EjbBean(Class<T> ejbClassType)
          Creates a new instance of the session bean.
 
Method Summary
protected  T createComponentInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          
protected  void destroyComponentInstance(T instance, javax.enterprise.context.spi.CreationalContext<T> creational)
          
 org.apache.openejb.DeploymentInfo getDeploymentInfo()
          Returns bean's deployment info.
 String getEjbName()
          Gets ejb name.
 javax.enterprise.inject.spi.SessionBeanType getEjbType()
          Gets ejb session type.
 void injectFieldInInterceptor(Object instance, javax.enterprise.context.spi.CreationalContext<?> creationalContext)
          Inject session bean injected fields.
 void injectFields(T instance, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          
 boolean isPassivationCapable()
           
 void setDeploymentInfo(org.apache.openejb.DeploymentInfo deploymentInfo)
          Sets session bean's deployment info.
 void setEjbType(javax.enterprise.inject.spi.SessionBeanType type)
          Sets session bean type.
 void setIface(Class<?> iface)
          Sets local interface type.
 void setRemoveStatefulInstance(boolean remove)
          Sets remove flag.
 
Methods inherited from class org.apache.webbeans.component.AbstractInjectionTargetBean
addInjectedField, addInjectedFieldToSuper, addInjectedMethod, addInjectedMethodToSuper, addObservableMethod, afterConstructor, beforeConstructor, createDefaultInstance, createInstance, destroyInstance, getAnnotatedType, getDecoratorStack, getInheritedMetaData, getInjectedFields, getInjectedFromSuperFields, getInjectedFromSuperMethods, getInjectedMethods, getInjectionPoints, getInjectionTarget, getInterceptorStack, getLogger, getObservableMethods, injectMethods, injectResources, injectSuperFields, injectSuperMethods, isFullyInitialize, isInjectionTargetSet, postConstruct, postConstructDefault, preDestroy, preDestroyDefault, setAnnotatedType, setFullyInitialize, setInheritedMetaData, setInjectionTarget, validatePassivationDependencies
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
addApiType, addInjectionPoint, addQualifier, addStereoType, create, destroy, getBeanClass, getId, getImplQualifiers, getImplScopeType, getInjectionPoint, getManager, getName, getOwbStereotypes, getQualifiers, getReturnType, getScope, getStereotypes, getTypes, getWebBeansType, isAlternative, isDependent, isEnabled, isNullable, isSerializable, isSpecializedBean, setEnabled, setImplScopeType, setName, setNullable, setSerializable, setSpecializedBean, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.webbeans.component.OwbBean
addApiType, addInjectionPoint, addQualifier, addStereoType, getId, getImplQualifiers, getImplScopeType, getInjectionPoint, getOwbStereotypes, getReturnType, getWebBeansType, isDependent, isEnabled, isSerializable, isSpecializedBean, setEnabled, setImplScopeType, setName, setNullable, setSerializable, setSpecializedBean
 
Methods inherited from interface javax.enterprise.inject.spi.Bean
getBeanClass, getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
 
Methods inherited from interface javax.enterprise.context.spi.Contextual
create, destroy
 

Constructor Detail

EjbBean

public EjbBean(Class<T> ejbClassType)
Creates a new instance of the session bean.

Parameters:
ejbClassType - ebj class type
Method Detail

setIface

public void setIface(Class<?> iface)
Sets local interface type.

Parameters:
iface - local interface type

setRemoveStatefulInstance

public void setRemoveStatefulInstance(boolean remove)
Sets remove flag.

Parameters:
remove - flag

setDeploymentInfo

public void setDeploymentInfo(org.apache.openejb.DeploymentInfo deploymentInfo)
Sets session bean's deployment info.

Parameters:
deploymentInfo - deployment info

getDeploymentInfo

public org.apache.openejb.DeploymentInfo getDeploymentInfo()
Returns bean's deployment info.

Returns:
bean's deployment info

injectFields

public void injectFields(T instance,
                         javax.enterprise.context.spi.CreationalContext<T> creationalContext)

Specified by:
injectFields in interface InjectionTargetBean<T>
Overrides:
injectFields in class AbstractInjectionTargetBean<T>

isPassivationCapable

public boolean isPassivationCapable()
Specified by:
isPassivationCapable in interface OwbBean<T>
Overrides:
isPassivationCapable in class AbstractOwbBean<T>

injectFieldInInterceptor

public void injectFieldInInterceptor(Object instance,
                                     javax.enterprise.context.spi.CreationalContext<?> creationalContext)
Inject session bean injected fields. It is called from interceptor.

Parameters:
instance - bean instance
creationalContext - creational context instance

createComponentInstance

protected T createComponentInstance(javax.enterprise.context.spi.CreationalContext<T> creationalContext)

Overrides:
createComponentInstance in class AbstractInjectionTargetBean<T>

destroyComponentInstance

protected void destroyComponentInstance(T instance,
                                        javax.enterprise.context.spi.CreationalContext<T> creational)

Overrides:
destroyComponentInstance in class AbstractInjectionTargetBean<T>

setEjbType

public void setEjbType(javax.enterprise.inject.spi.SessionBeanType type)
Sets session bean type.

Parameters:
type - session bean type

getEjbName

public String getEjbName()
Gets ejb name.

Returns:
ejb name

getEjbType

public javax.enterprise.inject.spi.SessionBeanType getEjbType()
Gets ejb session type.

Returns:
type of the ejb


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