|
|||||||||
| Home >> All >> ch >> ethz >> prose >> [ crosscut overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
ch.ethz.prose.crosscut
Class MethodCut

java.lang.Objectch.ethz.prose.engine.JoinPointListener
ch.ethz.prose.crosscut.Crosscut
ch.ethz.prose.crosscut.AbstractCrosscut
ch.ethz.prose.crosscut.MethodCut
- All Implemented Interfaces:
- ch.ethz.prose.Insertable, java.io.Serializable
- Direct Known Subclasses:
- AllLocationsTest.AllLocationsExample, FunctionalCrosscutTest.FunctionalCrosscutExample
- public abstract class MethodCut
- extends AbstractCrosscut
- implements java.io.Serializable
- extends AbstractCrosscut
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.2 $
| Field Summary | |
(package private) MethodCutSignaturePattern |
adviceSignature
|
(package private) boolean |
isInitialized
If you have more than one method in this class, determining the name of the advice method will use the value of this method. |
(package private) MethodCutSpecializer |
mcutSpecializer
|
(package private) java.lang.String |
toStringSignature
|
| Fields inherited from class ch.ethz.prose.crosscut.AbstractCrosscut |
requestFactory |
| Constructor Summary | |
protected |
MethodCut()
We want people to subclass this class. |
| Method Summary | |
protected CrosscutRequest |
doCreateRequest(java.lang.Class theClass)
Retrieve those methods belonging to theClass
which have the same signature as the advice methods. |
ch.ethz.prose.filter.PointCutter |
equivalentSpecializer()
|
private void |
initState()
|
void |
insertionAction(boolean beforeInsertion)
Upon insertion, the a default (abstract) crosscuts tries to figure out where it is running. |
protected boolean |
isPotentialCrosscutClass(java.lang.Class crtCls)
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. |
void |
joinPointAction(ch.ethz.jvmai.MethodEntryJoinPoint ev)
Create an action to execute the advice which matched the method in which the location of jpe resides. |
void |
joinPointAction(ch.ethz.jvmai.MethodExitJoinPoint ev)
Create an action to execute the advice which matched the method in which the location of jpe resides. |
void |
METHOD_ARGS()
Override the value of this variable if you want to change the name of the method wildcards. |
private void |
methodAdvice(ch.ethz.jvmai.JoinPoint joinPoint)
If 'methodAdvice' has been redefined, then we will deal with a 'DefaultMcutSignature'. |
protected java.lang.Class[] |
potentialCrosscutClasses()
Return all potential classes to which this crosscut applies: To all loaded classes, apply the isPotentialCrosscutClass
selector. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class ch.ethz.prose.crosscut.AbstractCrosscut |
associateToGroup, createRequest, createRequest, getOwner, getPriority, getSpecializer, joinPointAction, joinPointAction, joinPointAction, joinPointAction, joinPointReached, joinPointReached, joinPointReached, joinPointReached, joinPointReached, joinPointReached, NOT, pointCutter, setOwner, thisJoinPoint, withdrawalAction |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
isInitialized
transient boolean isInitialized
- 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.
mcutSpecializer
transient MethodCutSpecializer mcutSpecializer
adviceSignature
transient MethodCutSignaturePattern adviceSignature
toStringSignature
java.lang.String toStringSignature
| Constructor Detail |
MethodCut
protected MethodCut()
throws MissingInformationException
- We want people to subclass this class.
Create a
MethodCutobject.
| Method Detail |
METHOD_ARGS
public void METHOD_ARGS()
- 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
initState
private void initState()
throws MissingInformationException
insertionAction
public void insertionAction(boolean beforeInsertion)
- Description copied from class:
AbstractCrosscut - Upon insertion, the a default (abstract) crosscuts
tries to figure out where it is running. It then
initializes the infoInterface and aspectInterface
variables.
- Specified by:
insertionActionin interfacech.ethz.prose.Insertable- Overrides:
insertionActionin classAbstractCrosscut
potentialCrosscutClasses
protected java.lang.Class[] potentialCrosscutClasses() throws MissingInformationException
- Return all potential classes to which this crosscut applies:
To all loaded classes, apply the
isPotentialCrosscutClassselector.- Overrides:
potentialCrosscutClassesin classAbstractCrosscut
isPotentialCrosscutClass
protected boolean isPotentialCrosscutClass(java.lang.Class crtCls) throws MissingInformationException
- Return true only if
- This crosscut redefines the
methodAdvicemethod, OR - if this crosscut defines an advice, and the corresponding
UserDefinedMCSignaturematches the target classcrtCls.
- Overrides:
isPotentialCrosscutClassin classAbstractCrosscut
- This crosscut redefines the
doCreateRequest
protected CrosscutRequest doCreateRequest(java.lang.Class theClass)
- Retrieve those methods belonging to
theClasswhich have the same signature as the advice methods. Use theUserDefinedMCSignatureobject (adviceSignature) to determine which methods defined in classtheClassmatch the pattern. (if wildcards are present, they use them to match more methods intheClass)Return a list of
JoinPointRequestobjects corresponding to all locations of the matched methods.This implementation will return just Method-Entry and -Exit locations..
- Specified by:
doCreateRequestin classAbstractCrosscut
joinPointAction
public void joinPointAction(ch.ethz.jvmai.MethodEntryJoinPoint ev) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Create an action to execute the advice which matched the
method in which the location of
jperesides.- Overrides:
joinPointActionin classAbstractCrosscut
joinPointAction
public void joinPointAction(ch.ethz.jvmai.MethodExitJoinPoint ev) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Create an action to execute the advice which matched the
method in which the location of
jperesides.- Overrides:
joinPointActionin classAbstractCrosscut
methodAdvice
private void methodAdvice(ch.ethz.jvmai.JoinPoint joinPoint) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
- If 'methodAdvice' has been redefined, then we will deal with a
'DefaultMcutSignature'. But in THAT case, this method
will be never executed.
equivalentSpecializer
public ch.ethz.prose.filter.PointCutter equivalentSpecializer()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).- Overrides:
toStringin classAbstractCrosscut
|
|||||||||
| Home >> All >> ch >> ethz >> prose >> [ crosscut overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC