| |
|
| java.lang.Object ch.ethz.jvmai.JoinPointHook ch.ethz.prose.engine.JoinPointManager
All known Subclasses: ch.ethz.prose.engine.HotSwapJoinPointManager, ch.ethz.prose.jvmai.jikesrvm.advice_weaver.AdviceJoinPointManager,
JoinPointManager | public class JoinPointManager extends JoinPointHook implements JoinPointQuery(Code) | | Class JoinPointManagerImpl defines implements two of the basic methods
JoinPointManager . Subclasses of AbstractJoinPointManager
should define only the link between registering event requests and the proper notification.
They should use the notifyListeners method in order to notify the listeners
of an event that this event occured, and invoke handleExceptions to handle
notification exceptions. By providing an implementation of handleExceptions
with a different handleExceptions method, subclasses may change the policy
for exception handling.
All implementations of AbstractJoinPointManager should also define the
abstract methods suspendListenerNotification and resumeListenerNotification
version: $Revision: 1.4 $ author: Andrei Popovici author: Angela Nicoara |
Inner Class :public static class ClassLoadConsumer extends Thread | |
Constructor Summary | |
public | JoinPointManager(boolean isConnected, JVMAspectInterface ai, boolean enableRevMap) Create an JoinPointManagerImpl with no registered listeners
or events. |
classLoadListeners | final protected Set classLoadListeners(Code) | | |
enableRevMap | protected boolean enableRevMap(Code) | | |
isConnected | protected boolean isConnected(Code) | | |
listener2req | final protected Map listener2req(Code) | | |
req2listener | final protected Map req2listener(Code) | | |
JoinPointManager | public JoinPointManager(boolean isConnected, JVMAspectInterface ai, boolean enableRevMap)(Code) | | Create an JoinPointManagerImpl with no registered listeners
or events.
|
allJoinpoints | public Set allJoinpoints()(Code) | | |
connectToJVMAI | public void connectToJVMAI()(Code) | | |
disconnectFromJVMAI | public void disconnectFromJVMAI()(Code) | | |
getLoadedClasses | public List getLoadedClasses()(Code) | | Returns all currently loaded classes in the virtual machine.
|
handleExceptions | protected void handleExceptions(List exceptionList, JoinPoint crtEvent)(Code) | | This method should be called if the notification fails for some of the
listeners. Subclasses are encouraged to override this method in order to
implement their own exception handling policy, e.g., removing the bad
listeners from this JoinPointManager .
Parameters: exceptionList - a list of Exception objects, thrown during the notificationof listeners of crtEvent . Parameters: crtEvent - a JoinPointEvent whose listeners were not properlynotified. |
handleRuntimeException | protected Exception handleRuntimeException(Exception e)(Code) | | This method should be called if a notification fails. If the notification
fails with a Runtime exception, the default implementation of this
method throws the corresponding run-time exception. Otherwise it
returns the exception that caused the failure.
Parameters: e - the exception to be handled a non-runtime exception thrown by the advice |
isReverseMappingEnabled | public boolean isReverseMappingEnabled()(Code) | | |
notifyClassLoadListeners | protected void notifyClassLoadListeners(Class newClass)(Code) | | Notify all registered class load listeners that the class
newClass has just been loaded and prepared.
This method should be invoked by implementations of this abstract
immediately after a class of intereest (containing potential join-points)
is loaded and prepared.
Parameters: newClass - the class that is new to the system |
onConstructor | public void onConstructor(ConstructorJoinPoint joinPoint)(Code) | | Hook method to be called whenever a registered constructor is invoked.
|
onExceptionCatch | public void onExceptionCatch(ExceptionCatchJoinPoint joinPoint)(Code) | | Hook method to be called whenever an Exception Catch event is reported from
the jvmai-interface.
For every listener registered on an exception catch event it invoces the
corresponding joinPointReached -method.
|
onExceptionThrow | public void onExceptionThrow(ExceptionJoinPoint joinPoint)(Code) | | Hook method to be called whenever an Exception event is reported from
the jvmai-interface.
For every listener registered on an exception throw event it invoces the
corresponding joinPointReached -method.
|
registerListener | public void registerListener(JoinPointListener list, JoinPointRequest req)(Code) | | Register the listener lsnr for events
requested by jpr . If the request jpr
is the first of its kind, the join corresponding join point
will be enabled. More precise, if no other request with an equal
singature has been previously registered, the join point
will be enabled.
This method checks for the permission ProsePermission "registerListener" to be present.
|
registerListener | public void registerListener(ClassLoadListener updateGuy)(Code) | | Register a class load listener event. All class load listeners
will be notified every time a class of interest (containing potential join-points)
has been loaded.
Parameters: updateGuy - the listener of class load events |
resumeListenerNotification | public void resumeListenerNotification(Thread t)(Code) | | Resume the notification of listerners interested in join-points
that occur in the specified thread.
|
suspendListenerNotification | public void suspendListenerNotification(Thread t)(Code) | | Suspend notification of all listeners interested in join-points
that occur in the specified thread. This method is idempotent.
Successive calls to this method with the same argument have
the same effect as calling it only once.
|
toString | public String toString()(Code) | | Return the state of the join-point manager. The registeresd listeners and
the associated requests will be returned.
|
unregisterListener | public void unregisterListener(JoinPointListener listener)(Code) | | Deregister listener lsnr from this JoinPointManager.
As a result of this action, the listener lsnr will
cease being notified of any kind of events. Upon this action,
any 'lonely event' -- one for whom no listener exists will be
disabled. More precisely, if lsnr was the last listener
litening on envents with the signature S,
S.disableJoinPoint will be performed.
|
unregisterListener | public void unregisterListener(ClassLoadListener updateGuy)(Code) | | Unregister a class load listener.
Parameters: updateGuy - the listener to be removed from the listeners list. |
|
|
|