Class AbstractProxier<PS extends ProxySpecification>
java.lang.Object
org.microbean.proxy.AbstractProxier<PS>
- Type Parameters:
PS
- theProxySpecification
type
- 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
ConstructorsModifierConstructorDescriptionprotected
AbstractProxier
(Domain domain) Creates a newAbstractProxier
implementation. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassLoader
Returns theClassLoader
for loading classes.protected final Domain
domain()
Returns theDomain
supplied at construction time.abstract <R> Proxy
<R>
-
Constructor Details
-
AbstractProxier
Creates a newAbstractProxier
implementation.- Parameters:
domain
- aDomain
; must not benull
- Throws:
NullPointerException
- ifdomain
isnull
-
-
Method Details
-
classLoader
Returns theClassLoader
for 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
null
or undefined behavior may result.- Returns:
- a non-
null
ClassLoader
-
domain
-
proxy
Returns aProxy
appropriate for the supplied proxy specification andSupplier
of contextual instances.- Type Parameters:
R
- the contextual instance type- Parameters:
ps
- an appropriate proxy specification; must not benull
instanceSupplier
- aSupplier
of 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-
null
Proxy
- Throws:
NullPointerException
- if any argument isnull
-