Java Doc for MethodWeaver.java in  » Byte-Code » PROSE » ch » ethz » prose » jvmai » jikesrvm » advice_weaver » 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.prose.jvmai.jikesrvm.advice_weaver 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   ch.ethz.prose.jvmai.jikesrvm.advice_weaver.MethodWeaver

MethodWeaver
public class MethodWeaver (Code)
Modifies a given method to support advice execution. For each activated join point an advice is woven into the bytecode of the method and then installed in the VM using the services of VM_ClassEvolution.
version:
   $Revision$
author:
   Johann Gyger
author:
   Angela Nicoara


Field Summary
final public static  StringJVMAI_CLASS
     String representation of the JVMAI class.
protected  ConstantPoolGencpGen
     BCEL constant pool generator used during the weaving process.
protected  MapfieldAccessors
     Watched field accesses.
protected  MapfieldModifiers
     Watched field modifications.
protected  InstructionFactoryinstructionFactory
     BCEL instruction factory used during the weaving process.
protected  InstructionListinstructions
     BCEL instructions that make up the method body (used during weaving process).
protected  booleanmethodEntryEnabled
    
protected  booleanmethodExitEnabled
    
protected  MethodGenmethodGen
     BCEL method generator used during the weaving process.
protected  booleanmodified
    
protected  byte[]originalCode
     Original bytecode of `target'.
protected  MethodredefineAdvice
     Redefine advice method.
protected  Methodtarget
     Method bound to this weaver.
protected  ClasstargetClass
     Declaring class of `target'.
protected  inttargetId
    
final protected static  booleanverifyBytecodes
    
protected static  Mapweavers
     Collection of all method weavers.
protected  booleanwoven
    

Constructor Summary
protected  MethodWeaver(Method target)
     Create a new method weaver.

Method Summary
public  voidaddFieldAccessor(java.lang.reflect.Field f)
     Add a field for which a callback should be woven (for each access).
public  voidaddFieldModifier(java.lang.reflect.Field f)
     Add a field for which a callback should be woven (for each modification).
protected  voidcheckVerificationResult(VerificationResult vr, String pass)
     Check bytecode verification result.
public static synchronized  voidcommit()
     Re-weave all modified methods and activate them in the VM.
protected  InstructionListcreateFieldAdviceCallback(String callbackMethod, VM_Field field)
     Create a field advice callback that can be woven.
protected  InstructionListcreateMethodAdviceCallback(String callbackMethod)
     Create a method advice callback that can be woven.
public  StringdebugString()
    
protected  voidfinishWeaving()
     Clean up weaving process.
public static synchronized  MethodWeavergetWeaver(Method target)
     Get a unique method weaver for `target'.
protected  voidinitWeaving()
     Prepare for weaving by initializing the corresponding fields.
protected  voidinstallBytecode()
     Install bytecode of woven method into the VM.
protected  voidloadArg(InstructionList il, Type type, int index)
     Load argument at `index' of type `type'.
protected  voidloadArgs(InstructionList il)
     Load all arguments.
public  voidremoveFieldAccessor(java.lang.reflect.Field f)
     Remove a field for which a callback was woven (for each access).
public  voidremoveFieldModifier(java.lang.reflect.Field f)
     Remove a field for which a callback was woven (for each modification).
public static synchronized  voidresetAll()
     Reset all woven methods.
public  voidsetMethodEntryEnabled(boolean flag)
     Enable method entry join point.
public  voidsetMethodExitEnabled(boolean flag)
     Enable method entry join point.
public  voidsetRedefineAdvice(Method advice)
     Redefine the method in this weaver.
protected  voidverify(ConstantPool cp, org.apache.bcel.classfile.Method bm)
     Verify bytecodes with the BCEL verifier.
protected  voidweave()
     Weave advice that are associated with the method in this weaver.
protected  voidweaveFieldAdvice()
     Weave all registered field accesses/modifications.
protected  voidweaveMethodEntryAdvice()
     Weave method entry advice callback into method body.
protected  voidweaveMethodExitAdvice()
     Weave method exit advice callback into method body.
protected  voidweaveRedefineAdvice()
     Weave method redefine advice callback into method body and remove original code.

Field Detail
JVMAI_CLASS
final public static String JVMAI_CLASS(Code)
String representation of the JVMAI class.



cpGen
protected ConstantPoolGen cpGen(Code)
BCEL constant pool generator used during the weaving process.



fieldAccessors
protected Map fieldAccessors(Code)
Watched field accesses.



fieldModifiers
protected Map fieldModifiers(Code)
Watched field modifications.



instructionFactory
protected InstructionFactory instructionFactory(Code)
BCEL instruction factory used during the weaving process.



instructions
protected InstructionList instructions(Code)
BCEL instructions that make up the method body (used during weaving process).



methodEntryEnabled
protected boolean methodEntryEnabled(Code)
Is method entry join point activated?



methodExitEnabled
protected boolean methodExitEnabled(Code)
Is method exit join point activated?



