net.grinder.util.weave
Interface Weaver

All Known Implementing Classes:
DCRWeaver

public interface Weaver

Something that can instrument classes.

Author:
Philip Aston

Nested Class Summary
static class Weaver.TargetSource
          Source of the target object that the weaving will pass on to the advice.
 
Method Summary
 void applyChanges()
          Apply pending weaving that has been requested with weave(java.lang.reflect.Constructor).
 String weave(Constructor<?> constructor)
          Queue the given constructor for weaving, and return a unique identifier that can be used by the advice to refer to the constructor pointcut.
 String weave(Method method, Weaver.TargetSource targetSource)
          Queue the given method for weaving, and return a unique identifier that can be used by the advice to refer to the method pointcut.
 

Method Detail

weave

String weave(Constructor<?> constructor)
Queue the given constructor for weaving, and return a unique identifier that can be used by the advice to refer to the constructor pointcut.

Once weave(java.lang.reflect.Constructor) has been called for a constructor, subsequent calls are no-ops that will return the identifier generated for the original call.

The instrumentation will not be applied to the code until applyChanges() is called.

Parameters:
constructor - The constructor.
Returns:
String that uniquely identifies the pointcut.

weave

String weave(Method method,
             Weaver.TargetSource targetSource)
             throws WeavingException
Queue the given method for weaving, and return a unique identifier that can be used by the advice to refer to the method pointcut.

Once weave(java.lang.reflect.Constructor) has been called for a method, subsequent calls are no-ops that will return the identifier generated for the original call.

The instrumentation will not be applied to the code until applyChanges() is called.

Parameters:
method - The method.
targetSource - Which object should be passed as the target to the advice.
Returns:
String that uniquely identifies the pointcut.
Throws:
WeavingException - If the targetSource is incompatible with the method.

applyChanges

void applyChanges()
                  throws WeavingException
Apply pending weaving that has been requested with weave(java.lang.reflect.Constructor).

Throws:
WeavingException - A problem occurred with the weaving.


Copyright © 2000-2013. All Rights Reserved.