org.objectweb.easybeans.deployment.annotations.helper.bean.session
Class SessionBeanInterface

java.lang.Object
  extended by org.objectweb.easybeans.deployment.annotations.helper.bean.session.SessionBeanInterface

public final class SessionBeanInterface
extends java.lang.Object

This class analyze interfaces of the session bean. If the session bean implements javax.ejb.SessionBean interface, add lifecycle callbacks and add resource injection for setSessionContext method.

Author:
Florent Benoit

Field Summary
private static JMethod EJBACTIVATE_METHOD
          ejbActivate() method.
private static JMethod EJBPASSIVATE_METHOD
          ejbPassivate() method.
private static JMethod EJBREMOVE_METHOD
          ejbRemove() method.
private static java.lang.String SESSION_BEAN_INTERFACE
          SessionBean interface.
private static JMethod SETSESSIONCONTEXT_METHOD
          setSessionContext() method.
 
Constructor Summary
private SessionBeanInterface()
          Helper class, no public constructor.
 
Method Summary
static java.util.List<java.lang.String> getAllInterfacesFromClass(ClassAnnotationMetadata sessionBean)
          Gets all interfaces used by a class.
private static MethodAnnotationMetadata getMethod(ClassAnnotationMetadata sessionBean, JMethod jMethod, boolean inherited)
          Gets method metadata on the given class metadata for the given method.
static void resolve(ClassAnnotationMetadata sessionBean)
          Try to see if bean implements javax.ejb.SessionBean interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_BEAN_INTERFACE

private static final java.lang.String SESSION_BEAN_INTERFACE
SessionBean interface.

See Also:
Constant Field Values

SETSESSIONCONTEXT_METHOD

private static final JMethod SETSESSIONCONTEXT_METHOD
setSessionContext() method.


EJBREMOVE_METHOD

private static final JMethod EJBREMOVE_METHOD
ejbRemove() method.


EJBACTIVATE_METHOD

private static final JMethod EJBACTIVATE_METHOD
ejbActivate() method.


EJBPASSIVATE_METHOD

private static final JMethod EJBPASSIVATE_METHOD
ejbPassivate() method.

Constructor Detail

SessionBeanInterface

private SessionBeanInterface()
Helper class, no public constructor.

Method Detail

resolve

public static void resolve(ClassAnnotationMetadata sessionBean)
Try to see if bean implements javax.ejb.SessionBean interface.

Parameters:
sessionBean - Session bean to analyze

getMethod

private static MethodAnnotationMetadata getMethod(ClassAnnotationMetadata sessionBean,
                                                  JMethod jMethod,
                                                  boolean inherited)
Gets method metadata on the given class metadata for the given method.

Parameters:
sessionBean - the class metadata on which retrieve the method
jMethod - the method to get
inherited - get the correct method in super class, not inherited
Returns:
the method metadata, else exception

getAllInterfacesFromClass

public static java.util.List<java.lang.String> getAllInterfacesFromClass(ClassAnnotationMetadata sessionBean)
Gets all interfaces used by a class.

Parameters:
sessionBean - the metadata to analyze.
Returns:
the list of interfaces from a given class.