Class AbstractToolkitProxier<PS extends ProxySpecification,T>
java.lang.Object
org.microbean.proxy.AbstractProxier<PS>
org.microbean.proxy.AbstractToolkitProxier<PS,T>
- Type Parameters:
PS- theProxySpecificationtypeT- the toolkit representation of an unloadedClass
public abstract non-sealed class AbstractToolkitProxier<PS extends ProxySpecification,T>
extends AbstractProxier<PS>
An
AbstractProxier built using some kind of toolkit, such as Byte Buddy and the like.- Author:
- Laird Nelson
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractToolkitProxier(Domain domain, MethodHandles.Lookup lookup) Creates a newAbstractToolkitProxier. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TCreates a generated class definition from the information present in the suppliedProxySpecification, and returns it for eventual supplying to an inovcation of theproxyClass(Object, ClassLoader)method.protected MethodHandles.LookupReturns aMethodHandles.Lookupsuitable for the suppliedClass.protected final Class<?> proxyClass(PS ps) Loads and returns the proxy class corresponding to the supplied proxy specification, generating it first if necessary.protected abstract Class<?> proxyClass(T t, ClassLoader cl) Called by theproxyClass(ProxySpecification)method, converts the supplied class definition into aClass, using the suppliedClassLoader, and returns it.Methods inherited from class org.microbean.proxy.AbstractProxier
classLoader, domain, proxy
-
Constructor Details
-
AbstractToolkitProxier
Creates a newAbstractToolkitProxier.- Parameters:
domain- aDomain; must not benulllookup- aMethodHandles.Lookup; must not benull- Throws:
NullPointerException- if any argument isnull- See Also:
-
-
Method Details
-
generate
Creates a generated class definition from the information present in the suppliedProxySpecification, and returns it for eventual supplying to an inovcation of theproxyClass(Object, ClassLoader)method.- Parameters:
ps- aProxySpecification; must not benull- Returns:
- a non-
nullgenerated class definition - Throws:
NullPointerException- ifpsisnullThrowable- if creation of the generated class definition fails- See Also:
-
lookup
Returns aMethodHandles.Lookupsuitable for the suppliedClass.- Parameters:
c- aClass; must not benull- Returns:
- a
MethodHandles.Lookupsuitable for the suppliedClass8 - See Also:
-
proxyClass
Loads and returns the proxy class corresponding to the supplied proxy specification, generating it first if necessary.- Parameters:
ps- a proxy specification; must not benull- Returns:
- a non-
nullClassthat is guaranteed to be assignable toProxy.class - Throws:
ClassNotFoundException- if the class could not be found- See Also:
-
proxyClass
Called by theproxyClass(ProxySpecification)method, converts the supplied class definition into aClass, using the suppliedClassLoader, and returns it.Overrides of this method must not call the
proxyClass(ProxySpecification)method or undefined behavior may result.- Parameters:
t- a class definition; must not benullcl- aClassLoader; must not benull- Returns:
- a non-
nullClass - Throws:
NullPointerException- if any argument isnullClassNotFoundException- if an invocation ofClassLoader.loadClass(String)fails- See Also:
-