|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jodd.util.RuntimeJavaSourceLoader
public class RuntimeJavaSourceLoader
Manager for JavaSourceClassLoader
: loading java sources transparently into the VM.
When class is requested, it will be loaded using new instance of JavaSourceClassLoader
.
Non-aggressive mode is used, which means that only the request class is loaded with this classloader,
all depended class are loaded with parent (default) classloader).
By default, RuntimeJavaSourceLoader
monitors specified source folder for source file changes
(using FileMonitor
).
If some source file is changed, class will be recompiled and reloaded and registered listener will be invoked.
Nested Class Summary | |
---|---|
static interface |
RuntimeJavaSourceLoader.ChangeListener
Listener for class changes, invoked after the class reload. |
Field Summary | |
---|---|
protected java.util.Map<java.lang.String,jodd.util.RuntimeJavaSourceLoader.Data> |
allClasses
|
protected java.util.Map<java.io.File,jodd.util.RuntimeJavaSourceLoader.Data> |
allSources
|
protected RuntimeJavaSourceLoader.ChangeListener |
changeListener
|
protected boolean |
debugInfo
|
protected java.lang.String |
destinationFolder
|
protected java.lang.String |
encoding
|
protected FileChangeListener |
fileChangeListener
|
protected FileMonitor |
fileMonitor
|
protected long |
refreshPeriod
|
protected java.lang.String |
sourceFolder
|
Constructor Summary | |
---|---|
RuntimeJavaSourceLoader(java.lang.String sourceFolder)
|
|
RuntimeJavaSourceLoader(java.lang.String sourceFolder,
long refreshPeriod)
|
Method Summary | |
---|---|
void |
attach(java.lang.Class clazz)
Attaches class sources for monitoring. |
void |
attach(java.lang.String className)
Attaches class sources for monitoring. |
protected java.lang.Class |
classForName(java.lang.String className,
boolean forced)
|
java.lang.String |
getDestinationFolder()
|
java.lang.String |
getEncoding()
|
java.lang.String |
getSourceFolder()
|
boolean |
isDebugInfo()
|
java.lang.Class |
loadClass(java.lang.String className)
Loads new class from its source files. |
protected jodd.util.RuntimeJavaSourceLoader.Data |
register(java.lang.String className)
|
void |
registerChangeListener(RuntimeJavaSourceLoader.ChangeListener listener)
Registeres new change listener. |
protected void |
reloadClass(jodd.util.RuntimeJavaSourceLoader.Data data)
|
java.lang.Class |
reloadClass(java.lang.String className)
Reloads new class. |
void |
setDebugInfo(boolean debugInfo)
Specifies if debug information should be added during compilation. |
void |
setDestinationFolder(java.lang.String destinationFolder)
Specifies destination folder where classes will be compiled to. |
void |
setEncoding(java.lang.String encoding)
Specifies encoding of java source files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final java.lang.String sourceFolder
protected java.lang.String destinationFolder
protected boolean debugInfo
protected java.lang.String encoding
protected final long refreshPeriod
protected final FileMonitor fileMonitor
protected final FileChangeListener fileChangeListener
protected final java.util.Map<java.lang.String,jodd.util.RuntimeJavaSourceLoader.Data> allClasses
protected final java.util.Map<java.io.File,jodd.util.RuntimeJavaSourceLoader.Data> allSources
protected RuntimeJavaSourceLoader.ChangeListener changeListener
Constructor Detail |
---|
public RuntimeJavaSourceLoader(java.lang.String sourceFolder, long refreshPeriod)
public RuntimeJavaSourceLoader(java.lang.String sourceFolder)
Method Detail |
---|
public java.lang.String getSourceFolder()
public java.lang.String getDestinationFolder()
public void setDestinationFolder(java.lang.String destinationFolder)
public boolean isDebugInfo()
public void setDebugInfo(boolean debugInfo)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
public java.lang.Class loadClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public java.lang.Class reloadClass(java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void attach(java.lang.Class clazz)
public void attach(java.lang.String className)
protected jodd.util.RuntimeJavaSourceLoader.Data register(java.lang.String className)
protected java.lang.Class classForName(java.lang.String className, boolean forced) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected void reloadClass(jodd.util.RuntimeJavaSourceLoader.Data data) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void registerChangeListener(RuntimeJavaSourceLoader.ChangeListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |