|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.verifier.strategy.AbstractVerifier
Abstract superclass for verifiers containing a bunch of useful methods.
20020210: luke
20020404: jwalters
20020404: luke
VerificationStrategy
Field Summary | |
static String |
BEAN_MANAGED_TX
|
protected ClassLoader |
classloader
The application classloader. |
static String |
CONTAINER_MANAGED_TX
|
protected static String |
CREATE_METHOD
|
protected static String |
EJB_CREATE_METHOD
|
protected static String |
EJB_HOME_INTERFACE
|
protected static String |
EJB_HOME_METHOD
|
protected static String |
EJB_LOCAL_HOME_INTERFACE
|
protected static String |
EJB_LOCAL_OBJECT_INTERFACE
|
protected static String |
EJB_OBJECT_INTERFACE
|
protected static String |
EJB_REMOVE_METHOD
|
protected static String |
EJB_SELECT_METHOD
|
static String |
STATEFUL_SESSION
|
static String |
STATELESS_SESSION
|
Constructor Summary | |
AbstractVerifier(VerificationContext context,
VerificationEventFactory factory)
|
Method Summary | |
void |
checkMessageBean(MessageDrivenMetaData 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 |
fireBeanVerifiedEvent(BeanMetaData bean,
String msg)
|
protected void |
fireSpecViolationEvent(BeanMetaData bean,
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. |
Iterator |
getCreateMethods(Class c)
Return all create methods of a class |
Method |
getDefaultCreateMethod(Class c)
|
Iterator |
getEJBCreateMethods(Class c)
Returns the ejbCreate(...) methods of a bean |
Method |
getEJBFindByPrimaryKey(Class c)
Returns the ejbFindByPrimaryKey method |
Iterator |
getEJBFindMethods(Class c)
returns the ejbFind |
Iterator |
getFinderMethods(Class home)
returns the finder methods of a home interface |
Method |
getMatchingEJBCreate(Class bean,
Method create)
|
Method |
getMatchingEJBFind(Class bean,
Method finder)
|
Method |
getMatchingEJBPostCreate(Class bean,
Method create)
|
Iterator |
getOnMessageMethods(Class c)
Returns the onMessage(...) method of a bean |
boolean |
hasANonStaticField(Class c)
Checks for at least one non-static field. |
boolean |
hasCreateMethod(Class c)
Searches for an instance of a public create method from the class |
boolean |
hasDefaultConstructor(Class c)
Checks if a class has a default (no args) constructor |
boolean |
hasDefaultCreateMethod(Class home)
Searches the class or interface, and its superclass or superinterface for a create() method that takes no arguments |
boolean |
hasEJBCreateMethod(Class c,
boolean isSession)
Searches for an instance of a public ejbCreate method from the class |
boolean |
hasEJBFindByPrimaryKey(Class c)
checks if the class has an ejbFindByPrimaryKey method |
boolean |
hasEJBHomeInterface(Class c)
Finds javax.ejb.EJBHome interface from the class or its superclasses |
boolean |
hasEJBLocalHomeInterface(Class c)
Finds javax.ejb.EJBLocalHome interface from the class or its superclasses |
boolean |
hasEJBLocalObjectInterface(Class c)
Finds java.ejb.EJBLocalObject interface from the class |
boolean |
hasEJBObjectInterface(Class c)
Finds java.ejb.EJBObject interface from the class |
boolean |
hasEntityBeanInterface(Class c)
Finds java.ejb.EntityBean interface from the class |
boolean |
hasFinalizer(Class c)
Checks of the class defines a finalize() method |
boolean |
hasFinderMethod(Class c)
check if a class has one or more finder methods |
boolean |
hasLegalRMIIIOPArguments(Method method)
|
boolean |
hasLegalRMIIIOPExceptionTypes(Method method)
|
boolean |
hasLegalRMIIIOPReturnType(Method method)
|
boolean |
hasLocalReturnType(BeanMetaData bean,
Method m)
checks the return type of method matches the bean's local interface |
boolean |
hasMatchingEJBCreate(Class bean,
Method create)
|
boolean |
hasMatchingEJBFind(Class bean,
Method finder)
|
boolean |
hasMatchingEJBHome(Class bean,
Method home)
|
boolean |
hasMatchingEJBPostCreate(Class bean,
Method create)
Check whether a bean has a matching ejbPostCreate methods for a given ejbCreate method |
boolean |
hasMatchingExceptions(Method source,
Method target)
Check whether two given methods declare the same Exceptions |
boolean |
hasMatchingMethod(Class bean,
Method method)
Check if a class (or its superclasses) declare a given method |
boolean |
hasMatchingReturnType(Method a,
Method b)
Check whether two methods have the same return type |
boolean |
hasMessageDrivenBeanInterface(Class c)
Finds java.ejb.MessageDrivenBean interface from the class |
boolean |
hasMessageListenerInterface(Class c)
Finds javax.jms.MessageListener interface from the class |
boolean |
hasMoreThanOneCreateMethods(Class c)
Check whether a class has more than one create method |
boolean |
hasNoArguments(Method method)
checks if the method accepts any parameters. |
boolean |
hasOnMessageMethod(Class c)
Searches for an instance of a public onMessage method from the class |
boolean |
hasPrimaryKeyReturnType(EntityMetaData entity,
Method m)
checks the return type of method matches the entity's primary key class or is a super class of the primary key class |
boolean |
hasRemoteReturnType(BeanMetaData bean,
Method m)
checks the return type of method matches the bean's remote interface |
boolean |
hasSessionBeanInterface(Class c)
Finds java.ejb.SessionBean interface from the class |
boolean |
hasSessionSynchronizationInterface(Class c)
Finds javax.ejb.SessionSynchronization interface from the class |
boolean |
hasSingleArgument(Method method,
Class argClass)
checks if the method accepts a single parameter of a specified type. |
boolean |
hasVoidReturnType(Method method)
checks if a method has a void return type |
boolean |
isAbstract(Class c)
checks if the given class is declared as abstract |
boolean |
isAbstract(Method m)
checks if the given method is declared as abstract |
boolean |
isAllFieldsPublic(Class c)
Checks whether all the fields in the class are declared as public. |
boolean |
isAssignableFrom(Class clazz,
String assignableFromClassName)
|
boolean |
isAssignableFrom(String className,
Class assignableFromClass)
|
abstract boolean |
isCreateMethod(Method m)
|
abstract boolean |
isEjbCreateMethod(Method m)
|
boolean |
isFinal(Class c)
checks if the given class is declared as final |
boolean |
isFinal(Member member)
checks if a class's member (method, constructor or field) has a final modifier. |
boolean |
isFinderMethod(Method m)
Check if this is a finder method |
boolean |
isMultiObjectFinder(Method f)
checks if finder method returns either Collection or Enumeration |
boolean |
isOnMessageMethod(Method m)
Check if the given message is the onMessage() method |
boolean |
isPublic(Class c)
checks if the given class is declared as public |
boolean |
isPublic(Member member)
checks if a class's member (method, constructor or field) has a public modifier. |
protected boolean |
isRMIIDLValueType(Class type)
|
protected boolean |
isRMIIIOPType(Class type)
|
boolean |
isSingleObjectFinder(EntityMetaData entity,
Method finder)
checks if finder returns the primary key type |
boolean |
isStatic(Class c)
checks if the given class is declared as static (inner classes only) |
boolean |
isStatic(Member member)
checks if a class's member (method, constructor or field) has a static modifier. |
boolean |
throwsCreateException(Method method)
checks if the method includes java.ejb.CreateException in its throws clause. |
boolean |
throwsFinderException(Method method)
checks if the methods includes javax.ejb.FinderException in its throws clause. |
boolean |
throwsNoException(Method method)
checks if the method throws no checked exceptions in its throws clause. |
boolean |
throwsRemoteException(Method method)
Checks if the method includes java.rmi.RemoteException or its subclass in its throws clause. |
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 |
protected static final String EJB_OBJECT_INTERFACE
protected static final String EJB_HOME_INTERFACE
protected static final String EJB_LOCAL_OBJECT_INTERFACE
protected static final String EJB_LOCAL_HOME_INTERFACE
protected ClassLoader classloader
VerificationContext.getClassLoader()
method, or
constructed by this object by creating a classloader to the URL
returned by VerificationContext.getJarLocation()
method. Initialized in the constructor.
public static final String BEAN_MANAGED_TX
public static final String CONTAINER_MANAGED_TX
public static final String STATEFUL_SESSION
public static final String STATELESS_SESSION
protected static final String EJB_CREATE_METHOD
protected static final String EJB_REMOVE_METHOD
protected static final String CREATE_METHOD
protected static final String EJB_HOME_METHOD
protected static final String EJB_SELECT_METHOD
Constructor Detail |
public AbstractVerifier(VerificationContext context, VerificationEventFactory factory)
Method Detail |
public boolean isAssignableFrom(String className, Class assignableFromClass)
public boolean isAssignableFrom(Class clazz, String assignableFromClassName)
public abstract boolean isCreateMethod(Method m)
public abstract boolean isEjbCreateMethod(Method m)
public boolean hasLegalRMIIIOPArguments(Method method)
public boolean hasLegalRMIIIOPReturnType(Method method)
public boolean hasLegalRMIIIOPExceptionTypes(Method method)
public boolean throwsRemoteException(Method method)
public boolean hasSingleArgument(Method method, Class argClass)
public boolean hasNoArguments(Method method)
public boolean throwsNoException(Method method)
public boolean throwsCreateException(Method method)
public boolean throwsFinderException(Method method)
public boolean isStatic(Member member)
static
modifier.
public boolean isStatic(Class c)
public boolean isFinal(Member member)
final
modifier.
public boolean isFinal(Class c)
public boolean isPublic(Member member)
public
modifier.
public boolean isPublic(Class c)
public
public boolean isAllFieldsPublic(Class c)
public boolean isAbstract(Class c)
public boolean isAbstract(Method m)
public boolean isSingleObjectFinder(EntityMetaData entity, Method finder)
public boolean isMultiObjectFinder(Method f)
public boolean hasRemoteReturnType(BeanMetaData bean, Method m)
public boolean hasLocalReturnType(BeanMetaData bean, Method m)
public boolean hasVoidReturnType(Method method)
public boolean hasMessageDrivenBeanInterface(Class c)
public boolean hasMessageListenerInterface(Class c)
public boolean hasSessionBeanInterface(Class c)
public boolean hasEntityBeanInterface(Class c)
public boolean hasEJBObjectInterface(Class c)
public boolean hasEJBLocalObjectInterface(Class c)
public boolean hasEJBHomeInterface(Class c)
public boolean hasEJBLocalHomeInterface(Class c)
public boolean hasSessionSynchronizationInterface(Class c)
public boolean hasDefaultConstructor(Class c)
public boolean hasFinalizer(Class c)
public boolean hasFinderMethod(Class c)
public boolean isFinderMethod(Method m)
public boolean isOnMessageMethod(Method m)
public boolean hasANonStaticField(Class c)
public boolean hasOnMessageMethod(Class c)
public boolean hasCreateMethod(Class c)
public boolean hasEJBCreateMethod(Class c, boolean isSession)
public boolean hasDefaultCreateMethod(Class home)
public boolean hasEJBFindByPrimaryKey(Class c)
public boolean hasPrimaryKeyReturnType(EntityMetaData entity, Method m)
public Method getDefaultCreateMethod(Class c)
null
if none is foundpublic Method getEJBFindByPrimaryKey(Class c)
public Iterator getEJBFindMethods(Class c)
public Iterator getFinderMethods(Class home)
public Iterator getOnMessageMethods(Class c)
public Iterator getEJBCreateMethods(Class c)
public Iterator getCreateMethods(Class c)
public boolean hasMoreThanOneCreateMethods(Class c)
public boolean hasMatchingExceptions(Method source, Method target)
public boolean hasMatchingMethod(Class bean, Method method)
public boolean hasMatchingReturnType(Method a, Method b)
public boolean hasMatchingEJBPostCreate(Class bean, Method create)
public boolean hasMatchingEJBCreate(Class bean, Method create)
public Method getMatchingEJBPostCreate(Class bean, Method create)
public Method getMatchingEJBCreate(Class bean, Method create)
public boolean hasMatchingEJBFind(Class bean, Method finder)
public Method getMatchingEJBFind(Class bean, Method finder)
public boolean hasMatchingEJBHome(Class bean, Method home)
protected void fireSpecViolationEvent(BeanMetaData bean, Section section)
protected void fireSpecViolationEvent(BeanMetaData bean, Method method, Section section)
protected final void fireBeanVerifiedEvent(BeanMetaData bean)
protected final void fireBeanVerifiedEvent(BeanMetaData bean, String msg)
public void checkMessageBean(MessageDrivenMetaData bean)
checkMessageBean
in interface VerificationStrategy
public org.gjt.lindfors.pattern.StrategyContext getContext()
getContext
in interface org.gjt.lindfors.pattern.Strategy
protected boolean isRMIIIOPType(Class type)
protected boolean isRMIIDLValueType(Class type)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |