Class ProxyFactory.ProxyConstructor<T>

  • All Implemented Interfaces:
    ConstructionProxy<T>
    Enclosing class:
    ProxyFactory<T>

    private static class ProxyFactory.ProxyConstructor<T>
    extends java.lang.Object
    implements ConstructionProxy<T>
    Constructs instances that participate in AOP.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.reflect.InvocationHandler[] callbacks  
      (package private) java.lang.reflect.Constructor<T> constructor  
      (package private) java.util.function.BiFunction<java.lang.Object,​java.lang.Object[],​java.lang.Object> enhancedConstructor  
      (package private) InjectionPoint injectionPoint  
      (package private) com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> interceptors  
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyConstructor​(InjectionPoint injectionPoint, java.util.function.Function<java.lang.String,​java.util.function.BiFunction<java.lang.Object,​java.lang.Object[],​java.lang.Object>> enhancer, com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> interceptors, java.lang.reflect.InvocationHandler[] callbacks)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.reflect.Constructor<T> getConstructor()
      Returns the injected constructor.
      InjectionPoint getInjectionPoint()
      Returns the injection point for this constructor.
      com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors()
      Returns the interceptors applied to each method, in order of invocation.
      T newInstance​(java.lang.Object... arguments)
      Constructs an instance of T for the given arguments.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • constructor

        final java.lang.reflect.Constructor<T> constructor
      • enhancedConstructor

        final java.util.function.BiFunction<java.lang.Object,​java.lang.Object[],​java.lang.Object> enhancedConstructor
      • interceptors

        final com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> interceptors
      • callbacks

        final java.lang.reflect.InvocationHandler[] callbacks
    • Constructor Detail

      • ProxyConstructor

        ProxyConstructor​(InjectionPoint injectionPoint,
                         java.util.function.Function<java.lang.String,​java.util.function.BiFunction<java.lang.Object,​java.lang.Object[],​java.lang.Object>> enhancer,
                         com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> interceptors,
                         java.lang.reflect.InvocationHandler[] callbacks)
    • Method Detail

      • newInstance

        public T newInstance​(java.lang.Object... arguments)
                      throws java.lang.reflect.InvocationTargetException
        Description copied from interface: ConstructionProxy
        Constructs an instance of T for the given arguments.
        Specified by:
        newInstance in interface ConstructionProxy<T>
        Throws:
        java.lang.reflect.InvocationTargetException
      • getConstructor

        public java.lang.reflect.Constructor<T> getConstructor()
        Description copied from interface: ConstructionProxy
        Returns the injected constructor. If the injected constructor is synthetic (such as generated code for method interception), the natural constructor is returned.
        Specified by:
        getConstructor in interface ConstructionProxy<T>
      • getMethodInterceptors

        public com.google.common.collect.ImmutableMap<java.lang.reflect.Method,​java.util.List<org.aopalliance.intercept.MethodInterceptor>> getMethodInterceptors()
        Description copied from interface: ConstructionProxy
        Returns the interceptors applied to each method, in order of invocation.
        Specified by:
        getMethodInterceptors in interface ConstructionProxy<T>