org.eclipse.actf.validation.javapp.aspects
Class BaseValidationAspect

java.lang.Object
  extended by org.eclipse.actf.validation.javapp.aspects.BaseValidationAspect
Direct Known Subclasses:
InterJvmValidationAspect

public abstract class BaseValidationAspect
extends Object

base class for all aspects in ACTF. Direct subclasses of this class should be extended by clients writing their own aspects.

Author:
Mike Squillace

Field Summary
protected  IModel model
           
protected  IConfiguration valConfig
           
 
Constructor Summary
BaseValidationAspect(String modelName)
          instantiated by AOP engine
 
Method Summary
protected  void cacheCreationContext(Object newObj, Object member, Exception exception)
           
protected  CreationContext[] findCreationContexts(ValidationReportRecord[] records)
          find the creation contexts for the given records.
protected  String getObjectId(Object obj)
          forms and caches the creation context for an instantiated element.
protected  boolean isIgnorable(StackTraceElement element)
          returns whether or not this trace element should be included in the stack trace used to form the creation context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valConfig

protected IConfiguration valConfig

model

protected IModel model
Constructor Detail

BaseValidationAspect

public BaseValidationAspect(String modelName)
instantiated by AOP engine

Method Detail

getObjectId

protected String getObjectId(Object obj)
forms and caches the creation context for an instantiated element. The context can be retrieved later via the object id, which is System.identityHashCode(newObj). This method also forces the server to fire a creationContextStarted event.

Parameters:
newObj - - newly instantiated object
member - - member used to instantiated object
exception - - exception holding trace leading to instantiation

cacheCreationContext

protected void cacheCreationContext(Object newObj,
                                    Object member,
                                    Exception exception)

isIgnorable

protected boolean isIgnorable(StackTraceElement element)
returns whether or not this trace element should be included in the stack trace used to form the creation context. By default, stack trace elements involving ACTF classes or classes found in an AOP engine are not included in the stack trace.

Parameters:
element - - stack trace element to be tested
Returns:
true if element can be left out of stack trace

findCreationContexts

protected CreationContext[] findCreationContexts(ValidationReportRecord[] records)
find the creation contexts for the given records.

Parameters:
records - - report records