org.apache.webbeans.ejb.common.component
Class BaseEjbBean<T>

java.lang.Object
  extended by org.apache.webbeans.component.BeanAttributesImpl<T>
      extended by org.apache.webbeans.component.AbstractOwbBean<T>
          extended by org.apache.webbeans.component.InjectionTargetBean<T>
              extended by org.apache.webbeans.ejb.common.component.BaseEjbBean<T>
All Implemented Interfaces:
Contextual<T>, Bean<T>, PassivationCapable, EnterpriseBeanMarker, OwbBean<T>, BeanAttributes<T>

public abstract class BaseEjbBean<T>
extends InjectionTargetBean<T>
implements EnterpriseBeanMarker

Defines bean contract for the session beans.

Version:
$Rev$ $Date$

Field Summary
protected  SessionBeanType ejbType
          Session bean type
static Object[] OBJECT_EMPTY
           
 
Fields inherited from class org.apache.webbeans.component.AbstractOwbBean
enabled, logger, passivatingId, specializedBean, webBeansContext, webBeansType
 
Constructor Summary
protected BaseEjbBean(WebBeansContext webBeansContext, SessionBeanType type, AnnotatedType<T> annotatedType, BeanAttributes<T> beanAttributes, Class<T> beanClass, InjectionTargetFactoryImpl<T> factory)
          Creates a new instance of the session bean.
protected BaseEjbBean(WebBeansContext webBeansContext, SessionBeanType type, AnnotatedType<T> annotatedType, BeanAttributesImpl<T> beanAttributes, Class<T> beanClass)
           
 
Method Summary
 void addDependentSFSB(Object dependentSFSB, Object proxy)
          Keep track of which proxies have gotten EJB objects out of a context
protected  void destroyStatefulSessionBeanInstance(T proxyInstance, Object ejbInstance)
          Called when we must ask the container to remove a specific
 List<Class<?>> getBusinessLocalInterfaces()
          Subclasses must override this to return local interfaces.
 Object getDependentSFSBForProxy(Object proxy)
           
 String getEjbName()
          Subclasses must override this to return ejb name
 SessionBeanType getEjbType()
          Gets ejb session type.
 List<Method> getRemoveMethods()
          Subclasses can override this.
 boolean isPassivationCapable()
           
 boolean needsBeanLocalViewAddedToTypes()
           
 void removeDependentSFSB(Object proxy)
          Call after observing an @Remove method on an EJB instance
 
Methods inherited from class org.apache.webbeans.component.InjectionTargetBean
getAnnotatedType, getInjectionTarget, getProducer
 
Methods inherited from class org.apache.webbeans.component.AbstractOwbBean
create, destroy, getBeanClass, getId, getInjectionPoints, getLogger, getReturnType, getWebBeansContext, getWebBeansType, isAlternative, isDependent, isEnabled, isSpecializedBean, setEnabled, setSpecializedBean, toString
 
Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl
getName, getQualifiers, getScope, getStereotypes, getTypes, isNullable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.enterprise.inject.spi.Bean
getName, getQualifiers, getScope, getStereotypes, getTypes, isNullable
 

Field Detail

OBJECT_EMPTY

public static final Object[] OBJECT_EMPTY

ejbType

protected final SessionBeanType ejbType
Session bean type

Constructor Detail

BaseEjbBean

protected BaseEjbBean(WebBeansContext webBeansContext,
                      SessionBeanType type,
                      AnnotatedType<T> annotatedType,
                      BeanAttributes<T> beanAttributes,
                      Class<T> beanClass,
                      InjectionTargetFactoryImpl<T> factory)
Creates a new instance of the session bean.

Parameters:
webBeansContext -

BaseEjbBean

protected BaseEjbBean(WebBeansContext webBeansContext,
                      SessionBeanType type,
                      AnnotatedType<T> annotatedType,
                      BeanAttributesImpl<T> beanAttributes,
                      Class<T> beanClass)
Method Detail

isPassivationCapable

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

destroyStatefulSessionBeanInstance

protected void destroyStatefulSessionBeanInstance(T proxyInstance,
                                                  Object ejbInstance)
Called when we must ask the container to remove a specific

Parameters:
proxyInstance - The contextual reference
ejbInstance - The underlying EJB instance to be removed

getRemoveMethods

public List<Method> getRemoveMethods()
Subclasses can override this.

Returns:
remove methods

getBusinessLocalInterfaces

public List<Class<?>> getBusinessLocalInterfaces()
Subclasses must override this to return local interfaces.

Returns:
local business interfaces.

getEjbName

public String getEjbName()
Subclasses must override this to return ejb name

Returns:
ejb name

getEjbType

public SessionBeanType getEjbType()
Gets ejb session type.

Returns:
type of the ejb

addDependentSFSB

public void addDependentSFSB(Object dependentSFSB,
                             Object proxy)
Keep track of which proxies have gotten EJB objects out of a context

Parameters:
dependentSFSB - The dependent SFSB acquired from the EJB container
proxy - The OWB proxy instance whose method handler acquired the dependnet SFSB

removeDependentSFSB

public void removeDependentSFSB(Object proxy)
Call after observing an @Remove method on an EJB instance

Parameters:
proxy - the proxy instance the dependent SFSB is associated with

getDependentSFSBForProxy

public Object getDependentSFSBForProxy(Object proxy)
Parameters:
proxy - an instance of our own proxy
Returns:
the underlying EJB instance associated with the proxy

needsBeanLocalViewAddedToTypes

public boolean needsBeanLocalViewAddedToTypes()
Returns:
true if the bean supports a no-interface (bean-class) local view but the container does not return it in the list of business local interfaces.


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.