|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.loader.Loader
com.caucho.loader.CompilingLoader
public class CompilingLoader
A class loader that automatically compiles Java.
Constructor Summary | |
---|---|
CompilingLoader()
|
|
CompilingLoader(java.lang.ClassLoader loader)
|
|
CompilingLoader(java.lang.ClassLoader loader,
Path classDir)
Creates a new compiling class loader |
|
CompilingLoader(java.lang.ClassLoader loader,
Path classDir,
Path sourceDir,
java.lang.String args,
java.lang.String encoding)
Creates a new compiling class loader |
Method Summary | |
---|---|
void |
addArg(java.lang.String arg)
Adds an argument. |
protected void |
buildClassPath(java.util.ArrayList<java.lang.String> pathList)
Adds the classpath we're responsible for to the classpath |
static DynamicClassLoader |
create(java.lang.ClassLoader parent,
Path classDir,
Path sourceDir,
java.lang.String args,
java.lang.String encoding)
Creates a new compiling class loader |
static DynamicClassLoader |
create(Path path)
Create a class loader based on the compiling loader |
protected ClassEntry |
getClassEntry(java.lang.String name,
java.lang.String pathName)
Loads the specified class, compiling if necessary. |
java.lang.String |
getClassPath()
|
protected java.security.CodeSource |
getCodeSource(Path path)
Returns the code source for the directory. |
protected long |
getHashCrc(long crc64)
|
Path |
getPath()
Gets the class path. |
Path |
getPath(java.lang.String name)
Returns the path for the given name. |
Path |
getSource()
Sets the source path. |
void |
init()
Initialize. |
boolean |
isDirectoryLoader()
|
void |
make()
Compiles all changed files in the class directory. |
protected java.lang.String |
prefixClassPath(java.lang.String tail)
|
void |
setArgs(java.lang.String arg)
Sets the arguments. |
void |
setBatch(boolean isBatch)
Sets true if compilation should batch as many files as possible. |
void |
setCompiler(java.lang.String compiler)
Sets the compiler. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding. |
void |
setPath(Path path)
Sets the class path. |
void |
setRequireSource(boolean requireSource)
Sets true if source is required. |
void |
setSource(Path path)
Sets the source path. |
void |
setSourceExtension(java.lang.String ext)
Sets the source extension. |
java.lang.String |
toString()
|
Methods inherited from class com.caucho.loader.Loader |
---|
buildSourcePath, destroy, getClassLoader, getResource, getResourceAsStream, getResources, loadClass, setLoader, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CompilingLoader()
public CompilingLoader(java.lang.ClassLoader loader)
public CompilingLoader(java.lang.ClassLoader loader, Path classDir)
classDir
- generated class directory rootpublic CompilingLoader(java.lang.ClassLoader loader, Path classDir, Path sourceDir, java.lang.String args, java.lang.String encoding)
classDir
- generated class directory rootsourceDir
- Java source directory rootargs
- Javac argumentsencoding
- javac encodingMethod Detail |
---|
public static DynamicClassLoader create(Path path)
path
- traditional classpath
public void setPath(Path path)
public Path getPath()
public void setSource(Path path)
public void setSourceExtension(java.lang.String ext) throws ConfigException
ConfigException
public void setCompiler(java.lang.String compiler) throws ConfigException
ConfigException
public Path getSource()
public void setArgs(java.lang.String arg)
public void addArg(java.lang.String arg)
public void setEncoding(java.lang.String encoding)
public void setRequireSource(boolean requireSource)
public void setBatch(boolean isBatch)
public boolean isDirectoryLoader()
isDirectoryLoader
in class Loader
@PostConstruct public void init() throws ConfigException
init
in class Loader
ConfigException
public static DynamicClassLoader create(java.lang.ClassLoader parent, Path classDir, Path sourceDir, java.lang.String args, java.lang.String encoding)
classDir
- generated class directory rootsourceDir
- Java source directory rootargs
- Javac argumentsencoding
- javac encodingpublic java.lang.String getClassPath()
public void make() throws java.io.IOException, java.lang.ClassNotFoundException
make
in interface Make
java.io.IOException
java.lang.ClassNotFoundException
protected ClassEntry getClassEntry(java.lang.String name, java.lang.String pathName) throws java.lang.ClassNotFoundException
getClassEntry
in class Loader
name
- name of the class
java.lang.ClassNotFoundException
protected java.security.CodeSource getCodeSource(Path path)
getCodeSource
in class Loader
public Path getPath(java.lang.String name)
getPath
in class Loader
name
- the name of the classprotected long getHashCrc(long crc64)
getHashCrc
in class Loader
protected void buildClassPath(java.util.ArrayList<java.lang.String> pathList)
buildClassPath
in class Loader
head
- the overriding classpathprotected java.lang.String prefixClassPath(java.lang.String tail)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |