Java Doc for AspectInterfaceImpl.java in  » Byte-Code » PROSE » ch » ethz » inf » iks » jvmai » jvmdi » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Byte Code » PROSE » ch.ethz.inf.iks.jvmai.jvmdi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ch.ethz.inf.iks.jvmai.jvmdi.AspectInterfaceImpl

All known Subclasses:   ch.ethz.inf.iks.jvmai.jvmdi.HotSwapAspectInterfaceImpl,
AspectInterfaceImpl
public class AspectInterfaceImpl implements JVMAspectInterface,SunBCELRepositoryInterface(Code)
Interface AspectInterfaceImpl represents the aspect-interface to the jvmai-system. It's needed for initialization of the jvmai-system, management of joinpoint-watches and for enable or disable event-notification.

An instance of this interface can be obtained by calling the method getAspectInterface() of a jvmai-provider (class DebuggerProvider).

Implementation

The implementation of this aspect interface is based on the debugger interface of the JVM. To receive notifications from the JVM, it uses the native code available in this class.

Bugs

The JVMDI is not consistent over serveral J2SDK versions.
  • Startup ignores the openword/closed world assumption and the list of prefixes.
  • Under JDK 1.4.*, when throwing an exception within the notificaion, exception events are wrongly sent to the debugger
  • Under JDK 1.4.*, the 'GetThreadDepth' JVMDI function (name may be wrong), does not always work correclty. Consequently, the current implementation (as of prose 0.18.0) relies on the height of a frame relative to the frame which received the debugger notifcation.
  • Under JDK 1.4.*, the 'getBytecode' method exported by JVMDI works non-deterministically. (first time it works, subsequent times it generates illegal opcodes). The workaround uses BCEL and the class loader. However, this may incurr performance penalties.

version:
   $Revision: 1.3 $
author:
   Andrei Popovici
author:
   Angela Nicoara

Inner Class :static class CompoundAopTag

Field Summary
static  ThreadLocalcflows
    
protected static  RepositoryclassRepository
     Caches BCEL class definitions, which where fetched to analyze or redefine java classes.
 MapexceptionCatchMap
    
 MapexceptionThrowMap
    
 MapfieldAccessMap
    
 MapfieldModificationMap
    
protected static  JoinPointHookhook
    
public  booleanisInitialized
    
 MapmethodExecutionMap
    


Method Summary
public  voidaddBCELClassDefiniton(InputStream definition, String name)
     Adds a class file to BCELs repository.
public  voidclearConstructorWatch(Constructor m)
     Clears a watch on a constructor joinpoint.
public  voidclearExceptionCatchWatch(Class cls)
     Clears a watch on a exception catch joinpoint.
Parameters:
  cls - Exception Class that should be watched.
exception:
  NotInitializedException - Aspect-interface has not been initialized yet.
public  voidclearExceptionThrowWatch(Class cls)
     Clears a watch on a exception throw joinpoint.
Parameters:
  cls - Exception Class that should be watched.
exception:
  NotInitializedException - Aspect-interface has not been initialized yet.
