public static class LayeredEngine.Builder extends Object
LayeredEngine
.Constructor and Description |
---|
Builder()
constructor.
|
Modifier and Type | Method and Description |
---|---|
LayeredEngine |
build()
builds a new instance of
LayeredEngine . |
ClassReleaser |
getClassReleaser()
gets the class releaser.
|
LoadMode |
getLoadMode()
gets the load mode for the (static) code layers.
|
ClassLoader |
getParent()
gets the parent class loader.
|
TopCodeCacheFactory |
getTopCodeCacheFactory()
gets the top code cache factory.
|
LoadMode |
getTopLoadMode()
gets the load mode for the top code cache.
|
boolean |
isAllowSameClassNamesInMultipleCodeLayers()
gets whether to allow the same class names in multiple code layers.
|
boolean |
isAllowSameClassNamesInParentAndCodeLayers()
gets whether to allow the same class names in code layers and parent class loader.
|
boolean |
isWithTopCodeCache()
gets whether to use the a top code cache or not.
|
LayeredEngine.Builder |
setAllowSameClassNamesInMultipleCodeLayers(boolean allowSameClassNamesInMultipleCodeLayers)
sets whether to allow the same class names in multiple code layers, default is true.
|
LayeredEngine.Builder |
setAllowSameClassNamesInParentAndCodeLayers(boolean allowSameClassNamesInParentAndCodeLayers)
sets whether to allow the same class names in code layers and parent class loader, default is true.
|
LayeredEngine.Builder |
setClassReleaser(ClassReleaser classReleaser)
sets the class releaser, default is the
DefaultClassReleaser singleton instance. |
LayeredEngine.Builder |
setLoadMode(LoadMode loadMode)
sets the load mode for the (static) code layers, default is "current first".
|
LayeredEngine.Builder |
setParent(ClassLoader parent)
sets the parent class loader, default is the context class loader
of the current thread.
|
LayeredEngine.Builder |
setTopCodeCacheFactory(TopCodeCacheFactory topCodeCacheFactory)
sets the top code cache factory,
default is a new instance of
DefaultTopCodeCacheFactory with default settings. |
LayeredEngine.Builder |
setTopLoadMode(LoadMode topLoadMode)
sets the load mode for the top code cache, default is "parent first".
|
LayeredEngine.Builder |
setWithTopCodeCache(boolean isWithTopCodeCache)
sets whether to use the a top code cache or not,
default is true.
|
public LayeredEngine.Builder setParent(ClassLoader parent)
parent
- parent class loaderIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setLoadMode(LoadMode loadMode)
loadMode
- load mode for the (static) code layersIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setWithTopCodeCache(boolean isWithTopCodeCache)
Note that the default is the opposite in the LayeredClassLoader
.
isWithTopCodeCache
- whether to use the a top code cache or notIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setTopCodeCacheFactory(TopCodeCacheFactory topCodeCacheFactory)
DefaultTopCodeCacheFactory
with default settings.topCodeCacheFactory
- top code cache factoryIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setTopLoadMode(LoadMode topLoadMode)
topLoadMode
- load mode for the top code cacheIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setClassReleaser(ClassReleaser classReleaser)
DefaultClassReleaser
singleton instance.classReleaser
- class releaserpublic LayeredEngine.Builder setAllowSameClassNamesInMultipleCodeLayers(boolean allowSameClassNamesInMultipleCodeLayers)
allowSameClassNamesInMultipleCodeLayers
- whether to allow the same class names in multiple code layersIllegalStateException
- if the builder had already been used to build an instancepublic LayeredEngine.Builder setAllowSameClassNamesInParentAndCodeLayers(boolean allowSameClassNamesInParentAndCodeLayers)
allowSameClassNamesInParentAndCodeLayers
- whether to allow the same class names in code layers and parent class loaderIllegalStateException
- if the builder had already been used to build an instancepublic ClassLoader getParent()
public LoadMode getLoadMode()
public boolean isWithTopCodeCache()
public LoadMode getTopLoadMode()
public ClassReleaser getClassReleaser()
public TopCodeCacheFactory getTopCodeCacheFactory()
public boolean isAllowSameClassNamesInMultipleCodeLayers()
public boolean isAllowSameClassNamesInParentAndCodeLayers()
public LayeredEngine build()
LayeredEngine
.