org.multiverse.instrumentation
Class PreventReinstrumentationInstrumentationPhase

java.lang.Object
  extended by org.multiverse.instrumentation.AbstractInstrumentationPhase
      extended by org.multiverse.instrumentation.PreventReinstrumentationInstrumentationPhase
All Implemented Interfaces:
InstrumentationPhase

public class PreventReinstrumentationInstrumentationPhase
extends AbstractInstrumentationPhase

A control flow InstrumentationPhase responsible for preventing that a class already has been instrumented:

  1. If the class already is instrumented, it checks if the compiler name and version match. If not, an error is thrown. Multiverse compilation is not backwards compatible yet.
  2. InstrumentationStamp with a instrumentorName and instrumentorVersion based on the provided compiler. So next time this class is going to be re-instrumented, the multiverse instrumentation is skipped or an error is thrown if the instrumentorName/instrumentorVersion don't match.

Author:
Peter Veentjer

Constructor Summary
PreventReinstrumentationInstrumentationPhase(Instrumentor instrumentor)
          Creates a new PreventReinstrumentationInstrumentationPhase.
 
Method Summary
protected  Clazz doInstrument(Environment environment, Clazz originalClazz)
           
 
Methods inherited from class org.multiverse.instrumentation.AbstractInstrumentationPhase
doInit, getName, instrument, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreventReinstrumentationInstrumentationPhase

public PreventReinstrumentationInstrumentationPhase(Instrumentor instrumentor)
Creates a new PreventReinstrumentationInstrumentationPhase.

Parameters:
instrumentor - the Instrumentor that is going to compile the classes.
Throws:
java.lang.NullPointerException - if instrumentor is null.
Method Detail

doInstrument

protected Clazz doInstrument(Environment environment,
                             Clazz originalClazz)
Specified by:
doInstrument in class AbstractInstrumentationPhase


Copyright © 2008-2010 Multiverse. All Rights Reserved.