Class PageClassLoaderContext
- java.lang.Object
-
- org.apache.tapestry5.services.pageload.PageClassLoaderContext
-
public class PageClassLoaderContext extends java.lang.Object
Class that encapsulates a classloader context for Tapestry's live class reloading. Each instance contains basically a classloader, a set of classnames, a parent context (possibly null) and child contexts (possibly empty).
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringUNKOWN_CONTEXT_NAMEName of theunknowncontext (i.e.
-
Constructor Summary
Constructors Constructor Description PageClassLoaderContext(java.lang.String name, PageClassLoaderContext parent, java.util.Set<java.lang.String> classNames, PlasticProxyFactory plasticProxyFactory, java.util.function.Function<java.lang.String,PageClassLoaderContext> provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(PageClassLoaderContext context)Adds a child context.voidaddClass(java.lang.String className)Adds a class to this context.booleanequals(java.lang.Object obj)PageClassLoaderContextfindByClassName(java.lang.String className)Searches for the context that contains the given class in itself and recursivel in its children.java.util.Set<PageClassLoaderContext>getChildren()Returns the children of this context.java.lang.ClassLoadergetClassLoader()Returns the ClassLoader associated with this context.java.util.Set<java.lang.String>getClassNames()Returns the set of classes that belong in this context.java.util.Set<PageClassLoaderContext>getDescendents()Returns the set of descendents (children and their children recursively of this context.java.lang.StringgetName()Returns the name of this context.PageClassLoaderContextgetParent()Returns the parent of this context.PlasticManagergetPlasticManager()Returns this context's PlasticManager instance.PlasticProxyFactorygetProxyFactory()Returns this context's PlasticProxyFactory instance.inthashCode()voidinvalidate()Invalidates this context and its children recursively.booleanisRoot()Returns whether this is the root context.booleanisUnknown()Returns whether this is theunknwoncontext.voidremoveChild(PageClassLoaderContext context)Removes a child context.java.lang.StringtoRecursiveString()java.lang.StringtoString()
-
-
-
Field Detail
-
UNKOWN_CONTEXT_NAME
public static final java.lang.String UNKOWN_CONTEXT_NAME
Name of theunknowncontext (i.e. the one for controlled classes without dependency information at the moment).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PageClassLoaderContext
public PageClassLoaderContext(java.lang.String name, PageClassLoaderContext parent, java.util.Set<java.lang.String> classNames, PlasticProxyFactory plasticProxyFactory, java.util.function.Function<java.lang.String,PageClassLoaderContext> provider)
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this context.
-
getParent
public PageClassLoaderContext getParent()
Returns the parent of this context.
-
getClassNames
public java.util.Set<java.lang.String> getClassNames()
Returns the set of classes that belong in this context.
-
getChildren
public java.util.Set<PageClassLoaderContext> getChildren()
Returns the children of this context.
-
getPlasticManager
public PlasticManager getPlasticManager()
Returns this context's PlasticManager instance.
-
getProxyFactory
public PlasticProxyFactory getProxyFactory()
Returns this context's PlasticProxyFactory instance.
-
addClass
public void addClass(java.lang.String className)
Adds a class to this context.
-
addChild
public void addChild(PageClassLoaderContext context)
Adds a child context.
-
removeChild
public void removeChild(PageClassLoaderContext context)
Removes a child context.
-
findByClassName
public PageClassLoaderContext findByClassName(java.lang.String className)
Searches for the context that contains the given class in itself and recursivel in its children.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Returns the ClassLoader associated with this context.
-
invalidate
public void invalidate()
Invalidates this context and its children recursively. This shouldn't be called directly, just throughPageClassLoaderContextManager.invalidate(PageClassLoaderContext...).
-
isRoot
public boolean isRoot()
Returns whether this is the root context.
-
isUnknown
public boolean isUnknown()
Returns whether this is theunknwoncontext.- See Also:
UNKOWN_CONTEXT_NAME
-
getDescendents
public java.util.Set<PageClassLoaderContext> getDescendents()
Returns the set of descendents (children and their children recursively of this context.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toRecursiveString
public java.lang.String toRecursiveString()
-
-