| ch.ethz.prose.crosscut.Crosscut ch.ethz.prose.crosscut.AbstractCrosscut
All known Subclasses: ch.ethz.prose.crosscut.SetCut, ch.ethz.prose.crosscut.MethodCut, ch.ethz.prose.crosscut.ThrowCut, ch.ethz.prose.crosscut.ConstructorCut, ch.ethz.prose.crosscut.CatchCut, ch.ethz.prose.crosscut.GetCut,
AbstractCrosscut | abstract public class AbstractCrosscut extends Crosscut (Code) | | Interface AbstractCrosscut is a Crosscut implementation together with
a filtering mechanism for
both join-point requests and join-point events. Every AbstractCrosscut
owns a PointFilter . A specializer is a
strategy-object used for filtering event requests.
A Crosscut is used to generate a crosscut request, that is,
a collection of join-point requests(Method createRequest ).
Upon the first usage of
a crosscut, the crosscut selects a number of classes in the current
virtual machine or maybe all (default), and then generates for every potential
point inside these classes (e.g. for all method entries, exits, or field
accesses) a separate join point request. Before returning these requests
to the user of the crosscut, it applies the filter provided by its
specializer to every one of them. Only the ones which passed are
returned in the crosscut.
For each event it receives, the abstract crosscut uses the
specializer as a filter. If the specializer allows the
action corresponding to this event, joinPointAction
is called with the current event as a parameter. If the specializer
disagrees with the current event, no action is performed.
How to extend AbstractCrosscut
Every subclass of crosscut will have to provide implementations for
doCreateRequest(Class) , joinPointAction and
possibly for potentialCrosscutClasses . Implementations
of these methods have to use the getRequestFactory to retrieve
the factory for creating the necessary JoinPointRequest
objects.
version: $Revision: 1.3 $ author: Andrei Popovici author: Angela Nicoara |
requestFactory | protected transient JoinPointManager requestFactory(Code) | | This is the info interface of the current system.
The implementation must ensure that these interfaces are
initialized when joinPointReached is called.
|
createRequest | final public CrosscutRequest createRequest(Class c)(Code) | | This method determines the join-points of the specified
class (c ). To generate join-point requests,
it uses the doCreateRequest templated method.
This method guarantees that the resulting requests:
- belong to classes that pass the predicate
isPotentialCrosscutClass
- are allowes by this crosscuts specializer (if any)
This method will also be used every time a new class is
loaded in the current VM in order to determine
the new requests.
|
createRequest | final public CrosscutRequest createRequest()(Code) | | This method is the mechanism used by an extension for creating
a crosscut Request. It uses the createRequest(Class c)
method to build up a crosscut for the entire local VM.
It has the following functionality:
for each potential crosscut class (as returned by
potentialCrosscutClasses ),
the method createRequest(Class c) is applied.
The result corresponds to the union of all requests returned by
createRequest(Class c) .
|
doCreateRequest | abstract protected CrosscutRequest doCreateRequest(Class c)(Code) | | This method has to be implemented by subclasses. It basically
represents the initial generation mechanisms for Join point
requests. It should return indiscriminatly a lot of join-points
for every potential join-point in the byte-code of the specified
class.
|
getPriority | public int getPriority()(Code) | | |
getSpecializer | public PointFilter getSpecializer()(Code) | | Return the current specializer.
the current specializer |
insertionAction | public void insertionAction(boolean beforeInsertion)(Code) | | Upon insertion, the a default (abstract) crosscuts
tries to figure out where it is running. It then
initializes the infoInterface and aspectInterface
variables.
Parameters: beforeInsertion - true if the crosscut is not yet inserted. |
isPotentialCrosscutClass | protected boolean isPotentialCrosscutClass(Class c)(Code) | | Override this method if you want to filter
the clases to be crosscut at runtime. The potential crosscut
classes denotes the initial number of classes to be
cutt across. Classes may be loaded later on, and this
method decides whether they should be searched for
join points or not.
|
joinPointReached | public void joinPointReached(MethodEntryJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
joinPointReached | public void joinPointReached(ConstructorJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
joinPointReached | public void joinPointReached(MethodExitJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
joinPointReached | public void joinPointReached(FieldAccessJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the curren\t event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
joinPointReached | public void joinPointReached(FieldModificationJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
joinPointReached | public void joinPointReached(ExceptionJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point< |
joinPointReached | public void joinPointReached(ExceptionCatchJoinPoint jp) throws Exception(Code) | | This method performs the actions upon receiving a JoinPointEvent.
If this crosscut has a specializer, and the current event is
accepted by the specializer, then
joinPointAction is invoked.
If it has no specializer, joinPointAction
is invoked by default.
Parameters: jp - the current join point |
potentialCrosscutClasses | protected synchronized Class[] potentialCrosscutClasses()(Code) | | Return an array of classes which will be considered for
crosscutting when this crosscut is used to genereate
a crosscut request. A crosscut will implement this method
if and only if the number of classes it crosscuts is limited.
The default implementation is to return all loaded classes
of the current VM, which means that the default is to crosscut
whatever is loaded in the VM (including abstract classes and
interfaces! (?)).
|
setOwner | public void setOwner(Aspect ext) throws IllegalStateException(Code) | | Set the owner of this crosscut. This can be done only if the
current crosscut does not have an owner.
|
thisJoinPoint | protected JoinPoint thisJoinPoint() throws IllegalStateException(Code) | | This method has to be implemented by concrete crosscut implementation.
It returns the thread-local JoinPointEvent object. It
can be called just below the control flow of a joinPointAction.
throws: IllegalStateException - if this mehtod is invoked from outsidea join-point notification. |
withdrawalAction | public void withdrawalAction(boolean beforeInsertion)(Code) | | |
|
|