methodGen
protected MethodGen methodGen(Code)
BCEL method generator used during the weaving process.



modified
protected boolean modified(Code)
Is a re-weaving of the method in this weaver necessary?



originalCode
protected byte[] originalCode(Code)
Original bytecode of `target'.



redefineAdvice
protected Method redefineAdvice(Code)
Redefine advice method.



target
protected Method target(Code)
Method bound to this weaver.



targetClass
protected Class targetClass(Code)
Declaring class of `target'.



targetId
protected int targetId(Code)
Method identifier;



verifyBytecodes
final protected static boolean verifyBytecodes(Code)
Should the bytecodes be verified before installing them into the VM?



weavers
protected static Map weavers(Code)
Collection of all method weavers. For each method there exists exactly one method weaver in the system.



woven
protected boolean woven(Code)
Was the method in this weaver woven at least once?




Constructor Detail
MethodWeaver
protected MethodWeaver(Method target)(Code)
Create a new method weaver. Use the static method MethodWeaver.getWeaver(Method) to obtain a weaver.
Parameters:
  target - method that will be woven




Method Detail
addFieldAccessor
public void addFieldAccessor(java.lang.reflect.Field f)(Code)
Add a field for which a callback should be woven (for each access).
Parameters:
  f - watched field



addFieldModifier
public void addFieldModifier(java.lang.reflect.Field f)(Code)
Add a field for which a callback should be woven (for each modification).
Parameters:
  f - watched field



checkVerificationResult
protected void checkVerificationResult(VerificationResult vr, String pass)(Code)
Check bytecode verification result.
Parameters:
  vr - verification result which must be checked
Parameters:
  pass - verification pass



commit
public static synchronized void commit()(Code)
Re-weave all modified methods and activate them in the VM.



createFieldAdviceCallback
protected InstructionList createFieldAdviceCallback(String callbackMethod, VM_Field field)(Code)
Create a field advice callback that can be woven.
Parameters:
  callbackMethod - method that will be called
Parameters:
  fieldId - id of field instructions that make up the callback



createMethodAdviceCallback
protected InstructionList createMethodAdviceCallback(String callbackMethod)(Code)
Create a method advice callback that can be woven.
Parameters:
  callbackMethod - method that will be called instructions that make up the callback



debugString
public String debugString()(Code)



finishWeaving
protected void finishWeaving()(Code)
Clean up weaving process.



getWeaver
public static synchronized MethodWeaver getWeaver(Method target)(Code)
Get a unique method weaver for `target'.
Parameters:
  target - method that will be woven



initWeaving
protected void initWeaving()(Code)
Prepare for weaving by initializing the corresponding fields.



installBytecode
protected void installBytecode()(Code)
Install bytecode of woven method into the VM.



loadArg
protected void loadArg(InstructionList il, Type type, int index)(Code)
Load argument at `index' of type `type'. Basic types are wrapped.
Parameters:
  il - list where instructions are appended
Parameters:
  type - argument type
Parameters:
  index - argument index



loadArgs
protected void loadArgs(InstructionList il)(Code)
Load all arguments.
Parameters:
  il - list where instructions are appended



removeFieldAccessor
public void removeFieldAccessor(java.lang.reflect.Field f)(Code)
Remove a field for which a callback was woven (for each access).
Parameters:
  f - watched field



removeFieldModifier
public void removeFieldModifier(java.lang.reflect.Field f)(Code)
Remove a field for which a callback was woven (for each modification).
Parameters:
  f - watched field



resetAll
public static synchronized void resetAll()(Code)
Reset all woven methods.



setMethodEntryEnabled
public void setMethodEntryEnabled(boolean flag)(Code)
Enable method entry join point.
Parameters:
  flag - enable/disable



setMethodExitEnabled
public void setMethodExitEnabled(boolean flag)(Code)
Enable method entry join point.
Parameters:
  flag - enable/disable



setRedefineAdvice
public void setRedefineAdvice(Method advice)(Code)
Redefine the method in this weaver.
Parameters:
  advice - method that will be called instead



verify
protected void verify(ConstantPool cp, org.apache.bcel.classfile.Method bm)(Code)
Verify bytecodes with the BCEL verifier.

NOTE: Can't be used since even `normal' classes are rejected with Jikes RVM 2.3.0.1.
Parameters:
  cp - constant pool that is used for verification
Parameters:
  bm - method that is verified




weave
protected void weave()(Code)
Weave advice that are associated with the method in this weaver.



weaveFieldAdvice
protected void weaveFieldAdvice()(Code)
Weave all registered field accesses/modifications.



weaveMethodEntryAdvice
protected void weaveMethodEntryAdvice()(Code)
Weave method entry advice callback into method body.



weaveMethodExitAdvice
protected void weaveMethodExitAdvice()(Code)
Weave method exit advice callback into method body.



weaveRedefineAdvice
protected void weaveRedefineAdvice()(Code)
Weave method redefine advice callback into method body and remove original 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.