Class NamedContextFactory<C extends NamedContextFactory.Specification>

java.lang.Object
org.springframework.cloud.context.named.NamedContextFactory<C>
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 Details

    • NamedContextFactory

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

      public NamedContextFactory(Class<?> defaultConfigType, String propertySourceName, String propertyName, Map<String, org.springframework.context.ApplicationContextInitializer<org.springframework.context.support.GenericApplicationContext>> applicationContextInitializers)
  • Method Details

    • 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.support.GenericApplicationContext getContext(String name)
    • createContext

      public org.springframework.context.support.GenericApplicationContext createContext(String name)
    • registerBeans

      public void registerBeans(String name, org.springframework.context.support.GenericApplicationContext context)
    • buildContext

      public org.springframework.context.support.GenericApplicationContext buildContext(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)
    • getAnnotatedInstance

      public <T> T getAnnotatedInstance(String name, org.springframework.core.ResolvableType type, Class<? extends Annotation> annotationType)
    • getInstances

      public <T> Map<String,T> getInstances(String name, Class<T> type)
    • getConfigurations

      public Map<String,C> getConfigurations()