Class DynamicProxyBeanProvider

java.lang.Object
com.atlassian.jira.com.rproxy.goskope.component.spring.provider.DynamicProxyBeanProvider

public class DynamicProxyBeanProvider extends Object
Provides dynamic proxy beans that allow switching the implementation at runtime.
  • Method Details

    • provide

      public static <T> T provide(Class<T> beanInterface, Supplier<T> delegateSupplier)
      Provides a proxy for the given bean interface. The supplier is called on EACH ACCESS to the bean to allow switching the implementation at runtime.
      Type Parameters:
      T - the type of the bean
      Parameters:
      beanInterface - the interface of the bean
      delegateSupplier - the supplier providing the bean implementation
      Returns:
      the proxy bean