net.sf.staccatocommons.instrument.internal
Class InstrumenterImpl

java.lang.Object
  extended by net.sf.staccatocommons.instrument.internal.InstrumenterImpl
All Implemented Interfaces:
InstrumenterConfiguration, Instrumenter

public class InstrumenterImpl
extends Object
implements InstrumenterConfiguration, Instrumenter

Author:
flbulgarelli

Constructor Summary
InstrumenterImpl(javassist.ClassPool classPool)
          Creates a new InstrumenterImpl
 
Method Summary
 InstrumenterConfiguration addAnnotationHanlder(AnnotationHandler handler)
          Register an annotation handler to this instrumenter that will be notified to process an annotation each time one of the type returned by AnnotationHandler.getSupportedAnnotationType() is found.
 void ensureConfigured()
          Ensures that at least a handler has being registered, and the instrumentation mark was set
 void instrumentClass(javassist.CtClass clazz)
           
 InstrumenterConfiguration setInstrumentationMark(InstrumentationMark instrumentationMark)
          Sets the instrumentation mark this instrumenter will print in the instrumented classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumenterImpl

public InstrumenterImpl(javassist.ClassPool classPool)
Creates a new InstrumenterImpl

Parameters:
classPool -
processors -
Method Detail

setInstrumentationMark

public InstrumenterConfiguration setInstrumentationMark(InstrumentationMark instrumentationMark)
Description copied from interface: InstrumenterConfiguration
Sets the instrumentation mark this instrumenter will print in the instrumented classes. This message must be sent at least once from inside InstrumenterConfigurer.configureInstrumenter(InstrumenterConfiguration) , and should be sent at most once from inside it.

Specified by:
setInstrumentationMark in interface InstrumenterConfiguration
Parameters:
instrumentationMark - the instrumentationMark to set
Returns:
this

addAnnotationHanlder

public InstrumenterConfiguration addAnnotationHanlder(AnnotationHandler handler)
Description copied from interface: InstrumenterConfiguration
Register an annotation handler to this instrumenter that will be notified to process an annotation each time one of the type returned by AnnotationHandler.getSupportedAnnotationType() is found. If more than one AnnotationHandler that supports a certain annotation type is registered, the instrumenter will notify all those handlers when an annotation of such type is found, in the order they have being registered. This message must be sent at least once from inside InstrumenterConfigurer.configureInstrumenter(InstrumenterConfiguration)

Specified by:
addAnnotationHanlder in interface InstrumenterConfiguration
Parameters:
handler - the handler to register
Returns:
this in order to allow method chaining

ensureConfigured

public void ensureConfigured()
Ensures that at least a handler has being registered, and the instrumentation mark was set


instrumentClass

public void instrumentClass(javassist.CtClass clazz)
                     throws javassist.CannotCompileException,
                            ClassNotFoundException
Specified by:
instrumentClass in interface Instrumenter
Parameters:
clazz -
Throws:
ClassNotFoundException
javassist.CannotCompileException


Copyright © 2010-2012 Staccatocommons. All Rights Reserved.