public static class LayeredClassLoader.Builder extends Object
LayeredClassLoader
.Constructor and Description |
---|
Builder()
constructor.
|
Modifier and Type | Method and Description |
---|---|
LayeredClassLoader |
buildFromCodeLayers()
builds a new instance of
LayeredClassLoader
based on already compiled code layers. |
LayeredClassLoader |
buildFromSourcesLayers()
builds a new instance of
LayeredClassLoader
based on sources to compile to code layers. |
List<Code> |
getCodeLayers()
gets the code layers.
|
LoadMode |
getLoadMode()
gets the load mode for the (static) code layers.
|
ClassLoader |
getParent()
gets the parent class loader.
|
List<Sources> |
getSourcesLayers()
gets the sources layers.
|
TopCodeCache |
getTopCodeCache()
gets the top code cache.
|
LoadMode |
getTopLoadMode()
gets the top load mode.
|
boolean |
isWithTopCodeCache()
gets whether to use the a top code cache or not.
|
LayeredClassLoader.Builder |
setCodeLayers(Code... codeLayers)
sets the code layers, default is no layers.
|
LayeredClassLoader.Builder |
setCodeLayers(List<Code> codeLayers)
sets the code layers, default is no layers.
|
LayeredClassLoader.Builder |
setLoadMode(LoadMode loadMode)
sets the load mode for the (static) code layers, default is "current first".
|
LayeredClassLoader.Builder |
setParent(ClassLoader parent)
sets the parent class loader, default is the context class loader
of the current thread.
|
LayeredClassLoader.Builder |
setSourcesLayers(List<Sources> sourcesLayers)
sets the sources layers, default is no layers.
|
LayeredClassLoader.Builder |
setSourcesLayers(Sources... sourcesLayers)
sets the sources layers, default is no layers.
|
LayeredClassLoader.Builder |
setTopLoadMode(LoadMode topLoadMode)
sets the load mode for the top code cache, default is "parent first".
|
LayeredClassLoader.Builder |
setWithTopCodeCache(boolean isWithTopCodeCache,
TopCodeCache topCodeCache)
sets whether to use the a top code cache or not,
along with the top code cache (OK to pass null if setting to false),
default is not to use a top code cache.
|
public LayeredClassLoader.Builder setParent(ClassLoader parent)
parent
- parent class loaderpublic LayeredClassLoader.Builder setLoadMode(LoadMode loadMode)
loadMode
- load mode for the (static) code layerspublic LayeredClassLoader.Builder setSourcesLayers(List<Sources> sourcesLayers)
sourcesLayers
- sources layerspublic LayeredClassLoader.Builder setSourcesLayers(Sources... sourcesLayers)
sourcesLayers
- sources layerspublic LayeredClassLoader.Builder setCodeLayers(List<Code> codeLayers)
codeLayers
- code layerspublic LayeredClassLoader.Builder setCodeLayers(Code... codeLayers)
codeLayers
- code layerspublic LayeredClassLoader.Builder setWithTopCodeCache(boolean isWithTopCodeCache, TopCodeCache topCodeCache)
Note that the default is the opposite in the LayeredEngine
.
isWithTopCodeCache
- whether to use the a top code cache or nottopCodeCache
- top code cache (OK to pass null if setting to false)public LayeredClassLoader.Builder setTopLoadMode(LoadMode topLoadMode)
topLoadMode
- load mode for the top code cachepublic ClassLoader getParent()
public LoadMode getLoadMode()
public List<Sources> getSourcesLayers()
public List<Code> getCodeLayers()
public boolean isWithTopCodeCache()
public TopCodeCache getTopCodeCache()
public LoadMode getTopLoadMode()
public LayeredClassLoader buildFromCodeLayers()
LayeredClassLoader
based on already compiled code layers.public LayeredClassLoader buildFromSourcesLayers()
LayeredClassLoader
based on sources to compile to code layers.CompileException
- if compiling the sources layers failed