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


java.lang.Object
   org.codehaus.aspectwerkz.compiler.AspectWerkzC

AspectWerkzC
public class AspectWerkzC (Code)
AspectWerkzC allow for precompilation of class / jar / zip given a class preprocessor.

Usage

 java [-Daspectwerkz.classloader.preprocessor={ClassPreProcessorImpl}] -cp [...]
 org.codehaus.aspectwerkz.compiler.AspectWerkzC [-verbose] [-haltOnError] [-verify] [-genjp] [-details] [-cp {additional cp i}]*  {target
 1} .. {target n}
 {ClassPreProcessorImpl} : full qualified name of the ClassPreProcessor implementation (must be in classpath)
 defaults to org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor
 {additional cp i} : additionnal classpath needed at compile time (eg: myaspect.jar)
 use as many -cp options as needed
 supports java classpath syntax for classpath separator: ; on windows, : on others
 {target i} : exploded dir, jar, zip files to compile
 Ant 1.5 must be in the classpath
 

Classpath note

At the beginning of the compilation, all {target i} are added to the classpath automatically.
This is required to support caller side advices.

Error handling

For each target i, a backup copy is written in ./_aspectwerkzc/i/target
Transformation occurs on original target class/dir/jar/zip file
On failure, target backup is restored and stacktrace is given

If -haltOnError was set, compilations ends and a complete rollback occurs on all targets, else a status report is printed at the end of the compilation, indicating SUCCESS or ERROR for each given target.
If -verify was set, all compiled class are verified during the compilation and an error is generated if the compiled class bytecode is corrupted. The error is then handled according to the -haltOnError option.

Manifest.mf update

The Manifest.mf if present is updated wit the following:
  • AspectWerkzC-created: date of the compilation
  • AspectWerkzC-preprocessor: full qualified classname of the preprocessor used
  • AspectWerkzC-comment: comments

author:
   Alexandre Vasseur



Constructor Summary
public  AspectWerkzC()
    

Method Summary
public  voidbackup(File source, int index)
     Backup source file in backup_dir/index/file.
public  booleancompile(File source)
     Compile given target.
public static  voidcompile(AspectWerkzC compiler, ClassLoader classLoader, String preProcessor, List classpath, List targets)
     Runs the AspectWerkzC compiler for the targets files.
public  voidcompileClass(File file, String packaging)
    
public  voidcompileJar(File file)
     Compile all .class encountered in the .jar/.zip file.
public  voiddoCompile(File sourceFile, String prefixPackage)
     Compile sourceFile.
public static  voiddoHelp()
    
public  UtilitygetUtility()
    
public static  booleanisJarFile(File source)
    
public static  voidmain(String[] args)
    
public  voidpostCompile(String message)
    
public  voidrestoreBackup()
    
public  voidsetBackupDir(String backup)
    
public  voidsetCompilationPath(File[] targets, ClassLoader parentLoader)
    
public  voidsetDetails(boolean details)
    
public  voidsetGenJp(boolean genpJp)
    
public  voidsetHaltOnError(boolean haltOnError)
    
public  voidsetPreprocessor(String preprocessor)
     Sets the ClassPreProcessor implementation to use.
public  voidsetVerbose(boolean verbose)
    
public  voidsetVerify(boolean verify)
    


Constructor Detail
AspectWerkzC
public AspectWerkzC()(Code)
Construct a new Utility, restore the index for backup




Method Detail
backup
public void backup(File source, int index)(Code)
Backup source file in backup_dir/index/file. The backupMap is updated for further rollback



compile
public boolean compile(File source)(Code)
Compile given target. false if process should stop



compile
public static void compile(AspectWerkzC compiler, ClassLoader classLoader, String preProcessor, List classpath, List targets)(Code)
Runs the AspectWerkzC compiler for the targets files.
Parameters:
  compiler - a configured AspectWerkzC
Parameters:
  classLoader - the class loader to be used
Parameters:
  preProcessor - fully qualified name of the preprocessor class.If null than the default is used(org.codehaus.aspectwerkz.transform.AspectWerkzPreProcessor)
Parameters:
  classpath - list of Files representing the classpath (List)
Parameters:
  targets - the list of target files (List)



compileClass
public void compileClass(File file, String packaging) throws CompileException(Code)
Compiles .class file using fileName as className and given packaging as package name



compileJar
public void compileJar(File file) throws CompileException(Code)
Compile all .class encountered in the .jar/.zip file.

The target.jar is compiled in the target.jar.aspectwerkzc and the target.jar.aspectwerkzc then overrides target.jar on success.




doCompile
public void doCompile(File sourceFile, String prefixPackage) throws CompileException(Code)
Compile sourceFile. If prefixPackage is not null, assumes it is the class package information.

Handles :

  • directory recursively (exploded jar)
  • jar / zip file



doHelp
public static void doHelp()(Code)
Usage message



getUtility
public Utility getUtility()(Code)



isJarFile
public static boolean isJarFile(File source)(Code)
Test if file is a zip/jar file



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



postCompile
public void postCompile(String message)(Code)
Delete backup dir at the end of all compilation



restoreBackup
public void restoreBackup()(Code)
Restore the backup registered



setBackupDir
public void setBackupDir(String backup)(Code)



setCompilationPath
public void setCompilationPath(File[] targets, ClassLoader parentLoader)(Code)
Set up the compilation path by building a URLClassLoader with all targets in
Parameters:
  targets - to add to compilationLoader classpath
Parameters:
  parentLoader - the parent ClassLoader used by the new one



setDetails
public void setDetails(boolean details)(Code)



setGenJp
public void setGenJp(boolean genpJp)(Code)



setHaltOnError
public void setHaltOnError(boolean haltOnError)(Code)



setPreprocessor
public void setPreprocessor(String preprocessor) throws CompileException(Code)
Sets the ClassPreProcessor implementation to use.

The ClassLoader will be set to System ClassLoader when transform(className, byteCode, callerClassLoader) will be called to compile a class.




setVerbose
public void setVerbose(boolean verbose)(Code)



setVerify
public void setVerify(boolean verify)(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.