Java Doc for ProcessStarter.java in  » Aspect-oriented » aspectwerkz-2.0 » org » codehaus » aspectwerkz » hook » 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 » Aspect oriented » aspectwerkz 2.0 » org.codehaus.aspectwerkz.hook 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.aspectwerkz.hook.ProcessStarter

ProcessStarter
public class ProcessStarter (Code)
ProcessStarter uses JPDA JDI api to start a VM with a runtime modified java.lang.ClassLoader, or transparently use a Xbootclasspath style (java 1.3 detected or forced)

Important note

Due to a JPDA issue in LauchingConnector, this implementation is based on Process forking. If Xbootclasspath is not used the target VM is started with JDWP options transport=dt_socket,address=9300 unless other specified.
It is possible after the short startup sequence to attach a debugger or any other JPDA attaching connector. It has been validated against a WebLogic 7 startup and is the must use implementation.

Implementation Note

See http://java.sun.com/products/jpda/
See http://java.sun.com/j2se/1.4.1/docs/guide/jpda/jdi/index.html

For java 1.3, it launch the target VM using a modified java.lang.ClassLoader by generating it and putting it in the bootstrap classpath of the target VM. The java 1.3 version should only be run for experimentation since it breaks the Java 2 Runtime Environment binary code license by overriding a class of rt.jar

For java 1.4, it hotswaps java.lang.ClassLoader with a runtime patched version, wich is compatible with the Java 2 Runtime Environment binary code license. For JVM not supporting the class hotswapping, the same mechanism as for java 1.3 is used.

Usage

Use it as a replacement of "java" :
java [target jvm option] [target classpath] targetMainClass [targetMainClass args]
should be called like:
java [jvm option] [classpath] org.codehaus.aspectwerkz.hook.ProcessStarter [target jvm option] [target classpath] targetMainClass [targetMainClass args]
[classpath] must contain %JAVA_HOME%/tools.jar for HotSwap support
[target jvm option] can contain JDWP options, transport and address are preserved if specified.

Options

[classpath] must contain %JAVA_HOME%/tools.jar and the jar you want for bytecode modification (asm, bcel, ...)
The java.lang.ClassLoader is patched using the -Daspectwerkz.classloader.clpreprocessor=... in [jvm option]. Specify the FQN of your implementation of hook.ClassLoaderPreProcessor. See org.codehaus.aspectwerkz.hook.ClassLoaderPreProcessor If not given, the default AspectWerkz layer 1 ASM implementation hook.impl.* is used, which is equivalent to -Daspectwerkz.classloader.clpreprocessor=org.codehaus.aspectwerkz.hook.impl.ClassLoaderPreProcessorImpl
Use -Daspectwerkz.classloader.wait=2 in [jvm option] to force a pause of 2 seconds between process fork and JPDA connection for HotSwap. Defaults to no wait.

Disabling HotSwap

You disable HotSwap and thus force the use of -Xbootclasspath (like in java 1.3 mode) and specify the directory where the modified class loader bytecode will be stored using in [jvm option] -Daspectwerkz.classloader.clbootclasspath=.... Specify the directory where you want the patched java.lang.ClassLoader to be stored. Default is "./_boot". The directory is created if needed (with the subdirectories corresponding to package names).
The directory is automatically incorporated in the -Xbootclasspath option of [target jvm option].
You shoud use this option mainly for debuging purpose, or if you need to start different jvm with different classloader preprocessor implementations.

Option for AspectWerkz layer 1 ASM implementation

When using the default AspectWerkz layer 1 ASM implementation org.codehaus.aspectwerkz.hook.impl.ClassLoaderPreProcessorImpl, java.lang.ClassLoader is modified to call a class preprocessor at each class load (except for class loaded by the bootstrap classloader).
The effective class preprocessor is defined with -Daspectwerkz.classloader.preprocessor=... in [target jvm option]. Specify the FQN of your implementation of org.codehaus.aspectwerkz.hook.ClassPreProcessor interface.
If this parameter is not given, the default AspectWerkz layer 2 org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor is used.


author:
   Alexandre Vasseur


Field Summary
final static  StringCL_PRE_PROCESSOR_CLASSNAME_PROPERTY
    


Method Summary
public static  voidmain(String[] args)
    
public  String[]parseJavaCommandLine(String[] args)
    
public static  StringremoveEmbracingQuotes(String s)
    

Field Detail
CL_PRE_PROCESSOR_CLASSNAME_PROPERTY
final static String CL_PRE_PROCESSOR_CLASSNAME_PROPERTY(Code)
option for classloader preprocessor target





Method Detail
main
public static void main(String[] args)(Code)



parseJavaCommandLine
public String[] parseJavaCommandLine(String[] args)(Code)
Analyse the args[] as a java command line
Parameters:
  args - String[] [0]:jvm options except -cp|-classpath, [1]:classpath without -cp, [2]: mainClass + mainOptions



removeEmbracingQuotes
public static String removeEmbracingQuotes(String s)(Code)
Remove first and last " or ' if any
Parameters:
  s - string to handle s whitout first and last " or ' if any



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.