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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSpecification with name and configuration. -
Constructor Summary
ConstructorsConstructorDescriptionNamedContextFactory(Class<?> defaultConfigType, String propertySourceName, String propertyName) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.context.annotation.AnnotationConfigApplicationContextcreateContext(String name) voiddestroy()protected StringgenerateDisplayName(String name) protected org.springframework.context.annotation.AnnotationConfigApplicationContextgetContext(String name) <T> TgetInstance(String name, Class<?> clazz, Class<?>... generics) <T> TgetInstance(String name, Class<T> type) <T> TgetInstance(String name, org.springframework.core.ResolvableType type) getInstances(String name, Class<T> type) <T> org.springframework.beans.factory.ObjectProvider<T>getLazyProvider(String name, Class<T> type) org.springframework.context.ApplicationContext<T> org.springframework.beans.factory.ObjectProvider<T>getProvider(String name, Class<T> type) voidsetApplicationContext(org.springframework.context.ApplicationContext parent) voidsetConfigurations(List<C> configurations)
-
Constructor Details
-
NamedContextFactory
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext parent) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getParent
public org.springframework.context.ApplicationContext getParent() -
setConfigurations
-
getContextNames
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.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
-
getInstance
-
getLazyProvider
-
getProvider
-
getInstance
-
getInstance
-
getInstances
-