Package org.laxture.sbp.spring.boot
Class SpringBootstrap
java.lang.Object
org.springframework.boot.SpringApplication
org.laxture.sbp.spring.boot.SpringBootstrap
public class SpringBootstrap
extends org.springframework.boot.SpringApplication
Base plugin
ApplicationContext bootstrap class like SpringApplication
to initialize environment in spring-boot style.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.springframework.boot.SpringApplication
org.springframework.boot.SpringApplication.AbandonedRunException, org.springframework.boot.SpringApplication.Augmented, org.springframework.boot.SpringApplication.Running -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final String[]static final String[]Fields inherited from class org.springframework.boot.SpringApplication
BANNER_LOCATION_PROPERTY, BANNER_LOCATION_PROPERTY_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionSpringBootstrap(SpringBootPlugin plugin, Class<?>... primarySources) Constructor should be the only thing need to take care for this Class. -
Method Summary
Modifier and TypeMethodDescriptionaddPresetProperty(String name, Object value) Properties that need to be set when this app is started as a plugin.protected voidafterRefresh(org.springframework.context.ConfigurableApplicationContext context, org.springframework.boot.ApplicationArguments args) protected voidbindToSpringApplication(org.springframework.core.env.ConfigurableEnvironment environment) protected voidconfigurePropertySources(org.springframework.core.env.ConfigurableEnvironment environment, String[] args) org.springframework.context.ConfigurableApplicationContextprotected String[]org.springframework.context.support.GenericApplicationContextimportBean(Class<?> beanClass) Beans that wanted to be shared from mainApplicationContext.importBean(String beanName) Beans that wanted to be shared from mainApplicationContext.protected booleanimportBean(org.springframework.context.support.GenericApplicationContext sourceApplicationContext, org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass) protected booleanimportBean(org.springframework.context.support.GenericApplicationContext sourceApplicationContext, org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) booleanimportBeanFromDependentPlugin(org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass) booleanimportBeanFromDependentPlugin(org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) booleanimportBeanFromMainContext(org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass) booleanimportBeanFromMainContext(org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) voidsetListeners(Collection<? extends org.springframework.context.ApplicationListener<?>> listeners) Methods inherited from class org.springframework.boot.SpringApplication
addBootstrapRegistryInitializer, addInitializers, addListeners, addPrimarySources, applyInitializers, configureEnvironment, configureProfiles, createBeanDefinitionLoader, exit, from, getAdditionalProfiles, getAllSources, getApplicationLog, getApplicationStartup, getClassLoader, getEnvironmentPrefix, getInitializers, getListeners, getMainApplicationClass, getResourceLoader, getShutdownHandlers, getSources, getWebApplicationType, isKeepAlive, load, logStartupInfo, logStartupProfileInfo, main, postProcessApplicationContext, refresh, registerLoggedException, run, run, run, setAddCommandLineProperties, setAddConversionService, setAdditionalProfiles, setAllowBeanDefinitionOverriding, setAllowCircularReferences, setApplicationContextFactory, setApplicationStartup, setBanner, setBannerMode, setBeanNameGenerator, setDefaultProperties, setDefaultProperties, setEnvironment, setEnvironmentPrefix, setHeadless, setInitializers, setKeepAlive, setLazyInitialization, setLogStartupInfo, setMainApplicationClass, setRegisterShutdownHook, setResourceLoader, setSources, setWebApplicationType, withHook, withHook
-
Field Details
-
BEAN_PLUGIN
- See Also:
-
BEAN_IMPORTED_BEAN_NAMES
- See Also:
-
DEFAULT_EXCLUDE_CONFIGURATIONS
-
DEFAULT_EXCLUDE_APPLICATION_LISTENERS
-
-
Constructor Details
-
SpringBootstrap
Constructor should be the only thing need to take care for this Class. Generally new an instance andSpringApplication.run(String...)it inSpringBootPlugin.createSpringBootstrap()method.- Parameters:
primarySources-SpringApplicationthat annotated with @SpringBootApplication
-
-
Method Details
-
getMainApplicationContext
public org.springframework.context.support.GenericApplicationContext getMainApplicationContext() -
importBean
Beans that wanted to be shared from mainApplicationContext. Note that this method only takes effect beforeSpringApplication.run(String...)method. -
importBean
Beans that wanted to be shared from mainApplicationContext. Note that this method only takes effect beforeSpringApplication.run(String...)method. -
addPresetProperty
Properties that need to be set when this app is started as a plugin. Note that this method only takes effect beforeSpringApplication.run(String...)method. -
configurePropertySources
protected void configurePropertySources(org.springframework.core.env.ConfigurableEnvironment environment, String[] args) - Overrides:
configurePropertySourcesin classorg.springframework.boot.SpringApplication
-
bindToSpringApplication
protected void bindToSpringApplication(org.springframework.core.env.ConfigurableEnvironment environment) - Overrides:
bindToSpringApplicationin classorg.springframework.boot.SpringApplication
-
getExcludeApplicationListeners
-
setListeners
public void setListeners(Collection<? extends org.springframework.context.ApplicationListener<?>> listeners) - Overrides:
setListenersin classorg.springframework.boot.SpringApplication
-
createApplicationContext
public org.springframework.context.ConfigurableApplicationContext createApplicationContext()- Overrides:
createApplicationContextin classorg.springframework.boot.SpringApplication
-
afterRefresh
protected void afterRefresh(org.springframework.context.ConfigurableApplicationContext context, org.springframework.boot.ApplicationArguments args) - Overrides:
afterRefreshin classorg.springframework.boot.SpringApplication
-
importBean
protected boolean importBean(org.springframework.context.support.GenericApplicationContext sourceApplicationContext, org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) -
importBean
protected boolean importBean(org.springframework.context.support.GenericApplicationContext sourceApplicationContext, org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass) -
importBeanFromMainContext
public boolean importBeanFromMainContext(org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) -
importBeanFromMainContext
public boolean importBeanFromMainContext(org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass) -
importBeanFromDependentPlugin
public boolean importBeanFromDependentPlugin(org.springframework.context.support.GenericApplicationContext applicationContext, String beanName) -
importBeanFromDependentPlugin
public boolean importBeanFromDependentPlugin(org.springframework.context.support.GenericApplicationContext applicationContext, Class<?> beanClass)
-