Top Description Inners Fields Constructors Methods
com.google.inject.internal

pack-priv final Class ProxyFactory<T>

extends Object
implements ConstructionProxyFactory<T>
Class Inheritance
All Implemented Interfaces
com.google.inject.internal.ConstructionProxyFactory
Imports
com.google.common.collect.ArrayListMultimap, .ImmutableMap, .ImmutableSet, .Lists, .Multimap, com.google.inject.spi.InjectionPoint, java.lang.reflect.Constructor, .InvocationHandler, .InvocationTargetException, .Method, java.util.BitSet, .List, java.util.function.BiFunction, .Function, java.util.logging.Level, .Logger, org.aopalliance.intercept.MethodInterceptor

Builds a construction proxy that can participate in AOP. This class manages applying type and method matchers to come up with the set of intercepted methods.
Author
[email protected] (Jesse Wilson)

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
ProxyFactory.ProxyConstructor<T>

Constructs instances that participate in AOP.

Field Summary

Modifier and TypeField and Description
private final InvocationHandler[]
private final Function<String, BiFunction<Object, Object[], Object>>
private final InjectionPoint
private final ImmutableMap<Method, List<MethodInterceptor>>
private static final Logger

Constructor Summary

AccessConstructor and Description
pack-priv
ProxyFactory(InjectionPoint injectionPoint, Iterable<MethodAspect> methodAspects)

Method Summary

Modifier and TypeMethod and Description
public ConstructionProxy<T>
create()

Implements com.google.inject.internal.ConstructionProxyFactory.create.

Gets a construction proxy for the given constructor.
public ImmutableMap<Method, List<MethodInterceptor>>
getInterceptors()

Returns the interceptors that apply to the constructed type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbacksback to summary
private final InvocationHandler[] callbacks
enhancerback to summary
private final Function<String, BiFunction<Object, Object[], Object>> enhancer
injectionPointback to summary
private final InjectionPoint injectionPoint
interceptorsback to summary
private final ImmutableMap<Method, List<MethodInterceptor>> interceptors
loggerback to summary
private static final Logger logger

Constructor Detail

ProxyFactoryback to summary
pack-priv ProxyFactory(InjectionPoint injectionPoint, Iterable<MethodAspect> methodAspects) throws ErrorsException

Method Detail

createback to summary
public ConstructionProxy<T> create() throws ErrorsException

Implements com.google.inject.internal.ConstructionProxyFactory.create.

Doc from com.google.inject.internal.ConstructionProxyFactory.create.

Gets a construction proxy for the given constructor.

Annotations
@Override
getInterceptorsback to summary
public ImmutableMap<Method, List<MethodInterceptor>> getInterceptors()

Returns the interceptors that apply to the constructed type.

com.google.inject.internal back to summary

private Class ProxyFactory.ProxyConstructor<T>

extends Object
implements ConstructionProxy<T>
Class Inheritance
All Implemented Interfaces
com.google.inject.internal.ConstructionProxy

Constructs instances that participate in AOP.

Field Summary

Modifier and TypeField and Description
pack-priv final InvocationHandler[]
pack-priv final Constructor<T>
pack-priv final BiFunction<Object, Object[], Object>
pack-priv final InjectionPoint
pack-priv final ImmutableMap<Method, List<MethodInterceptor>>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Constructor<T>
getConstructor()

Implements com.google.inject.internal.ConstructionProxy.getConstructor.

Returns the injected constructor.
public InjectionPoint
getInjectionPoint()

Implements com.google.inject.internal.ConstructionProxy.getInjectionPoint.

Returns the injection point for this constructor.
public ImmutableMap<Method, List<MethodInterceptor>>
getMethodInterceptors()

Implements com.google.inject.internal.ConstructionProxy.getMethodInterceptors.

Returns the interceptors applied to each method, in order of invocation.
public T
newInstance(Object... arguments)

Implements com.google.inject.internal.ConstructionProxy.newInstance.

Constructs an instance of T for the given arguments.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

callbacksback to summary
pack-priv final InvocationHandler[] callbacks
constructorback to summary
pack-priv final Constructor<T> constructor
enhancedConstructorback to summary
pack-priv final BiFunction<Object, Object[], Object> enhancedConstructor
injectionPointback to summary
pack-priv final InjectionPoint injectionPoint
interceptorsback to summary
pack-priv final ImmutableMap<Method, List<MethodInterceptor>> interceptors

Constructor Detail

ProxyConstructorback to summary
pack-priv ProxyConstructor(InjectionPoint injectionPoint, Function<String, BiFunction<Object, Object[], Object>> enhancer, ImmutableMap<Method, List<MethodInterceptor>> interceptors, InvocationHandler[] callbacks)
Annotations
@SuppressWarnings:unchecked

Method Detail

getConstructorback to summary
public Constructor<T> getConstructor()

Implements com.google.inject.internal.ConstructionProxy.getConstructor.

Doc from com.google.inject.internal.ConstructionProxy.getConstructor.

Returns the injected constructor. If the injected constructor is synthetic (such as generated code for method interception), the natural constructor is returned.

Annotations
@Override
getInjectionPointback to summary
public InjectionPoint getInjectionPoint()

Implements com.google.inject.internal.ConstructionProxy.getInjectionPoint.

Doc from com.google.inject.internal.ConstructionProxy.getInjectionPoint.

Returns the injection point for this constructor.

Annotations
@Override
getMethodInterceptorsback to summary
public ImmutableMap<Method, List<MethodInterceptor>> getMethodInterceptors()

Implements com.google.inject.internal.ConstructionProxy.getMethodInterceptors.

Doc from com.google.inject.internal.ConstructionProxy.getMethodInterceptors.

Returns the interceptors applied to each method, in order of invocation.

Annotations
@Override
newInstanceback to summary
public T newInstance(Object... arguments) throws InvocationTargetException

Implements com.google.inject.internal.ConstructionProxy.newInstance.

Doc from com.google.inject.internal.ConstructionProxy.newInstance.

Constructs an instance of T for the given arguments.

Annotations
@Override
@SuppressWarnings:unchecked