Java Doc for CompilationManager.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » cm » 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 » Ajax » Laszlo 4.0.10 » org.openlaszlo.cm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.openlaszlo.cache.Cache
      org.openlaszlo.cm.CompilationManager

CompilationManager
public class CompilationManager extends Cache (Code)
A CompilationManager is responsible for maintaining the correspondence between source and object files. It's responsible for dependency analysis, caching, and selective recompilation. The main entry point to the Compilationmanager code is getObjectStream A CompilationManager is constructed with a source directory, where it looks for source files, and a cache directory, where it places compiled object files and cached (dependency) information. It can be instructed to always recompile files, never recompile them so long as they exist, or use dependency information that it creates during the course of a file compilation to determine whether a file is out of date. See the documentation for getProperty() for a description of how to select between these behaviors. The compilation manager currently uses itself to represent the cache, and methods that access the cache are synchronized. This would have to change to support multiple readers. Methods that trigger recompilation are synchronized: it's safe for multiple threads to contain references to a compilation manager if they are only using it to compile. Accessor methods should only be called single-threaded. Two compilation managers shouldn't be pointed at the same cache directory.


Field Summary
final public static  StringRECOMPILE
    
protected  FilemCacheDirectory
     See the constructor.
protected  FilemLPSJarFile
    
protected  CompilerMediaCachemMediaCache
    
protected  PropertiesmProperties
     See getProperties.
protected  FilemSourceDirectory
     See the constructor.

Constructor Summary
public  CompilationManager(File sourceDirectory, File cacheDirectory, Properties props)
     Creates a new CompilationManager instance.

Method Summary
protected  voidafterCacheRead(Object metaData)
    
public  booleanclearCacheDirectory()
     Clear the cache.
public synchronized  voidcompileItem(Item item, String pathname, Properties compilationProperties)
     Compiles the file named by pathname and leaves the result in the cached item.
static  SerializablecomputeKey(String pathname, Properties props)
    
public synchronized  voidconvertItemEncoding(Item src, Item dest, String pathname, String enc, Properties props)
    
public  FilegetCacheSourcePath(String srcName, String webappPath)
     Given the pathname of a file, return a file name for an "source" version of this file that lives in the cache.
public synchronized  CanvasgetCanvas(String pathname)
    
public synchronized  CanvasgetCanvas(String pathname, Properties props)
    
public  CompilerMediaCachegetCompilerMediaCache()
    
public synchronized  StringgetInfoXML(String pathname, Properties props)
    
public synchronized  ItemgetItem(String pathname, Properties props)
     Get the cached item.
public synchronized  longgetLastModified(String pathname, Properties props)
    
public synchronized  FilegetObjectFile(String pathname, Properties props)
     Returns a File containing the compiled form of the file named by pathname, suitable play on the client.
public synchronized  InputStreamgetObjectStream(String pathname, Properties props)
     Returns an InputStream containing the compiled form of the file named by pathname, suitable play on the client.
public  PropertiesgetProperties()
     Miscellaneous properties.
public synchronized  InputStreamgetScriptStream(String pathname, Properties props)
     Returns an InputStream containing the script form of the file named by pathname, suitable play on the client.
public  booleanisItemUpToDate(Item item, String pathname, Properties props)
     true if the item is up to date
Parameters:
  pathname - a String value.
public  voidsetProperty(String key, String value)
    
public  voidsetSourceDirectory(File sourceDirectory)
     Sets the source directory.

Field Detail
RECOMPILE
final public static String RECOMPILE(Code)



mCacheDirectory
protected File mCacheDirectory(Code)
See the constructor.



mLPSJarFile
protected File mLPSJarFile(Code)



mMediaCache
protected CompilerMediaCache mMediaCache(Code)
Cache for compiled media



mProperties
protected Properties mProperties(Code)
See getProperties.



mSourceDirectory
protected File mSourceDirectory(Code)
See the constructor.




Constructor Detail
CompilationManager
public CompilationManager(File sourceDirectory, File cacheDirectory, Properties props) throws IOException(Code)
Creates a new CompilationManager instance.
Parameters:
  sourceDirectory - a File naming a directory,that is used as a base for resolving relative names that arepassed to getObjectData.
Parameters:
  cacheDirectory - a File naming a directory.The CompilationManager places object files anddependency-tracking information here, to avoid unnecessarysubsequent recompilation.




Method Detail
afterCacheRead
protected void afterCacheRead(Object metaData)(Code)



clearCacheDirectory
public boolean clearCacheDirectory()(Code)
Clear the cache. true if full removal of cache was successful, otherwise false.



compileItem
public synchronized void compileItem(Item item, String pathname, Properties compilationProperties) throws CompilationError(Code)
Compiles the file named by pathname and leaves the result in the cached item. If the file can't be compiled and debugCompilationErrors is true, returns an HTML document describing the error; otherwise, passes the exception.
Parameters:
  pathname - a String value. Ifpathname is relative, it is resolved relative to theCompilationManager's sourceDirectory.
Parameters:
  props - properties that affect the compile. the bytes of the object file
exception:
  CompilationError - if an error occursThe PROPS parameter may contain
  • "Content-Encoding" => the encoding of the output (ignore if null)



computeKey
static Serializable computeKey(String pathname, Properties props)(Code)
a cache key for the given compile



convertItemEncoding
public synchronized void convertItemEncoding(Item src, Item dest, String pathname, String enc, Properties props)(Code)
Take source item, un-encode it, and then re-encode and store in dest item with the specified encoding
Parameters:
  src - - source item
Parameters:
  dest - - dest item
Parameters:
  pathname - - pathname for destination item
Parameters:
  enc - - encoding for dest
