org.appng.api

## Interface ApplicationController

-     public interface ApplicationController

  Provides methods to startup and shutdown a `Application`. A `Application` is NOT forced to provide an implementation of this, it's completely optional. `Application`s which need to allocate/free some resources on startup/shutdown should use this interface. In each `Application` there can only be one bean implementing `ApplicationController`.
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addSite(Site site, Application application, Environment environment)` This method is called immediately after adding a `Application` from a `Site`, which has not been reloaded at this point.
    `boolean` | `removeSite(Site site, Application application, Environment environment)` This method is called immediately after removing a `Application` from a `Site`, which has not been reloaded at this point.
    `boolean` | `shutdown(Site site, Application application, Environment environment)` This method is called when a `Site` is being shutdown.
    `boolean` | `start(Site site, Application application, Environment environment)` This method is called when a `Site` is being (re)loaded.

- - ### Method Detail

    - #### start

          boolean start(Site site,
                        Application application,
                        Environment environment)

      This method is called when a `Site` is being (re)loaded. A `Application` is supposed to initialize itself within this method.
      Parameters:
        `site` - the `Site` to which the `Application` is assigned to
        `application` - the `Application` which is assigned to the `Site`
        `environment` - the current `Environment`
      Returns:
        `true` on success, `false` otherwise

    - #### shutdown

          boolean shutdown(Site site,
                           Application application,
                           Environment environment)

      This method is called when a `Site` is being shutdown. A `Application` is supposed to shutdown itself within this method (free resources etc.).
      Parameters:
        `site` - the `Site` to which the `Application` is assigned to
        `application` - the `Application` which is assigned to the `Site`
        `environment` - the current `Environment`
      Returns:
        `true` on success, `false` otherwise

    - #### removeSite

          boolean removeSite(Site site,
                             Application application,
                             Environment environment)

      This method is called immediately after removing a `Application` from a `Site`, which has not been reloaded at this point. The purpose is, similar to `shutdown(Site, Application, Environment)`, to free resources.
      Parameters:
        `site` - the `Site` from which the `Application` is being removed
        `application` - the `Application` which is being removed from the `Site`
        `environment` - the current `Environment`
      Returns:
        `true` on success, `false` otherwise

    - #### addSite

          boolean addSite(Site site,
                          Application application,
                          Environment environment)

      This method is called immediately after adding a `Application` from a `Site`, which has not been reloaded at this point.
      Parameters:
        `site` - the `Site` to which the `Application` was assigned to
        `application` - the `Application` which was assigned to the `Site`
        `environment` - the current `Environment`
      Returns:
        `true` on success, `false` otherwise

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