| java.lang.Object ch.ethz.inf.iks.jvmai.jvmdi.AspectInterfaceImpl ch.ethz.inf.iks.jvmai.jvmdi.HotSwapAspectInterfaceImpl
HotSwapAspectInterfaceImpl | public class HotSwapAspectInterfaceImpl extends AspectInterfaceImpl (Code) | | HotSwapAspectInterfaceImpl class.
author: Angela Nicoara author: Gerald Linhofer version: $Revision: 1.1.2.5 $ |
Method Summary | |
public synchronized void | clearConstructorWatch(Constructor m) Clears a watch on a constructor joinpoint.
Parameters: m - the constructor beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public void | clearFieldAccessWatch(Field field) Clears a watch on a field access joinpoint.
Parameters: field - the field beeing watched. exception: NotInitializedException - Aspect-interface has not been intialized yet. | public void | clearFieldModificationWatch(Field field) Clears a watch on a field modification joinpoint.
Parameters: field - the field beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public synchronized void | clearMethodEntryWatch(Method m) Clears a watch on a method entry joinpoint.
Parameters: m - the method beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public void | clearMethodExitWatch(Method m) Clears a watch on a method exit joinpoint.
Parameters: m - the method beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public static void | doOnClassLoad(Class cls) Called when ever a new class is loaded by the VM. | public static void | doOnClassUnload(Class cls) Called when ever the VM unloads a class. | final public static void | doOnConstructor(int methodId) This callback will be invoked at constructor join points. | final public static void | doOnFieldAccess(Object owner, int fieldId) This callback will be invoked at field access join points. | final public static void | doOnFieldModification(Object owner, int fieldId, int slot) This callback will be invoked at field modification join points. | final public static void | doOnMethodEntry(int methodId) This callback will be invoked at method entry join points. | final public static void | doOnMethodExit(int methodId, int resultSlot) This callback will be invoked at method exit join points. | public static JavaClass | getBCELClassDefinition(Class cls) Returns a BCEL class of a java class. | public static Field | getFieldFromString(String id, boolean isStatic) Returns the reflected Field, for a id string containing the class name,
the field name and it's signature separated by '#'.
Note: The class must declare the field, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchFieldExceptionNoSuchFieldException .
Parameters: id - String holding an unique identiefier for the field. Parameters: isStatic - true if the field is static. | public static Field | getFieldFromString(String className, String fieldName, String signature, boolean isStatic) Returns the reflected Field, for a id string containing the class name,
the field name and it's signature separated by '#'.
Note: The class must declare the field, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchFieldExceptionNoSuchFieldException .
Parameters: className - String holding the full qualified class name. Parameters: fieldName - String holding the fields name. Parameters: signature - String holding the signature (type) of the field. Parameters: isStatic - true if the field is static. | public static HotSwapAspectInterfaceImpl | getInstance() Returns the instance of HotSwapAspectInterfaceImpl and creates it
if required. | public static Member | getMethodFromString(String id) Returns the reflected Method, for a id string containing the class name,
the method name and it's signature, separated by '#'. | public static Member | getMethodFromString(String className, String methodName, String signature, boolean isStatic) Returns the reflected Method, for a id string containing the class name,
the method name and it's signature, separated by '#'.
The id string for this method would be
ch.ethz.inf.iks.jvmai.jvmdi.HotSwapClassWeaver#getMethodFromString#(Ljava/lang/String)Ljava/lang/reflect/Method"
.
Note: The class must declare the method, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchMethodErrorNoSuchMethodError .
Parameters: className - String holding the full qualified name of the class. Parameters: methodName - String holding the methods name. Parameters: signature - String holding the methods signature. Parameters: isStatic - true if the method is static. | public java.io.InputStream | getOriginalClassDefinition(Class cls) Returns the original class implementation from a class file
in CLASS_PATH, if available. | public void | resumeNotification(Thread thread) Resumes notification regarding the specified thread.
Successive calls to resumeNotification
without preceding calls to suspendNotification
will be ignored by the jvmai-system.
Parameters: thread - Thread for which to reenable notification. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public void | setConstructorWatch(Constructor m, Object aopTag) Sets a watch on a constructor joinpoint.
Parameters: m - the constructor to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. | public void | setFieldAccessWatch(Field field, Object aopTag) Sets a watch on a field access joinpoint.
Parameters: field - the field to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. | public void | setFieldModificationWatch(Field field, Object aopTag) Sets a watch on a field modification joinpoint.
Parameters: field - the field to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. | public void | setMethodEntryWatch(Method m, Object aopTag) Sets a watch on a method entry joinpoint.
Parameters: m - the method to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. | public synchronized void | setMethodExitWatch(Method m, Object aopTag) Sets a watch on a method exit joinpoint.
Parameters: m - the method to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. | public synchronized void | startup(String[] packagePrefixes, boolean openWorldAssumption) Initializes the underlying jvmai system.
In addition, this method takes a list of java package-names and a
boolean indicating how to interpret this prefixes. | public void | suspendNotification(Thread thread) Suspend notification regarding the specified thread.
Successive calls to suspendNotification
have to be balanced by (at least) the same number of calls to
resumeNotification , or the jvmai-system
will not resume notification.
Parameters: thread - Thread for which to disable notification. exception: NotInitializedException - Aspect-interface has not been initialized yet. | public synchronized void | teardown() Teardown the AOP support. |
aopNullTag | protected static Object aopNullTag(Code) | | Replacement tag, will be used as tag, if the user supplied tag
is null . (Required to store the tag in data
structures that didn't allow null entries.)
|
classRegister | protected static HotSwapClassRegister classRegister(Code) | | Gathers and holds informations about field and method call join points
|
constructorTags | protected static Object constructorTags(Code) | | |
fieldAccessTags | protected static Object fieldAccessTags(Code) | | |
fieldModificationTags | protected static Object fieldModificationTags(Code) | | |
initialized | protected static boolean initialized(Code) | | true if HotSwapAspectInterfaceImpl was initialized.
|
methodEntryTags | protected static Object methodEntryTags(Code) | | |
resolvedFields | protected static CacheMap resolvedFields(Code) | | Caches reflected Field objects resolved by
the getFieldFromString() methods.
|
resolvedMethods | protected static CacheMap resolvedMethods(Code) | | Caches reflected Method objects resolved by
the getMethodFromString() methods.
|
suspendedThreads | protected static Set suspendedThreads(Code) | | |
HotSwapAspectInterfaceImpl | protected HotSwapAspectInterfaceImpl()(Code) | | Constructor. Dont call it, use
HotSwapAspectInterfaceImpl.getInstance getInstance() to create an instance of this class.
This is not private to allow unit testing.
|
clearFieldAccessWatch | public void clearFieldAccessWatch(Field field)(Code) | | Clears a watch on a field access joinpoint.
Parameters: field - the field beeing watched. exception: NotInitializedException - Aspect-interface has not been intialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no field with id fieldId in class cls . exception: WatchNotSetException - There exists no access-watch on the field. |
clearFieldModificationWatch | public void clearFieldModificationWatch(Field field)(Code) | | Clears a watch on a field modification joinpoint.
Parameters: field - the field beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no field with id fieldId in class cls . exception: WatchNotSetException - There exists no modification-watch on the field. |
clearMethodEntryWatch | public synchronized void clearMethodEntryWatch(Method m)(Code) | | Clears a watch on a method entry joinpoint.
Parameters: m - the method beeing watched. exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no method with id methodId in class cls . exception: WatchNotSetException - There exists no entry-watch on the method. |
doOnClassLoad | public static void doOnClassLoad(Class cls)(Code) | | Called when ever a new class is loaded by the VM.
Parameters: cls - the new class. |
doOnClassUnload | public static void doOnClassUnload(Class cls)(Code) | | Called when ever the VM unloads a class.
This works only with JVMDI, JVMTI has no
support for unload events.
Parameters: cls - |
doOnConstructor | final public static void doOnConstructor(int methodId)(Code) | | This callback will be invoked at constructor join points. Invocation only
takes place if the callback is woven in to the corresponding constructor.
Parameters: methodId - method identifier |
doOnFieldAccess | final public static void doOnFieldAccess(Object owner, int fieldId)(Code) | | This callback will be invoked at field access join points. Invocation only
takes place if the callback is woven in to the corresponding method.
Parameters: owner - object that contains the field Parameters: fieldId - field identifier |
doOnFieldModification | final public static void doOnFieldModification(Object owner, int fieldId, int slot)(Code) | | This callback will be invoked at field modification join points. Invocation only
takes place if the callback is woven in to the corresponding method.
Parameters: owner - object that contains the field Parameters: fieldId - field identifier Parameters: slot - index of the local variable that contains the new value for the field |
doOnMethodEntry | final public static void doOnMethodEntry(int methodId)(Code) | | This callback will be invoked at method entry join points. Invocation only
takes place if the callback is woven in to the corresponding method.
Parameters: methodId - method identifier |
doOnMethodExit | final public static void doOnMethodExit(int methodId, int resultSlot)(Code) | | This callback will be invoked at method exit join points. Invocation only
takes place if the callback is woven in to the corresponding method.
Parameters: methodId - method identifier Parameters: resultSlot - index of the result in the local variable table |
getFieldFromString | public static Field getFieldFromString(String id, boolean isStatic) throws ClassNotFoundException, NoSuchFieldException(Code) | | Returns the reflected Field, for a id string containing the class name,
the field name and it's signature separated by '#'.
Note: The class must declare the field, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchFieldExceptionNoSuchFieldException .
Parameters: id - String holding an unique identiefier for the field. Parameters: isStatic - true if the field is static. Field throws: ClassNotFoundException - can not find the class, the field belongs to. throws: NoSuchFieldException - can not find the field throws: InvalidIdException - the id string is not well formated. |
getFieldFromString | public static Field getFieldFromString(String className, String fieldName, String signature, boolean isStatic) throws ClassNotFoundException, NoSuchFieldException(Code) | | Returns the reflected Field, for a id string containing the class name,
the field name and it's signature separated by '#'.
Note: The class must declare the field, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchFieldExceptionNoSuchFieldException .
Parameters: className - String holding the full qualified class name. Parameters: fieldName - String holding the fields name. Parameters: signature - String holding the signature (type) of the field. Parameters: isStatic - true if the field is static. Field throws: ClassNotFoundException - can not find the class, the field belongs to. throws: NoSuchFieldException - can not find the field throws: InvalidIdException - the id string is not well formated. |
getInstance | public static HotSwapAspectInterfaceImpl getInstance()(Code) | | Returns the instance of HotSwapAspectInterfaceImpl and creates it
if required. There's only one instance of this class (Singelton Pattern).
HotSwapAspectInterfaceImpl instance |
getMethodFromString | public static Member getMethodFromString(String className, String methodName, String signature, boolean isStatic) throws ClassNotFoundException(Code) | | Returns the reflected Method, for a id string containing the class name,
the method name and it's signature, separated by '#'.
The id string for this method would be
ch.ethz.inf.iks.jvmai.jvmdi.HotSwapClassWeaver#getMethodFromString#(Ljava/lang/String)Ljava/lang/reflect/Method"
.
Note: The class must declare the method, if it only inherits it from a super
class, this method will throw an
java.lang.NoSuchMethodErrorNoSuchMethodError .
Parameters: className - String holding the full qualified name of the class. Parameters: methodName - String holding the methods name. Parameters: signature - String holding the methods signature. Parameters: isStatic - true if the method is static. Member the reflected Method or Constructor object. throws: java.lang.ClassNotFoundException - can not find the class, declaring the method. throws: ch.ethz.jvmai.InvalidIdException - id has wrong format (doesn't contain two '#'). throws: java.lang.NoSuchMethodError - can not find the method in the declaring class. throws: ch.ethz.jvmai.JVMAIRuntimeException - class was not initialized. |
resumeNotification | public void resumeNotification(Thread thread)(Code) | | Resumes notification regarding the specified thread.
Successive calls to resumeNotification
without preceding calls to suspendNotification
will be ignored by the jvmai-system.
Parameters: thread - Thread for which to reenable notification. exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - thread is null . |
setConstructorWatch | public void setConstructorWatch(Constructor m, Object aopTag)(Code) | | Sets a watch on a constructor joinpoint.
Parameters: m - the constructor to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. This object may be null . exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no method with id methodId in class cls . exception: CannotSetWatchException - The method must not be abstract or native. exception: WatchAlreadySetException - There already exists a entry-watch on the method. |
setFieldAccessWatch | public void setFieldAccessWatch(Field field, Object aopTag)(Code) | | Sets a watch on a field access joinpoint.
Parameters: field - the field to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. This object may be null . exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no field with id fieldId in class cls . exception: CannotSetWatchException - ? exception: WatchAlreadySetException - There already exists a access-watch on the field. |
setFieldModificationWatch | public void setFieldModificationWatch(Field field, Object aopTag)(Code) | | Sets a watch on a field modification joinpoint.
Parameters: field - the field to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. This object may be null . exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exist no field with id fieldId in class cls . exception: CannotSetWatchException - ? exception: WatchAlreadySetException - There already exists a modification-watch on the field. |
setMethodEntryWatch | public void setMethodEntryWatch(Method m, Object aopTag)(Code) | | Sets a watch on a method entry joinpoint.
Parameters: m - the method to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. This object may be null . exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no method with id methodId in class cls . exception: CannotSetWatchException - The method must not be abstract or native. exception: WatchAlreadySetException - There already exists a entry-watch on the method. |
setMethodExitWatch | public synchronized void setMethodExitWatch(Method m, Object aopTag)(Code) | | Sets a watch on a method exit joinpoint.
Parameters: m - the method to be watched. Parameters: aopTag - A user-defined object saved with this watch.When the joinpoint is reached, this object ispassed to the JoinPointHook as part of theJoinPoint-instance. This object may be null . exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - cls is null . exception: InvalidIdException - There exists no method with id methodId in class cls . exception: CannotSetWatchException - The method must not be abstract or native. exception: WatchAlreadySetException - There already exists a exit-watch on the method. |
startup | public synchronized void startup(String[] packagePrefixes, boolean openWorldAssumption)(Code) | | Initializes the underlying jvmai system.
In addition, this method takes a list of java package-names and a
boolean indicating how to interpret this prefixes. The prefixes are
used by the jvmai system to determine the set of classes beeing
relevant to the system at all.
Depeding on the value of openWorldAssumption , prefixes
are interpreted as followed:
openWorldAssumption == true
The jvmai-system is instructed to treat ALL classes as relevant,
EXCEPT the ones contained in a packages starting with one of the
supplied prefixes in packagePrefixes
openWorldAssumption == false
The jvmai-system is instructed to treat as relevant ONLY the classes
contained in a packages starting with one of the supplied prefixes
in packagePrefixes
Parameters: packagePrefixes - List of prefixes for java package-names. Parameters: openWorldAssumption - Specifies how the prefixes are interpreted. exception: StartupException - Use StartupException.getMessage() to get a detailed description |
suspendNotification | public void suspendNotification(Thread thread)(Code) | | Suspend notification regarding the specified thread.
Successive calls to suspendNotification
have to be balanced by (at least) the same number of calls to
resumeNotification , or the jvmai-system
will not resume notification.
Parameters: thread - Thread for which to disable notification. exception: NotInitializedException - Aspect-interface has not been initialized yet. Call setup first. exception: NullPointerException - thread is null . |
teardown | public synchronized void teardown()(Code) | | Teardown the AOP support. As a result,
no events will be sent to the JoinPointHook.
|
|
|