## org.jboss.verifier.strategy
Class AbstractVerifier

    java.lang.Object
      |
      +--org.jboss.verifier.strategy.AbstractVerifier

All Implemented Interfaces:
  org.gjt.lindfors.pattern.Strategy, VerificationStrategy

Direct Known Subclasses:
  EJBVerifier11, EJBVerifier20

public abstract class AbstractVerifier
extends java.lang.Object
implements VerificationStrategy

Abstract superclass for verifiers containing a bunch of useful methods. For more detailed documentation, refer to the >

Since:
  JDK 1.3
Version:
  $Revision: 1.18.4.2 $
Author:
  Juha Lindfors (jplindfo@helsinki.fi), Aaron Mulder (ammulder@alumni.princeton.edu), Vinay Menon (menonv@cpw.co.uk), Andreas Schaefer

  Revisions:

  20011101: Andy

  - Changed the throwRemoteException() method to check accordingly to the RMI spec.
See Also:
  `VerificationStrategy`

Field Summary
`static java.lang.String` `BEAN_MANAGED_TX`
`protected java.lang.ClassLoader` `classloader` The application classloader.
`static java.lang.String` `CONTAINER_MANAGED_TX`
`protected static java.lang.String` `EJB_HOME_INTERFACE`
`protected static java.lang.String` `EJB_OBJECT_INTERFACE`
`static java.lang.String` `STATEFUL_SESSION`
`static java.lang.String` `STATELESS_SESSION`

Constructor Summary
`AbstractVerifier(VerificationContext context, VerificationEventFactory factory)`

