Class BaseEjbBean<T>

  • All Implemented Interfaces:
    Serializable, javax.enterprise.context.spi.Contextual<T>, javax.enterprise.inject.spi.Bean<T>, javax.enterprise.inject.spi.BeanAttributes<T>, javax.enterprise.inject.spi.PassivationCapable, org.apache.webbeans.component.EnterpriseBeanMarker, org.apache.webbeans.component.OwbBean<T>

    public abstract class BaseEjbBean<T>
    extends org.apache.webbeans.component.InjectionTargetBean<T>
    implements org.apache.webbeans.component.EnterpriseBeanMarker
    Defines bean contract for the session beans.
    Version:
    $Rev$ $Date$
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.enterprise.inject.spi.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

      Constructors 
      Modifier Constructor Description
      protected BaseEjbBean​(org.apache.webbeans.config.WebBeansContext webBeansContext, javax.enterprise.inject.spi.SessionBeanType type, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes, Class<T> beanClass, org.apache.webbeans.container.InjectionTargetFactoryImpl<T> factory)
      Creates a new instance of the session bean.
      protected BaseEjbBean​(org.apache.webbeans.config.WebBeansContext webBeansContext, javax.enterprise.inject.spi.SessionBeanType type, javax.enterprise.inject.spi.AnnotatedType<T> annotatedType, org.apache.webbeans.component.BeanAttributesImpl<T> beanAttributes, Class<T> beanClass)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      javax.enterprise.inject.spi.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

        defineInterceptorsIfNeeded, getAnnotatedType, getInjectionTarget, getProducer, providedId
      • Methods inherited from class org.apache.webbeans.component.AbstractOwbBean

        addToStringInfo, create, destroy, equals, getBeanClass, getId, getInjectionPoints, getLogger, getReturnType, getWebBeansContext, getWebBeansType, hashCode, isDependent, isEnabled, isSpecializedBean, setEnabled, setSpecializedBean, toString
      • Methods inherited from class org.apache.webbeans.component.BeanAttributesImpl

        getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative, isNullable
      • Methods inherited from interface javax.enterprise.inject.spi.Bean

        isNullable
      • Methods inherited from interface javax.enterprise.inject.spi.BeanAttributes

        getName, getQualifiers, getScope, getStereotypes, getTypes, isAlternative
    • Field Detail

      • OBJECT_EMPTY

        public static final Object[] OBJECT_EMPTY
      • ejbType

        protected final javax.enterprise.inject.spi.SessionBeanType ejbType
        Session bean type
    • Constructor Detail

      • BaseEjbBean

        protected BaseEjbBean​(org.apache.webbeans.config.WebBeansContext webBeansContext,
                              javax.enterprise.inject.spi.SessionBeanType type,
                              javax.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                              javax.enterprise.inject.spi.BeanAttributes<T> beanAttributes,
                              Class<T> beanClass,
                              org.apache.webbeans.container.InjectionTargetFactoryImpl<T> factory)
        Creates a new instance of the session bean.
        Parameters:
        webBeansContext -
      • BaseEjbBean

        protected BaseEjbBean​(org.apache.webbeans.config.WebBeansContext webBeansContext,
                              javax.enterprise.inject.spi.SessionBeanType type,
                              javax.enterprise.inject.spi.AnnotatedType<T> annotatedType,
                              org.apache.webbeans.component.BeanAttributesImpl<T> beanAttributes,
                              Class<T> beanClass)
    • Method Detail

      • isPassivationCapable

        public boolean isPassivationCapable()
        Specified by:
        isPassivationCapable in interface org.apache.webbeans.component.EnterpriseBeanMarker
        Specified by:
        isPassivationCapable in interface org.apache.webbeans.component.OwbBean<T>
        Overrides:
        isPassivationCapable in class org.apache.webbeans.component.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 javax.enterprise.inject.spi.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.