Class AbstractProxier<PS extends ProxySpecification>

java.lang.Object
org.microbean.proxy.AbstractProxier<PS>
Type Parameters:
PS - the ProxySpecification 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 Details Link icon

  • Method Details Link icon

    • classLoader Link icon

      protected ClassLoader classLoader()
      Returns the ClassLoader 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 Link icon

      protected final Domain domain()
      Returns the Domain supplied at construction time.
      Returns:
      a non-null Domain
    • proxy Link icon

      public abstract <R> Proxy<R> proxy(PS ps, Supplier<? extends R> instanceSupplier)
      Returns a Proxy appropriate for the supplied proxy specification and Supplier of contextual instances.
      Type Parameters:
      R - the contextual instance type
      Parameters:
      ps - an appropriate proxy specification; must not be null
      instanceSupplier - a Supplier of contextual instances; must not be null; 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 is null