| ch.ethz.prose.crosscut.Crosscut ch.ethz.prose.crosscut.AbstractCrosscut ch.ethz.prose.crosscut.MethodCut
All known Subclasses: ch.ethz.prose.crosscut.MethodRedefineCut,
MethodCut | abstract public class MethodCut extends AbstractCrosscut implements java.io.Serializable(Code) | | Class MethodCut represents a crosscut. Such a crosscut
defines a pattern (for matching specific join-points) and a method
to be executed. Users must subclass MethodCut .
There are two main modalities for subclassing:
The tipical way (normal user)
Define exactly one method (e.g., METHOD_ARGS(Bar thisO,Baz param1) ).
This method is both the advice action to be executed and it defines
a pattern. Thus, just entries and exits of invocations of the form
Bar.*(Baz) will be considered join-points of this
crosscut.
This crosscut defines a crosscut for all entry- and exit-
points of the matched methods.
Use poointCutter to further restrict the number of
points were advices are executed.
version: $Revision: 1.3 $ author: Andrei Popovici |
Constructor Summary | |
protected | MethodCut() We want people to subclass this class. |
isInitialized | transient boolean isInitialized(Code) | | If you have more than one method in this class, determining the
name of the advice method will use the value of this method. This
variable should then be initialized with the name of the method
you want to call as advice method.
|
METHOD_ARGS | public void METHOD_ARGS()(Code) | | Override the value of this variable if you want to change the
name of the method wildcards. Currently, a method-name mathcing
everything should have the name METHOD_ARGS
|
doCreateRequest | protected CrosscutRequest doCreateRequest(Class theClass)(Code) | | Retrieve those methods belonging to theClass
which have the same signature as the advice methods. Use the
UserDefinedMCSignature object (adviceSignature )
to determine which methods defined in class theClass
match the pattern.
(if wildcards
are present, they use them to match more methods in theClass )
Return a list of JoinPointRequest objects corresponding
to all locations of the matched methods.
This implementation will return just Method-Entry and -Exit
locations..
|
getMethod | public Method getMethod()(Code) | | Get advice method, i.e. METHOD_ARGS(...) . The advice
method is used by the full code weaver.
advice method |
insertionAction | public void insertionAction(boolean beforeInsertion)(Code) | | |
isPotentialCrosscutClass | protected boolean isPotentialCrosscutClass(Class crtCls) throws MissingInformationException(Code) | | Return true only if
- This crosscut redefines the
methodAdvice method, OR
- if this crosscut defines an advice, and the corresponding
UserDefinedMCSignature
matches the target class crtCls .
|
potentialCrosscutClasses | protected Class[] potentialCrosscutClasses() throws MissingInformationException(Code) | | Return all potential classes to which this crosscut applies:
To all loaded classes, apply the isPotentialCrosscutClass
selector.
|
|
|