Method Summary
`void` `checkMessageBean(BeanMetaData bean)` Provides an empty default implementation for EJB 1.1 verifier (message beans are for EJB 2.0 and greater only).
`protected void` `fireBeanVerifiedEvent(BeanMetaData bean)`
`protected void` `fireSpecViolationEvent(BeanMetaData bean, java.lang.reflect.Method method, Section section)`
`protected void` `fireSpecViolationEvent(BeanMetaData bean, Section section)`
`org.gjt.lindfors.pattern.StrategyContext` `getContext()` Returns the context object reference for this strategy implementation.
`java.util.Iterator` `getCreateMethods(java.lang.Class c)`
`java.lang.reflect.Method` `getDefaultCreateMethod(java.lang.Class c)`
`java.util.Iterator` `getEJBCreateMethods(java.lang.Class c)`
`java.lang.reflect.Method` `getEJBFindByPrimaryKey(java.lang.Class c)`
`java.util.Iterator` `getEJBFindMethods(java.lang.Class c)`
`java.util.Iterator` `getFinderMethods(java.lang.Class home)`
`java.lang.reflect.Method` `getMatchingEJBCreate(java.lang.Class bean, java.lang.reflect.Method create)`
`java.lang.reflect.Method` `getMatchingEJBFind(java.lang.Class bean, java.lang.reflect.Method finder)`
`java.lang.reflect.Method` `getMatchingEJBPostCreate(java.lang.Class bean, java.lang.reflect.Method ejbCreate)`
`boolean` `hasANonStaticField(java.lang.Class c)` Checks for at least one non-static field.
`boolean` `hasCreateMethod(java.lang.Class c)`
`boolean` `hasDefaultConstructor(java.lang.Class c)`
`boolean` `hasDefaultCreateMethod(java.lang.Class home)`
`boolean` `hasEJBCreateMethod(java.lang.Class c, boolean isSession)`
`boolean` `hasEJBFindByPrimaryKey(java.lang.Class c)`
`boolean` `hasEJBHomeInterface(java.lang.Class c)`
`boolean` `hasEJBObjectInterface(java.lang.Class c)`
`boolean` `hasEntityBeanInterface(java.lang.Class c)`
`boolean` `hasFinalizer(java.lang.Class c)`
`boolean` `hasFinderMethod(java.lang.Class c)`
`boolean` `hasLegalRMIIIOPArguments(java.lang.reflect.Method method)`
`boolean` `hasLegalRMIIIOPExceptionTypes(java.lang.reflect.Method method)`
`boolean` `hasLegalRMIIIOPReturnType(java.lang.reflect.Method method)`
`boolean` `hasMatchingEJBCreate(java.lang.Class bean, java.lang.reflect.Method create)`
`boolean` `hasMatchingEJBFind(java.lang.Class bean, java.lang.reflect.Method finder)`
`boolean` `hasMatchingEJBPostCreate(java.lang.Class bean, java.lang.reflect.Method ejbCreate)`
`boolean` `hasMatchingExceptions(java.lang.reflect.Method source, java.lang.reflect.Method target)`
`boolean` `hasMatchingMethod(java.lang.Class bean, java.lang.reflect.Method remote)`
`boolean` `hasMatchingReturnType(java.lang.reflect.Method a, java.lang.reflect.Method b)`
`boolean` `hasMoreThanOneCreateMethods(java.lang.Class c)`
`boolean` `hasPrimaryKeyReturnType(EntityMetaData entity, java.lang.reflect.Method m)`
`boolean` `hasRemoteReturnType(BeanMetaData bean, java.lang.reflect.Method m)`
`boolean` `hasSessionBeanInterface(java.lang.Class c)`
`boolean` `hasSessionSynchronizationInterface(java.lang.Class c)`
`boolean` `hasVoidReturnType(java.lang.reflect.Method method)`
`boolean` `isAbstract(java.lang.Class c)`
`boolean` `isAllFieldsPublic(java.lang.Class c)` Checks whether all the fields in the class are declared as public.
`boolean` `isCreateMethod(java.lang.reflect.Method m)`
`boolean` `isFinal(java.lang.Class c)`
`boolean` `isFinal(java.lang.reflect.Member member)`
`boolean` `isFinderMethod(java.lang.reflect.Method m)`
`boolean` `isMultiObjectFinder(java.lang.reflect.Method finder)`
`boolean` `isPublic(java.lang.Class c)`
`boolean` `isPublic(java.lang.reflect.Member member)`
`boolean` `isSingleObjectFinder(EntityMetaData entity, java.lang.reflect.Method finder)`
`boolean` `isStatic(java.lang.Class c)`
`boolean` `isStatic(java.lang.reflect.Member member)`
`boolean` `throwsCreateException(java.lang.reflect.Method method)`
`boolean` `throwsFinderException(java.lang.reflect.Method method)`
`boolean` `throwsRemoteException(java.lang.reflect.Method method)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.jboss.verifier.strategy.VerificationStrategy
`checkEntity, checkSession`

Field Detail

### EJB_OBJECT_INTERFACE

    protected static final java.lang.String EJB_OBJECT_INTERFACE

### EJB_HOME_INTERFACE

    protected static final java.lang.String EJB_HOME_INTERFACE

### classloader

    protected java.lang.ClassLoader classloader

  The application classloader. This can be provided by the context directly via `VerificationContext.getClassLoader()` method, or constructed by this object by creating a classloader to the URL returned by `VerificationContext.getJarLocation()` method.

  Initialized in the constructor.

### BEAN_MANAGED_TX

    public static final java.lang.String BEAN_MANAGED_TX

### CONTAINER_MANAGED_TX

    public static final java.lang.String CONTAINER_MANAGED_TX

### STATEFUL_SESSION

    public static final java.lang.String STATEFUL_SESSION

### STATELESS_SESSION

    public static final java.lang.String STATELESS_SESSION

Constructor Detail

### AbstractVerifier

    public AbstractVerifier(VerificationContext context,
                            VerificationEventFactory factory)

Method Detail

### hasLegalRMIIIOPArguments

    public boolean hasLegalRMIIIOPArguments(java.lang.reflect.Method method)

### hasLegalRMIIIOPReturnType

    public boolean hasLegalRMIIIOPReturnType(java.lang.reflect.Method method)

### hasLegalRMIIIOPExceptionTypes

    public boolean hasLegalRMIIIOPExceptionTypes(java.lang.reflect.Method method)

### throwsRemoteException

    public boolean throwsRemoteException(java.lang.reflect.Method method)

### throwsCreateException

    public boolean throwsCreateException(java.lang.reflect.Method method)

### throwsFinderException

    public boolean throwsFinderException(java.lang.reflect.Method method)

### isStatic

    public boolean isStatic(java.lang.reflect.Member member)

### isStatic

    public boolean isStatic(java.lang.Class c)

### isFinal

    public boolean isFinal(java.lang.reflect.Member member)

### isFinal

    public boolean isFinal(java.lang.Class c)

### isPublic

    public boolean isPublic(java.lang.reflect.Member member)

### isPublic

    public boolean isPublic(java.lang.Class c)

### isAllFieldsPublic

    public boolean isAllFieldsPublic(java.lang.Class c)

  Checks whether all the fields in the class are declared as public.

### isAbstract

    public boolean isAbstract(java.lang.Class c)

### isSingleObjectFinder

    public boolean isSingleObjectFinder(EntityMetaData entity,
                                        java.lang.reflect.Method finder)

### isMultiObjectFinder

    public boolean isMultiObjectFinder(java.lang.reflect.Method finder)

### hasRemoteReturnType

    public boolean hasRemoteReturnType(BeanMetaData bean,
                                       java.lang.reflect.Method m)

### hasVoidReturnType

    public boolean hasVoidReturnType(java.lang.reflect.Method method)

### hasSessionBeanInterface

    public boolean hasSessionBeanInterface(java.lang.Class c)

### hasEntityBeanInterface

    public boolean hasEntityBeanInterface(java.lang.Class c)

### hasEJBObjectInterface

    public boolean hasEJBObjectInterface(java.lang.Class c)

### hasEJBHomeInterface

    public boolean hasEJBHomeInterface(java.lang.Class c)

### hasSessionSynchronizationInterface

    public boolean hasSessionSynchronizationInterface(java.lang.Class c)

### hasDefaultConstructor

    public boolean hasDefaultConstructor(java.lang.Class c)

### hasFinalizer

    public boolean hasFinalizer(java.lang.Class c)

### hasFinderMethod

    public boolean hasFinderMethod(java.lang.Class c)

### isFinderMethod

    public boolean isFinderMethod(java.lang.reflect.Method m)

### isCreateMethod

    public boolean isCreateMethod(java.lang.reflect.Method m)

### hasANonStaticField

    public boolean hasANonStaticField(java.lang.Class c)

  Checks for at least one non-static field.

### hasCreateMethod

    public boolean hasCreateMethod(java.lang.Class c)

### hasEJBCreateMethod

    public boolean hasEJBCreateMethod(java.lang.Class c,
                                      boolean isSession)

### hasDefaultCreateMethod

    public boolean hasDefaultCreateMethod(java.lang.Class home)

### hasEJBFindByPrimaryKey

    public boolean hasEJBFindByPrimaryKey(java.lang.Class c)

### hasPrimaryKeyReturnType

    public boolean hasPrimaryKeyReturnType(EntityMetaData entity,
                                           java.lang.reflect.Method m)

### getDefaultCreateMethod

    public java.lang.reflect.Method getDefaultCreateMethod(java.lang.Class c)

### getEJBFindByPrimaryKey

    public java.lang.reflect.Method getEJBFindByPrimaryKey(java.lang.Class c)

### getEJBFindMethods

    public java.util.Iterator getEJBFindMethods(java.lang.Class c)

### getFinderMethods

    public java.util.Iterator getFinderMethods(java.lang.Class home)

### getEJBCreateMethods

    public java.util.Iterator getEJBCreateMethods(java.lang.Class c)

### getCreateMethods

    public java.util.Iterator getCreateMethods(java.lang.Class c)

### hasMoreThanOneCreateMethods

    public boolean hasMoreThanOneCreateMethods(java.lang.Class c)

### hasMatchingExceptions

    public boolean hasMatchingExceptions(java.lang.reflect.Method source,
                                         java.lang.reflect.Method target)

### hasMatchingMethod

    public boolean hasMatchingMethod(java.lang.Class bean,
                                     java.lang.reflect.Method remote)

### hasMatchingReturnType

    public boolean hasMatchingReturnType(java.lang.reflect.Method a,
                                         java.lang.reflect.Method b)

### hasMatchingEJBPostCreate

    public boolean hasMatchingEJBPostCreate(java.lang.Class bean,
                                            java.lang.reflect.Method ejbCreate)

### hasMatchingEJBCreate

    public boolean hasMatchingEJBCreate(java.lang.Class bean,
                                        java.lang.reflect.Method create)

### getMatchingEJBPostCreate

    public java.lang.reflect.Method getMatchingEJBPostCreate(java.lang.Class bean,
                                                             java.lang.reflect.Method ejbCreate)

### getMatchingEJBCreate

    public java.lang.reflect.Method getMatchingEJBCreate(java.lang.Class bean,
                                                         java.lang.reflect.Method create)

### hasMatchingEJBFind

    public boolean hasMatchingEJBFind(java.lang.Class bean,
                                      java.lang.reflect.Method finder)

### getMatchingEJBFind

    public java.lang.reflect.Method getMatchingEJBFind(java.lang.Class bean,
                                                       java.lang.reflect.Method finder)

### fireSpecViolationEvent

    protected void fireSpecViolationEvent(BeanMetaData bean,
                                          Section section)

### fireSpecViolationEvent

    protected void fireSpecViolationEvent(BeanMetaData bean,
                                          java.lang.reflect.Method method,
                                          Section section)

### fireBeanVerifiedEvent

    protected void fireBeanVerifiedEvent(BeanMetaData bean)

### checkMessageBean

    public void checkMessageBean(BeanMetaData bean)

  Provides an empty default implementation for EJB 1.1 verifier (message beans are for EJB 2.0 and greater only).
  Specified by:
    `checkMessageBean` in interface `VerificationStrategy`
  Parameters:
    `beans` - the message bean to verify

### getContext

    public org.gjt.lindfors.pattern.StrategyContext getContext()

  Returns the context object reference for this strategy implementation.
  Specified by:
    `getContext` in interface `org.gjt.lindfors.pattern.Strategy`
  Returns:
    the client object using this algorithm implementation

Copyright © 2000 The JBoss Organization. All Rights Reserved.