Class NamedContextFactory<C extends NamedContextFactory.Specification>

  • Type Parameters:
    C - specification
    All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware

    public abstract class NamedContextFactory<C extends NamedContextFactory.Specification>
    extends Object
    implements org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware
    Creates a set of child contexts that allows a set of Specifications to define the beans in each child context. Ported from spring-cloud-netflix FeignClientFactory and SpringClientFactory
    Author:
    Spencer Gibb, Dave Syer, Tommy Karlsson, Olga Maciaszek-Sharma
    • Constructor Detail

      • NamedContextFactory

        public NamedContextFactory​(Class<?> defaultConfigType,
                                   String propertySourceName,
                                   String propertyName)
    • Method Detail

      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext parent)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • getParent

        public org.springframework.context.ApplicationContext getParent()
      • setConfigurations

        public void setConfigurations​(List<C> configurations)
      • getContextNames

        public Set<String> getContextNames()
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
      • getContext

        protected org.springframework.context.annotation.AnnotationConfigApplicationContext getContext​(String name)
      • createContext

        protected org.springframework.context.annotation.AnnotationConfigApplicationContext createContext​(String name)
      • generateDisplayName

        protected String generateDisplayName​(String name)
      • getInstance

        public <T> T getInstance​(String name,
                                 Class<T> type)
      • getLazyProvider

        public <T> org.springframework.beans.factory.ObjectProvider<T> getLazyProvider​(String name,
                                                                                       Class<T> type)
      • getProvider

        public <T> org.springframework.beans.factory.ObjectProvider<T> getProvider​(String name,
                                                                                   Class<T> type)
      • getInstance

        public <T> T getInstance​(String name,
                                 Class<?> clazz,
                                 Class<?>... generics)
      • getInstance

        public <T> T getInstance​(String name,
                                 org.springframework.core.ResolvableType type)