Package org.nuxeo.runtime.tomcat.dev
Class NuxeoDevWebappClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- java.security.SecureClassLoader
-
- java.net.URLClassLoader
-
- org.apache.catalina.loader.WebappClassLoaderBase
-
- org.apache.catalina.loader.WebappClassLoader
-
- org.nuxeo.runtime.tomcat.NuxeoWebappClassLoader
-
- org.nuxeo.runtime.tomcat.dev.NuxeoDevWebappClassLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.catalina.Lifecycle
,org.apache.juli.WebappProperties
,org.apache.tomcat.InstrumentableClassLoader
,org.apache.tomcat.util.security.PermissionCheck
,DevMutableClassLoader
,MutableClassLoader
,WebResourcesCacheFlusher
public class NuxeoDevWebappClassLoader extends NuxeoWebappClassLoader implements DevMutableClassLoader, WebResourcesCacheFlusher
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
NuxeoDevWebappClassLoader.CompoundEnumeration<E>
-
Nested classes/interfaces inherited from class org.apache.catalina.loader.WebappClassLoaderBase
org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedFindClassByName, org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedGetClassLoader, org.apache.catalina.loader.WebappClassLoaderBase.PrivilegedJavaseGetResource
-
-
Field Summary
Fields Modifier and Type Field Description protected LocalClassLoader[]
_children
protected DevFrameworkBootstrap
bootstrap
protected List<LocalClassLoader>
children
-
Fields inherited from class org.apache.catalina.loader.WebappClassLoaderBase
delegate, loaderPC, parent, permissionList, resourceEntries, resources, securityManager, sm
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description NuxeoDevWebappClassLoader()
NuxeoDevWebappClassLoader(ClassLoader parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChildren(LocalClassLoader loader)
void
addClassLoader(URL... urls)
Adds a new class loader to this one containing the reference to input urls.void
addURL(URL url)
void
clear()
void
clearPreviousClassLoader()
Clears the stack containing the previous class loader injected during hot reload.LocalClassLoader
createLocalClassLoader(URL... urls)
void
flushWebResources()
DevFrameworkBootstrap
getBootstrap()
LocalClassLoader[]
getChildren()
ClassLoader
getClassLoader()
ClassLoader
getParentClassLoader()
URL
getResource(String name)
InputStream
getResourceAsStream(String name)
Enumeration<URL>
getResources(String name)
Class<?>
loadClass(String name, boolean resolve)
Do not synchronize this method at method level to avoid deadlocks.void
setBootstrap(DevFrameworkBootstrap bootstrap)
-
Methods inherited from class org.apache.catalina.loader.WebappClassLoader
copyWithoutTransformers, getClassLoadingLock
-
Methods inherited from class org.apache.catalina.loader.WebappClassLoaderBase
addLifecycleListener, addTransformer, check, checkStateForClassLoading, checkStateForResourceLoading, clearReferences, copyStateWithoutTransformers, destroy, doDefineClass, filter, findClass, findClassInternal, findLifecycleListeners, findLoadedClass0, findResource, findResources, getClearReferencesHttpClientKeepAliveThread, getClearReferencesLogFactoryRelease, getClearReferencesObjectStreamClassCaches, getClearReferencesRmiTargets, getClearReferencesStopThreads, getClearReferencesStopTimerThreads, getClearReferencesThreadLocals, getContextName, getDelegate, getHostName, getJavaseClassLoader, getPermissions, getResources, getServiceName, getSkipMemoryLeakChecksOnJvmShutdown, getState, getStateName, getURLs, getWebappName, hasLoggingConfig, init, isPackageSealed, loadClass, modified, refreshPolicy, removeLifecycleListener, removeTransformer, setClearReferencesHttpClientKeepAliveThread, setClearReferencesLogFactoryRelease, setClearReferencesObjectStreamClassCaches, setClearReferencesRmiTargets, setClearReferencesStopThreads, setClearReferencesStopTimerThreads, setClearReferencesThreadLocals, setDelegate, setJavaseClassLoader, setResources, setSkipMemoryLeakChecksOnJvmShutdown, start, stop, toString
-
Methods inherited from class java.net.URLClassLoader
close, definePackage, newInstance, newInstance
-
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.osgi.application.MutableClassLoader
loadClass
-
-
-
-
Field Detail
-
bootstrap
protected DevFrameworkBootstrap bootstrap
-
children
protected List<LocalClassLoader> children
-
_children
protected volatile LocalClassLoader[] _children
-
-
Constructor Detail
-
NuxeoDevWebappClassLoader
public NuxeoDevWebappClassLoader()
-
NuxeoDevWebappClassLoader
public NuxeoDevWebappClassLoader(ClassLoader parent)
-
-
Method Detail
-
clearPreviousClassLoader
public void clearPreviousClassLoader()
Description copied from interface:DevMutableClassLoader
Clears the stack containing the previous class loader injected during hot reload.- Specified by:
clearPreviousClassLoader
in interfaceDevMutableClassLoader
- Since:
- 9.3
-
addClassLoader
public void addClassLoader(URL... urls)
Description copied from interface:DevMutableClassLoader
Adds a new class loader to this one containing the reference to input urls.- Specified by:
addClassLoader
in interfaceDevMutableClassLoader
- Since:
- 9.3
-
createLocalClassLoader
public LocalClassLoader createLocalClassLoader(URL... urls)
-
setBootstrap
public void setBootstrap(DevFrameworkBootstrap bootstrap)
-
getBootstrap
public DevFrameworkBootstrap getBootstrap()
-
addChildren
public void addChildren(LocalClassLoader loader)
-
clear
public void clear()
-
flushWebResources
public void flushWebResources()
- Specified by:
flushWebResources
in interfaceWebResourcesCacheFlusher
-
getChildren
public LocalClassLoader[] getChildren()
-
loadClass
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
Do not synchronize this method at method level to avoid deadlocks.- Overrides:
loadClass
in classorg.apache.catalina.loader.WebappClassLoaderBase
- Throws:
ClassNotFoundException
-
getResource
public URL getResource(String name)
- Overrides:
getResource
in classorg.apache.catalina.loader.WebappClassLoaderBase
-
getResourceAsStream
public InputStream getResourceAsStream(String name)
- Overrides:
getResourceAsStream
in classorg.apache.catalina.loader.WebappClassLoaderBase
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Overrides:
getResources
in classorg.apache.catalina.loader.WebappClassLoaderBase
- Throws:
IOException
-
addURL
public void addURL(URL url)
- Specified by:
addURL
in interfaceMutableClassLoader
- Overrides:
addURL
in classNuxeoWebappClassLoader
-
getParentClassLoader
public ClassLoader getParentClassLoader()
- Overrides:
getParentClassLoader
in classNuxeoWebappClassLoader
-
getClassLoader
public ClassLoader getClassLoader()
- Specified by:
getClassLoader
in interfaceMutableClassLoader
- Overrides:
getClassLoader
in classNuxeoWebappClassLoader
-
-