Package org.appng.core.service
Class InitializerService
- java.lang.Object
-
- org.appng.core.service.InitializerService
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPNG_GROUP
static String
APPNG_USER
protected PlatformEventListener
auditableListener
-
Constructor Summary
Constructors Constructor Description InitializerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoreService
getCoreService()
protected org.springframework.context.support.PropertySourcesPlaceholderConfigurer
getPlaceholderConfigurer(Properties props)
Runnable
getSiteLoader(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName)
void
initPlatform(PlatformProperties platformConfig, Environment env, DatabaseConnection rootConnection, javax.servlet.ServletContext ctx, ExecutorService messagingExecutor, ExecutorService startupExecutor)
Initializes and loads the platform, which includes logging some environment settings.Properties
loadNodeProperties(Environment env)
void
loadPlatform(PlatformProperties platformConfig, Environment env, String siteName, String target, ExecutorService messagingExecutor, ExecutorService startupExecutor)
Loads the platform by loading every activeSite
.PlatformProperties
loadPlatformProperties(Properties defaultOverrides, Environment env)
void
loadSite(Environment env, SiteImpl siteToLoad, boolean sendReloadEvent, FieldProcessor fp)
Loads the givenSite
.void
loadSite(Environment env, SiteImpl siteToLoad, FieldProcessor fp)
Loads the givenSite
.void
loadSite(SiteImpl siteToLoad, javax.servlet.ServletContext servletContext, FieldProcessor fp)
Loads the givenSite
.void
loadSite(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName)
void
setCoreService(CoreService coreService)
void
shutdownPlatform(javax.servlet.ServletContext ctx)
Shuts down the whole platform by shutting down every activeSite
.void
shutDownSite(Environment env, Site site, boolean removeFromSiteMap)
Shuts down the givenSite
.protected boolean
startApplication(Environment env, SiteImpl site, ApplicationProvider application)
-
-
-
Field Detail
-
APPNG_USER
public static final String APPNG_USER
- See Also:
- Constant Field Values
-
APPNG_GROUP
public static final String APPNG_GROUP
- See Also:
- Constant Field Values
-
auditableListener
@Autowired protected PlatformEventListener auditableListener
-
-
Method Detail
-
initPlatform
@Transactional public void initPlatform(PlatformProperties platformConfig, Environment env, DatabaseConnection rootConnection, javax.servlet.ServletContext ctx, ExecutorService messagingExecutor, ExecutorService startupExecutor) throws InvalidConfigurationException
Initializes and loads the platform, which includes logging some environment settings.- Parameters:
platformConfig
- the currentPlatformProperties
env
- the currentEnvironment
rootConnection
- the rootDatabaseConnection
ctx
- the currentServletContext
messagingExecutor
- anExecutorService
used for cluster communication threadsstartupExecutor
- anExecutorService
used for starting sites in parallel- Throws:
InvalidConfigurationException
- if an configuration error occurred- See Also:
loadPlatform(PlatformProperties, Environment, String, String, ExecutorService, ExecutorService)
-
loadPlatform
public void loadPlatform(PlatformProperties platformConfig, Environment env, String siteName, String target, ExecutorService messagingExecutor, ExecutorService startupExecutor) throws InvalidConfigurationException
Loads the platform by loading every activeSite
.- Parameters:
platformConfig
- the currentPlatformProperties
env
- the currentEnvironment
siteName
- the (optional) name of theSite
that caused the platform reloadtarget
- an (optional) target to redirect to after platform reloadmessagingExecutor
- anExecutorService
used for cluster communication threadsstartupExecutor
- anExecutorService
used for starting sites in parallel- Throws:
InvalidConfigurationException
- if an configuration error occurred
-
loadPlatformProperties
public PlatformProperties loadPlatformProperties(Properties defaultOverrides, Environment env)
-
loadNodeProperties
public Properties loadNodeProperties(Environment env)
-
loadSite
@Transactional public void loadSite(Environment env, SiteImpl siteToLoad, FieldProcessor fp) throws InvalidConfigurationException
Loads the givenSite
.- Parameters:
env
- the currentEnvironment
siteToLoad
- theSite
to load- Throws:
InvalidConfigurationException
- if an configuration error occurred
-
loadSite
@Transactional public void loadSite(Environment env, SiteImpl siteToLoad, boolean sendReloadEvent, FieldProcessor fp) throws InvalidConfigurationException
Loads the givenSite
.- Parameters:
env
- the currentEnvironment
siteToLoad
- theSite
to load- Throws:
InvalidConfigurationException
- if an configuration error occurred
-
loadSite
public void loadSite(SiteImpl siteToLoad, javax.servlet.ServletContext servletContext, FieldProcessor fp) throws InvalidConfigurationException
Loads the givenSite
.- Parameters:
siteToLoad
- theSite
to loadservletContext
- the currentServletContext
- Throws:
InvalidConfigurationException
- if an configuration error occurred
-
loadSite
public void loadSite(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName) throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
-
getSiteLoader
public Runnable getSiteLoader(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName)
- Parameters:
siteToLoad
- theSite
to load, freshly loaded withCoreService.getSite(Integer)
orCoreService.getSiteByName(String)
env
- the currentEnvironment
sendReloadEvent
- whether or not aReloadSiteEvent
should be sentfp
- aFieldProcessor
to attach messages tosetThreadName
-- Returns:
- the
Runnable
-
startApplication
protected boolean startApplication(Environment env, SiteImpl site, ApplicationProvider application)
-
getPlaceholderConfigurer
protected org.springframework.context.support.PropertySourcesPlaceholderConfigurer getPlaceholderConfigurer(Properties props)
-
shutdownPlatform
public void shutdownPlatform(javax.servlet.ServletContext ctx)
Shuts down the whole platform by shutting down every activeSite
.- Parameters:
ctx
- the currentServletContext
- See Also:
shutDownSite(Environment, Site, boolean)
-
shutDownSite
public void shutDownSite(Environment env, Site site, boolean removeFromSiteMap)
Shuts down the givenSite
.- Parameters:
env
- the currentEnvironment
.site
- theSite
to shut down
-
getCoreService
public CoreService getCoreService()
-
setCoreService
public void setCoreService(CoreService coreService)
-
-