public  voidclearFieldAccessWatch(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  voidclearFieldModificationWatch(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  voidclearMethodEntryWatch(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 synchronized  voidclearMethodExitWatch(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  ListgetLoadedClasses()
    
public  booleanisClassLoaded(String name)
     Checks if the class is already into the PROSE BCEL repository.
public  voidresumeNotification(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  voidsetConstructorWatch(Constructor m, Object aopTag)
     Sets a watch on a constructor joinpoint.
Parameters:
  m - the constructor to be watched.
public  voidsetExceptionCatchWatch(Class cls, Object aopTag)
     Sets a watch on a exception catch joinpoint.
Parameters:
  cls - Exception Class that should 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  voidsetExceptionThrowWatch(Class cls, Object aopTag)
     Sets a watch on a exception throw joinpoint.
Parameters:
  cls - Exception Class that should 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  voidsetFieldAccessWatch(Field f, Object aopTag)
     Sets a watch on a field access joinpoint.
Parameters:
  f - the field to be watched.
public  voidsetFieldModificationWatch(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  voidsetJoinPointHook(JoinPointHook jpHook)
     Sets a JoinPointHook as listener for jvmai-events. Whenever a watched joinpoint is reached or a class is loaded into the virtual machine, this JoinPointHook is notified by the aspect-interface.
public synchronized  voidsetMethodEntryWatch(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  voidsetMethodExitWatch(Method m, Object aopTag)
     Sets a watch on a method exit joinpoint.
Parameters:
  m - the method beeing 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  voidstartup(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  voidsuspendNotification(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  voidteardown()
    

Field Detail
cflows
static ThreadLocal cflows(Code)



classRepository
protected static Repository classRepository(Code)
Caches BCEL class definitions, which where fetched to analyze or redefine java classes.



exceptionCatchMap
Map exceptionCatchMap(Code)



exceptionThrowMap
Map exceptionThrowMap(Code)



fieldAccessMap
Map fieldAccessMap(Code)



fieldModificationMap
Map fieldModificationMap(Code)



hook
protected static JoinPointHook hook(Code)



isInitialized
public boolean isInitialized(Code)



methodExecutionMap
Map methodExecutionMap(Code)





Method Detail
addBCELClassDefiniton
public void addBCELClassDefiniton(InputStream definition, String name)(Code)
Adds a class file to BCELs repository. This is only required for remote class files, which may not be found in the local class path.

Used by ch.ethz.prose.tools.RemoteAspectManagerImpl to add RedefineCuts to a remote aspect interface.

If the class file can not be readed or added to the repository an error message will be written to stdout, but no exception will be thrown to notify the caller.
Parameters:
  definition - the raw class file bytes wrapped in an InputStream
Parameters:
  name - (full qualified) class name in binary notation (p.a. ch.ethz.prose.LocalAspectManager)




clearConstructorWatch
public void clearConstructorWatch(Constructor m)(Code)
Clears a watch on a constructor joinpoint.
Parameters:
  m - the constructor beeing watched.



clearExceptionCatchWatch
public void clearExceptionCatchWatch(Class cls)(Code)
Clears a watch on a exception catch joinpoint.
Parameters:
  cls - Exception Class that should be watched.
exception:
  NotInitializedException - Aspect-interface has not been initialized yet. Call setup first.
exception:
  NullPointerException - cls is null.
exception:
  WatchNotSetException - There exists no exceptionCatch-watch at this point.



clearExceptionThrowWatch
public void clearExceptionThrowWatch(Class cls)(Code)
Clears a watch on a exception throw joinpoint.
Parameters:
  cls - Exception Class that should be watched.
exception:
  NotInitializedException - Aspect-interface has not been initialized yet. Call setup first.
exception:
  NullPointerException - cls is null.
exception:
  WatchNotSetException - There exists no exceptionThrow-watch at this point.



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.



clearMethodExitWatch
public synchronized void clearMethodExitWatch(Method m)(Code)
Clears a watch on a method exit 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 exit-watch on the method.



getLoadedClasses
public List getLoadedClasses()(Code)



isClassLoaded
public boolean isClassLoaded(String name)(Code)
Checks if the class is already into the PROSE BCEL repository.



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.



setExceptionCatchWatch
public void setExceptionCatchWatch(Class cls, Object aopTag)(Code)
Sets a watch on a exception catch joinpoint.
Parameters:
  cls - Exception Class that should 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:
  WatchAlreadySetException - There already exists a exceptionCatch-watch at this point.



setExceptionThrowWatch
public void setExceptionThrowWatch(Class cls, Object aopTag)(Code)
Sets a watch on a exception throw joinpoint.
Parameters:
  cls - Exception Class that should 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:
  WatchAlreadySetException - There already exists a exceptionThrow-watch at this point.



setFieldAccessWatch
public void setFieldAccessWatch(Field f, Object aopTag)(Code)
Sets a watch on a field access joinpoint.
Parameters:
  f - 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.



setJoinPointHook
public void setJoinPointHook(JoinPointHook jpHook)(Code)
Sets a JoinPointHook as listener for jvmai-events. Whenever a watched joinpoint is reached or a class is loaded into the virtual machine, this JoinPointHook is notified by the aspect-interface. As long as no JoinPointHook is set (or after setting null), processing of joinpoint- and classload-events is disabled in the jvmai-system.
Parameters:
  jpHook - JoinPointHook to set as listener.
exception:
  NotInitializedException - Aspect-interface has not been initialized yet. Call setup first.



setMethodEntryWatch
public synchronized 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 beeing 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 void teardown()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.