Class AbstractProxier<PS extends ProxySpecification>
java.lang.Object
org.microbean.proxy.AbstractProxier<PS>
- Type Parameters:
PS- theProxySpecificationtype
- Direct Known Subclasses:
AbstractReflectiveProxier,AbstractToolkitProxier
public abstract sealed class AbstractProxier<PS extends ProxySpecification>
extends Object
permits AbstractReflectiveProxier<PS>, AbstractToolkitProxier<PS,T>
An abstract base class for subclassses that create proxies.
- Author:
- Laird Nelson
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractProxier(Domain domain) Creates a newAbstractProxierimplementation. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassLoaderReturns theClassLoaderfor loading classes.protected final Domaindomain()Returns theDomainsupplied at construction time.abstract <R> Proxy<R>
-
Constructor Details
-
AbstractProxier
Creates a newAbstractProxierimplementation.- Parameters:
domain- aDomain; must not benull- Throws:
NullPointerException- ifdomainisnull
-
-
Method Details
-
classLoader
Returns theClassLoaderfor loading classes.The default implementation of this method returns the return value of an invocation of the
Thread.getContextClassLoader()method.Overrides of this method must not return
nullor undefined behavior may result.- Returns:
- a non-
nullClassLoader
-
domain
-
proxy
Returns aProxyappropriate for the supplied proxy specification andSupplierof contextual instances.- Type Parameters:
R- the contextual instance type- Parameters:
ps- an appropriate proxy specification; must not benullinstanceSupplier- aSupplierof contextual instances; must not benull; may or may not create a new contextual instance each time it is invoked; may or may not be invoked multiple times depending on the subclass implementation- Returns:
- a non-
nullProxy - Throws:
NullPointerException- if any argument isnull
-