Class AbstractProxyFactory<T>

  • Type Parameters:
    T - the superclass type
    Direct Known Subclasses:
    ProxyFactory

    public abstract class AbstractProxyFactory<T>
    extends AbstractSubclassFactory<T>
    A subclass factory specializing in proxy generation.
    • Method Detail

      • finalizeStaticConstructor

        protected void finalizeStaticConstructor()
        This method must be called by subclasses after they have finished generating the class.
      • afterClassLoad

        public void afterClassLoad​(Class<?> clazz)
        Sets the accessible flag on the cached methods
        Overrides:
        afterClassLoad in class AbstractClassFactory<T>
        Parameters:
        clazz - The newly loaded class
      • getCachedMethods

        public List<Method> getCachedMethods()
        Returns all Method objects that are cached by the proxy. These Methods objects are passed to the proxies InvocationHandler when the corresponding proxy action is invoked
        Returns:
        The cached methods
      • cleanup

        protected void cleanup()
        Cleans up any resources left over from generating the class. Implementors should ensure they call super.cleanup();
        Overrides:
        cleanup in class AbstractSubclassFactory<T>
      • loadMethodIdentifier

        protected void loadMethodIdentifier​(Method methodToLoad,
                                            org.jboss.classfilewriter.ClassMethod method)
        Writes the bytecode to load an instance of Method for the given method onto the stack

        If loadMethod has not already been called for the given method then a static field to hold the method is added to the class, and code is added to the static constructor to initialize the field to the correct Method.

        Parameters:
        methodToLoad - the method to load
        method - the subclass method to populate