|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.plastic.PlasticManager
public class PlasticManager
Manages the internal class loaders and other logics necessary to load and transform existing classes,
or to create new classes dynamically at runtime. New instances are instantiates using
withClassLoader(ClassLoader)
or withContextClassLoader()
, then configuring
the returned options object before invoking PlasticManager.PlasticManagerBuilder.create()
.
Nested Class Summary | |
---|---|
static class |
PlasticManager.PlasticManagerBuilder
A builder object for configuring the PlasticManager before instantiating it. |
Method Summary | ||
---|---|---|
void |
addPlasticClassListener(PlasticClassListener listener)
|
|
|
createClass(Class<T> baseClass,
PlasticClassTransformer callback)
Creates an entirely new class, extending from the provided base class. |
|
|
createProxy(Class<T> interfaceType,
PlasticClassTransformer callback)
Creates an entirely new class. |
|
|
createProxyTransformation(Class interfaceType)
Creates the underlying PlasticClassTransformation for an interface proxy. |
|
|
getClassInstantiator(String className)
Gets the ClassInstantiator for the indicated class, which must be in a transformed package. |
|
ClassLoader |
getClassLoader()
Returns the ClassLoader that is used to instantiate transformed classes. |
|
void |
removePlasticClassListener(PlasticClassListener listener)
|
|
static PlasticManager.PlasticManagerBuilder |
withClassLoader(ClassLoader loader)
Creates a new builder using the specified class loader. |
|
static PlasticManager.PlasticManagerBuilder |
withContextClassLoader()
Creates a new builder using the thread's context class loader. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static PlasticManager.PlasticManagerBuilder withContextClassLoader()
public static PlasticManager.PlasticManagerBuilder withClassLoader(ClassLoader loader)
public ClassLoader getClassLoader()
withClassLoader(ClassLoader)
.
public <T> ClassInstantiator<T> getClassInstantiator(String className)
ClassInstantiator
for the indicated class, which must be in a transformed package.
className
- fully qualified class name
IllegalArgumentException
- if the class is not a transformed classpublic <T> ClassInstantiator<T> createClass(Class<T> baseClass, PlasticClassTransformer callback)
baseClass
- class to extend from, which must be a class, not an interfacecallback
- used to configure the new class
public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, PlasticClassTransformer callback)
interfaceType
- class to extend from, which must be a class, not an interfacecallback
- used to configure the new class
createProxyTransformation(Class)
public <T> PlasticClassTransformation<T> createProxyTransformation(Class interfaceType)
PlasticClassTransformation
for an interface proxy. This should only be
used in the cases where encapsulating the PlasticClass construction into a callback is not feasible (which is the case for some of the older APIs inside Tapestry IoC).
interfaceType
- class proxy will extend from
public void addPlasticClassListener(PlasticClassListener listener)
addPlasticClassListener
in interface PlasticClassListenerHub
public void removePlasticClassListener(PlasticClassListener listener)
removePlasticClassListener
in interface PlasticClassListenerHub
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |