InvocationHandlerFactory class abstract interface

A bean that provides the InvocationHandler for the interface proxies it supports, for example those annotated @FeignClient.

A starter declares one; when a generated proxy bean is created, it asks the factory beans in order and takes the handler of the first that supports its interface. Applications do not implement it.

// The Feign starter's factory.
final class FeignHandlers implements InvocationHandlerFactory {
  @override
  bool supports(InterfaceMetadata<Object> metadata) =>
      metadata.annotation<FeignClient>() != null;

  @override
  InvocationHandler create(InterfaceMetadata<Object> metadata) =>
      FeignHandler(metadata, ...);
}

Spring (Java): a FactoryBean creating the proxy, e.g. Spring Cloud OpenFeign's FeignClientFactoryBean.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

create(InterfaceMetadata<Object> metadata) → InvocationHandler
The handler for the interface of metadata (called once, when the bean is created).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
supports(InterfaceMetadata<Object> metadata) → bool
Whether this factory handles the interface of metadata, typically judged from its annotation.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited