|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClassLoaderWriter
A class loader writer is a service allowing to dynamically generate classes and resources. It provides methods for writing, removing, and moving resources. In addition it provides a dynamic class loader which can be used to dynamically load generated classes. For example a class loader writer could write generated class files into the repository or the temporary file system.
| Method Summary | |
|---|---|
boolean |
delete(String path)
Delete the class/resource |
ClassLoader |
getClassLoader()
Get a dynamic class loader. |
InputStream |
getInputStream(String path)
Get the input stream for a class or resource handled by the underlying class loader. |
long |
getLastModified(String path)
Return the last modified for the class or resource. |
OutputStream |
getOutputStream(String path)
Get the output stream for a class or resource handled by the underlying class loader. |
boolean |
rename(String oldPath,
String newPath)
Rename a class/resource. |
| Method Detail |
|---|
OutputStream getOutputStream(String path)
path - The path of the class/resource. The path should be
absolute like /com/my/domain/HelloWorld.class
InputStream getInputStream(String path)
throws IOException
path - The path of the class/resource. The path should be
absolute like /com/my/domain/HelloWorld.class
IOException - If the resource/class does not exist.long getLastModified(String path)
path - The path of the class/resource. The path should be
absolute like /com/my/domain/HelloWorld.class
-1 if
the information can't be detected.boolean delete(String path)
path - The path of the class/resource. The path should be
absolute like /com/my/domain/HelloWorld.class
true if the resource exists and could be deleted,
false otherwise.
boolean rename(String oldPath,
String newPath)
oldPath - The path of the class/resource.newPath - The new path.
true if the renaming has been successful.ClassLoader getClassLoader()
DynamicClassLoaderManager.
The class loader returned by this method should not be cached, as it might
get stale (e.g. used classes are removed etc.). Therefore each time a newly
generated class is loaded, the class loader should be fetched again using
this method.
The implementation might cache the class loader and return the same loader
on subsequent calls for as long as possible.
Clients of the class loader can use the DynamicClassLoader.isLive()
method to check if the fetched instance can still be used.
DynamicClassLoader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||