Parameters:
  props - - properties for compileFor now, hardcoded to only support gzip.



getCacheSourcePath
public File getCacheSourcePath(String srcName, String webappPath)(Code)
Given the pathname of a file, return a file name for an "source" version of this file that lives in the cache.
Parameters:
  srcName - path to file in source directory
Parameters:
  webappPath - real path for web application a File



getCanvas
public synchronized Canvas getCanvas(String pathname) throws CompilationError, IOException(Code)
the canvas for this app



getCanvas
public synchronized Canvas getCanvas(String pathname, Properties props) throws CompilationError, IOException(Code)
Return the canvas associated with the given LZX file the canvas
Parameters:
  pathname - path to the LZX file
Parameters:
  props - props for dependency tracker and compiler
throws:
  CompilationError - if there is a compilation errorin the file



getCompilerMediaCache
public CompilerMediaCache getCompilerMediaCache()(Code)
Returns the media cache for the compilation manager



getInfoXML
public synchronized String getInfoXML(String pathname, Properties props) throws CompilationError, IOException(Code)
a String containing XML info about this app



getItem
public synchronized Item getItem(String pathname, Properties props) throws IOException(Code)
Get the cached item. Recompile or convert encoding as needed.
Parameters:
  pathname - path to the LZX file
Parameters:
  props - params for compiler



getLastModified
public synchronized long getLastModified(String pathname, Properties props) throws CompilationError, IOException(Code)
Return the last modified time associated with the given LZX file the last modified time in utc
Parameters:
  pathname - path to the LZX file
Parameters:
  props - params for dependency tracker and compiler
throws:
  CompilationError - if there is a compilation errorin the file



getObjectFile
public synchronized File getObjectFile(String pathname, Properties props) throws CompilationError, IOException(Code)
Returns a File containing the compiled form of the file named by pathname, suitable play on the client.
Parameters:
  pathname - a String value. Ifpathname is relative, it is resolved relative to theCompilationManager's sourceDirectory.
Parameters:
  props - params for dependency tracker and compiler the compiled File object.
exception:
  CompilationError - if an error occurs.



getObjectStream
public synchronized InputStream getObjectStream(String pathname, Properties props) throws CompilationError, IOException(Code)
Returns an InputStream containing the compiled form of the file named by pathname, suitable play on the client.
Parameters:
  pathname - a String value. Ifpathname is relative, it is resolved relative to theCompilationManager's sourceDirectory.
Parameters:
  props - params for dependency tracker and compiler the compiled File object.
exception:
  CompilationError - if an error occurs.



getProperties
public Properties getProperties()(Code)
Miscellaneous properties.
recompile=always
Always recompile object files, regardless of whether source files have changed.
recompile=never
Never recompile object files.
recompile=check (default)
Recompile an object file if a source file that it depends on has changed.
Additionally, if getProperties().getProperty("compiler." + key) == value, then files are compiled with a compiler such that compiler.getProperty(key) == value. a Properties



getScriptStream
public synchronized InputStream getScriptStream(String pathname, Properties props) throws CompilationError, IOException(Code)
Returns an InputStream containing the script form of the file named by pathname, suitable play on the client.
Parameters:
  pathname - a String value. Ifpathname is relative, it is resolved relative to theCompilationManager's sourceDirectory.
Parameters:
  props - params for dependency tracker and compiler the compiled File object.
exception:
  CompilationError - if an error occurs.



isItemUpToDate
public boolean isItemUpToDate(Item item, String pathname, Properties props) throws CompilationError(Code)
true if the item is up to date
Parameters:
  pathname - a String value. Ifpathname is relative, it is resolved relative to theCompilationManager's sourceDirectory.
Parameters:
  props - properties that affect the compile. the bytes of the object file
exception:
  CompilationError - if an error occursThe PROPS parameter may contain
  • "Content-Encoding" => the encoding of the output (ignore if null)
NOTE: can remove the recompile property from props



setProperty
public void setProperty(String key, String value)(Code)



setSourceDirectory
public void setSourceDirectory(File sourceDirectory)(Code)
Sets the source directory. This is the directory within which source files will be searched for.
Parameters:
  sourceDirectory - a File



Fields inherited from org.openlaszlo.cache.Cache
final public String DEFAULT_DISK_MAX(Code)(Java Doc)
final public String DEFAULT_MEM_ITEM_MAX(Code)(Java Doc)
final public String DEFAULT_MEM_MAX(Code)(Java Doc)

Methods inherited from org.openlaszlo.cache.Cache
protected void afterCacheRead(Object metaData)(Code)(Java Doc)
public synchronized boolean clearCache()(Code)(Java Doc)
public synchronized void dumpXML(StringBuffer buf, String name, boolean details)(Code)(Java Doc)
protected synchronized Item findItem(Serializable key, String enc, boolean doLockAndLeaveActive) throws IOException(Code)(Java Doc)
public synchronized long getDiskSize()(Code)(Java Doc)
protected synchronized Item getItem(Serializable key)(Code)(Java Doc)
public synchronized long getMaxDiskSize()(Code)(Java Doc)
public synchronized long getMaxMemSize()(Code)(Java Doc)
public synchronized long getMemSize()(Code)(Java Doc)
public synchronized void setMaxDiskSize(long size)(Code)(Java Doc)
public synchronized void setMaxMemSize(long size)(Code)(Java Doc)
protected synchronized void updateCache(Item item)(Code)(Java Doc)
protected synchronized void updateCacheAndDeactivateItem(Item item)(Code)(Java Doc)
public synchronized void updateMapsAndReckonItems(boolean clearAll)(Code)(Java Doc)

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.