org.objectweb.easybeans.deployment.annotations.helper.bean.session.checks
Class InterceptorsValidator

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

public final class InterceptorsValidator
extends java.lang.Object

This class ensures that the interceptors have the correct signature.

Author:
Florent Benoit

Field Summary
private static java.lang.String AROUND_INVOKE_DESCRIPTOR_EJB
          Signature for an AroundInvoke interceptor (InvocationContext).
private static java.lang.String AROUND_INVOKE_EXCEPTION
          Exception required in AroundInvoke interceptor.
private static java.lang.String CONSTRUCTOR_METHOD
          Default constructor method's name.
private static java.lang.String DEFAULT_CONSTRUCTOR_DESCRIPTOR
          Constructor without args.
private static java.lang.String LIFECYCLE_DESCRIPTOR_BEAN
          Signature for a lifecycle interceptor inside the bean (void type).
private static java.lang.String LIFECYCLE_DESCRIPTOR_OUTSIDEBEAN
          Signature for a lifecycle interceptor inside the bean (void type).
 
Constructor Summary
private InterceptorsValidator()
          Helper class, no public constructor.
 
Method Summary
private static void analyzeInterceptorClass(EjbJarAnnotationMetadata ejbMetaData, java.lang.String className)
          Analyze an interceptor class and check the interceptors method.
private static void ensureNoAccess(int acc, JMethod jMethod, java.lang.String desc, java.lang.String className)
          Validate that a given method don't use a given access mode.
static void validate(ClassAnnotationMetadata bean)
          Validate a bean.
private static void validateJMethod(JMethod jMethod, java.lang.String desc, java.lang.String awaitedException, java.lang.String className)
          Validate the given method with the given signature/exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AROUND_INVOKE_DESCRIPTOR_EJB

private static final java.lang.String AROUND_INVOKE_DESCRIPTOR_EJB
Signature for an AroundInvoke interceptor (InvocationContext).

See Also:
Constant Field Values

LIFECYCLE_DESCRIPTOR_OUTSIDEBEAN

private static final java.lang.String LIFECYCLE_DESCRIPTOR_OUTSIDEBEAN
Signature for a lifecycle interceptor inside the bean (void type).

See Also:
Constant Field Values

LIFECYCLE_DESCRIPTOR_BEAN

private static final java.lang.String LIFECYCLE_DESCRIPTOR_BEAN
Signature for a lifecycle interceptor inside the bean (void type).

See Also:
Constant Field Values

AROUND_INVOKE_EXCEPTION

private static final java.lang.String AROUND_INVOKE_EXCEPTION
Exception required in AroundInvoke interceptor.

See Also:
Constant Field Values

DEFAULT_CONSTRUCTOR_DESCRIPTOR

private static final java.lang.String DEFAULT_CONSTRUCTOR_DESCRIPTOR
Constructor without args.

See Also:
Constant Field Values

CONSTRUCTOR_METHOD

private static final java.lang.String CONSTRUCTOR_METHOD
Default constructor method's name.

See Also:
Constant Field Values
Constructor Detail

InterceptorsValidator

private InterceptorsValidator()
Helper class, no public constructor.

Method Detail

validate

public static void validate(ClassAnnotationMetadata bean)
Validate a bean.

Parameters:
bean - bean to validate.

analyzeInterceptorClass

private static void analyzeInterceptorClass(EjbJarAnnotationMetadata ejbMetaData,
                                            java.lang.String className)
Analyze an interceptor class and check the interceptors method.

Parameters:
ejbMetaData - root metadata used to extract class metadata
className - the name of the class being analyzed

ensureNoAccess

private static void ensureNoAccess(int acc,
                                   JMethod jMethod,
                                   java.lang.String desc,
                                   java.lang.String className)
Validate that a given method don't use a given access mode.

Parameters:
acc - the access mode to refuse.
jMethod - method to check.
desc - the description of the access.
className - the name of the class of the given method.

validateJMethod

private static void validateJMethod(JMethod jMethod,
                                    java.lang.String desc,
                                    java.lang.String awaitedException,
                                    java.lang.String className)
Validate the given method with the given signature/exceptions.

Parameters:
jMethod - method to check.
desc - signature to ensure.
awaitedException - exception to ensure.
className - the name of the class of the given method.