org.appng.core.service

## Class InitializerService

- java.lang.Object
- - org.appng.core.service.InitializerService

-     public class InitializerService
      extends Object

  A service responsible for initializing the appNG platform with all active `Site`s.
  Author:
    Matthias Müller

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `APPNG_GROUP`
    `static String` | `APPNG_USER`
    `protected PlatformEventListener` | `auditableListener`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InitializerService()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CoreService` | `getCoreService()`
    `protected org.springframework.context.support.PropertySourcesPlaceholderConfigurer` | `getPlaceholderConfigurer(Properties props)`
    `Runnable` | `getSiteLoader(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName)` Returns a `Runnable` that loads the given `Site`.
    `void` | `initPlatform(PlatformProperties platformConfig, Environment env, DatabaseConnection rootConnection, javax.servlet.ServletContext ctx, ExecutorService executor)` Deprecated.
    `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)` Deprecated.
    `void` | `loadPlatform(PlatformProperties platformConfig, Environment env, String siteName, String target, ExecutorService messagingExecutor, ExecutorService startupExecutor)` Loads the platform by loading every active `Site`.
    `PlatformProperties` | `loadPlatformProperties(Properties defaultOverrides, Environment env)`
    `void` | `loadSite(Environment env, SiteImpl siteToLoad, boolean sendReloadEvent, FieldProcessor fp)` Loads the given `Site`.
    `void` | `loadSite(Environment env, SiteImpl siteToLoad, FieldProcessor fp)` Loads the given `Site`.
    `void` | `loadSite(SiteImpl siteToLoad, Environment env, boolean sendReloadEvent, FieldProcessor fp, boolean setThreadName)`
    `void` | `loadSite(SiteImpl siteToLoad, javax.servlet.ServletContext servletContext, FieldProcessor fp)` Loads the given `Site`.
    `void` | `loadSiteAsync(Environment env, SiteImpl siteToLoad, FieldProcessor fp)`
    `void` | `reloadPlatform(Properties config, Environment env, String siteName, String target, ExecutorService messagingExecutor)` Deprecated. will be removed with no replacement
    `void` | `setCoreService(CoreService coreService)`
    `void` | `shutdownPlatform(javax.servlet.ServletContext ctx)` Shuts down the whole platform by shutting down every active `Site`.
    `void` | `shutDownSite(Environment env, Site site, boolean removeFromSiteMap)` Shuts down the given `Site`.
    `protected boolean` | `startApplication(Environment env, SiteImpl site, ApplicationProvider application)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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

  - ### Constructor Detail

    - #### InitializerService

          public InitializerService()

  - ### Method Detail

    - #### initPlatform

          @Transactional
           @Deprecated
          public void initPlatform(PlatformProperties platformConfig,
                                                               Environment env,
                                                               DatabaseConnection rootConnection,
                                                               javax.servlet.ServletContext ctx,
                                                               ExecutorService executor)
                                                        throws InvalidConfigurationException

      Deprecated.
      Throws:
        `InvalidConfigurationException`

    - #### 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 current `PlatformProperties`
        `env` - the current `Environment`
        `rootConnection` - the root `DatabaseConnection`
        `ctx` - the current `ServletContext`
        `messagingExecutor` - an `ExecutorService` used for cluster communication threads
        `startupExecutor` - an `ExecutorService` used for starting sites in parallel
      Throws:
        `InvalidConfigurationException` - if an configuration error occurred
      See Also:
        `loadPlatform(PlatformProperties, Environment, String, String, ExecutorService)`

    - #### reloadPlatform

          @Deprecated
          public void reloadPlatform(Properties config,
                                                 Environment env,
                                                 String siteName,
                                                 String target,
                                                 ExecutorService messagingExecutor)
                                          throws InvalidConfigurationException

      Deprecated. will be removed with no replacement
      Parameters:
        `config` -
        `env` -
        `siteName` -
        `target` -
        `messagingExecutor` -
      Throws:
        `InvalidConfigurationException`

    - #### loadPlatform

          @Deprecated
          public void loadPlatform(PlatformProperties platformConfig,
                                               Environment env,
                                               String siteName,
                                               String target,
                                               ExecutorService messagingExecutor)
                                        throws InvalidConfigurationException

      Deprecated.
      Throws:
        `InvalidConfigurationException`

    - #### loadPlatform

          public void loadPlatform(PlatformProperties platformConfig,
                                   Environment env,
                                   String siteName,
                                   String target,
                                   ExecutorService messagingExecutor,
                                   ExecutorService startupExecutor)
                            throws InvalidConfigurationException

      Loads the platform by loading every active `Site`.
      Parameters:
        `platformConfig` - the current `PlatformProperties`
        `env` - the current `Environment`
        `siteName` - the (optional) name of the `Site` that caused the platform reload
        `target` - an (optional) target to redirect to after platform reload
        `messagingExecutor` - an `ExecutorService` used for cluster communication threads
        `startupExecutor` - an `ExecutorService` 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 given `Site`.
      Parameters:
        `env` - the current `Environment`
        `siteToLoad` - the `Site` to load
      Throws:
        `InvalidConfigurationException` - if an configuration error occurred

    - #### loadSiteAsync

          public void loadSiteAsync(Environment env,
                                    SiteImpl siteToLoad,
                                    FieldProcessor fp)
                             throws InvalidConfigurationException

      Throws:
        `InvalidConfigurationException`

    - #### loadSite

          @Transactional
          public void loadSite(Environment env,
                                              SiteImpl siteToLoad,
                                              boolean sendReloadEvent,
                                              FieldProcessor fp)
                                       throws InvalidConfigurationException

      Loads the given `Site`.
      Parameters:
        `env` - the current `Environment`
        `siteToLoad` - the `Site` 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 given `Site`.
      Parameters:
        `siteToLoad` - the `Site` to load
        `servletContext` - the current `ServletContext`
      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)

      Returns a `Runnable` that loads the given `Site`.
      Parameters:
        `siteToLoad` - the `Site` to load, freshly loaded with `CoreService.getSite(Integer)` or `CoreService.getSiteByName(String)`
        `env` - the current `Environment`
        `sendReloadEvent` - whether or not a `ReloadSiteEvent` should be sent
        `fp` - a `FieldProcessor` to attach messages to
        `setThreadName` -
      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 active `Site`.
      Parameters:
        `ctx` - the current `ServletContext`
      See Also:
        `shutDownSite(Environment, Site, boolean)`

    - #### shutDownSite

          public void shutDownSite(Environment env,
                                   Site site,
                                   boolean removeFromSiteMap)

      Shuts down the given `Site`.
      Parameters:
        `env` - the current `Environment`.
        `site` - the `Site` to shut down

    - #### getCoreService

          public CoreService getCoreService()

    - #### setCoreService

          public void setCoreService(CoreService coreService)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.