Package com.zfabrik.util.runtime

## Class Foundation

- java.lang.Object
- - com.zfabrik.util.runtime.Foundation

-     public class Foundation
      extends java.lang.Object

  The Foundation class holds basic configuration and the most basic information routines applying to the z2 installation and the running process
  Author:
    Henning Blohm

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `CONFIG_FILE` | System property that can be specified for the home process and will be propagated to worker processes to name the config properties file.
    `static java.lang.String` | `CONFIG_FILE_DEF` | Default config file.
    `static java.lang.String` | `HOME` | System property that defines the z2 home folder.
    `static java.lang.String` | `HOME_CLUSTER` | In order to provide cluster wide distinguishing and grouping of z2 processes they may share or distringuish by a cluster id
    `static java.lang.String` | `HOME_CONCURRENCY` | pre-configured process concurrency to be set on the default application thread pool (sys prop)
    `static java.lang.String` | `HOME_LAYOUT_BIN` | Home layout folder for main bin artifacts to start z2
    `static java.lang.String` | `HOME_LAYOUT_COMPONENT` | The home layout to start (sys prop).
    `static java.lang.String` | `HOME_LAYOUT_DATA` | file system layout: Folder for local data.
    `static java.lang.String` | `HOME_LAYOUT_LOCAL` | Home layout folder for local pre-built repo
    `static java.lang.String` | `HOME_LAYOUT_REPOS` | file system layout: Folder for repo caches.
    `static java.lang.String` | `HOME_LAYOUT_WORK` | file system layout: Folder for temporary data.
    `static java.lang.String` | `HOME_START` | The home system states to attain and keep.
    `static java.lang.String` | `INSTANCE_ID` | Instance id of the home process when conveyed to a child process by a system property
    `static java.lang.String` | `LANGUAGE_LEVEL` | Language level of the built-in Java compiler.
    `static java.lang.String` | `MODE` | A z2 process may be started in development mode, if setting this system property to the value `development`.
    `static java.lang.String` | `MODE_DEVELOPMENT` | Value to system propery `MODE` for the development mode
    `static java.lang.String` | `OFFLINE` | The system can be run in offline mode.
    `static java.lang.String` | `PROCESS_WORKER` | Component name of the worker process, passed as system property to a child process
    `static java.lang.String` | `PROXY_AUTH` | If set to `BASIC` (case independent), the all system properties <protocol>.proxyUser and <protocol>.proxyPassword will be considered for basic authentication to a proxy server.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Foundation()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static long` | `getCoreBuildVersion()` | Returns the core build number.
    `static java.io.File` | `getHomeFolder()` | Determine the home folder, that is, the place where repositories will be auto-discovered
    `static java.lang.String` | `getInstanceId()` | The runtime instance identifier for the stand alone or home process.
    `static java.util.Properties` | `getProperties()` |
    `static boolean` | `isDevelopmentMode()` | Returns true if and only if the system is running in development mode.
    `static boolean` | `isOfflineMode()` | Convenience check for the boolean system property `OFFLINE`.
    `static boolean` | `isWorker()` |

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

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

- - ### Field Detail

    - #### HOME

          public static final java.lang.String HOME

      System property that defines the z2 home folder. If not set defaults to the environment property Z2_HOME if that is not set either, it will default to "../..".
      See Also:
        Constant Field Values

    - #### MODE

          public static final java.lang.String MODE

      A z2 process may be started in development mode, if setting this system property to the value `development`.

      In development mode the runtime may support development specific features like test code compilation

      See Also:
        Constant Field Values

    - #### MODE_DEVELOPMENT

          public static final java.lang.String MODE_DEVELOPMENT

      Value to system propery `MODE` for the development mode
      See Also:
        Constant Field Values

    - #### OFFLINE

          public static final java.lang.String OFFLINE

      The system can be run in offline mode. If so, component repositories are requested to avoid attempts to connect to remote repositories. Set this system property to `true` to run in offline mode. Defaults to `false`
      See Also:
        Constant Field Values

    - #### CONFIG_FILE

          public static final java.lang.String CONFIG_FILE

      System property that can be specified for the home process and will be propagated to worker processes to name the config properties file. This config should strictly contains ONLY configuration that applies to the home and all processes started from there - standalone or embedded. Process level configuration should be passed as system properties
      See Also:
        Constant Field Values

    - #### CONFIG_FILE_DEF

          public static final java.lang.String CONFIG_FILE_DEF

      Default config file.
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_COMPONENT

          public static final java.lang.String HOME_LAYOUT_COMPONENT

      The home layout to start (sys prop). This is kept for compatibility reasons and simply adds to `HOME_START`
      See Also:
        Constant Field Values

    - #### HOME_START

          public static final java.lang.String HOME_START

      The home system states to attain and keep. Can be specified as comma-separated list
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_WORK

          public static final java.lang.String HOME_LAYOUT_WORK

      file system layout: Folder for temporary data. Using code must use a subfolder!
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_REPOS

          public static final java.lang.String HOME_LAYOUT_REPOS

      file system layout: Folder for repo caches. Depends on installation folder. Is computed and available via the foundation
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_DATA

          public static final java.lang.String HOME_LAYOUT_DATA

      file system layout: Folder for local data. Depends on installation folder. Is computed and available via the foundation
      See Also:
        Constant Field Values

    - #### HOME_CONCURRENCY

          public static final java.lang.String HOME_CONCURRENCY

      pre-configured process concurrency to be set on the default application thread pool (sys prop)
      See Also:
        Constant Field Values

    - #### PROCESS_WORKER

          public static final java.lang.String PROCESS_WORKER

      Component name of the worker process, passed as system property to a child process
      See Also:
        Constant Field Values

    - #### INSTANCE_ID

          public static final java.lang.String INSTANCE_ID

      Instance id of the home process when conveyed to a child process by a system property
      See Also:
        Constant Field Values

    - #### HOME_CLUSTER

          public static final java.lang.String HOME_CLUSTER

      In order to provide cluster wide distinguishing and grouping of z2 processes they may share or distringuish by a cluster id
      See Also:
        Constant Field Values

    - #### LANGUAGE_LEVEL

          public static final java.lang.String LANGUAGE_LEVEL

      Language level of the built-in Java compiler. Currently supported values are "6" or "7". Is determined from the JDK used by default.
      See Also:
        Constant Field Values

    - #### PROXY_AUTH

          public static final java.lang.String PROXY_AUTH

      If set to `BASIC` (case independent), the all system properties <protocol>.proxyUser and <protocol>.proxyPassword will be considered for basic authentication to a proxy server.
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_LOCAL

          public static final java.lang.String HOME_LAYOUT_LOCAL

      Home layout folder for local pre-built repo
      See Also:
        Constant Field Values

    - #### HOME_LAYOUT_BIN

          public static final java.lang.String HOME_LAYOUT_BIN

      Home layout folder for main bin artifacts to start z2
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Foundation

          public Foundation()

  - ### Method Detail

    - #### getCoreBuildVersion

          public static long getCoreBuildVersion()

      Returns the core build number. This can be used to compare versions of the runtime core. It is made up of year, month, day, hour, minute.

    - #### getInstanceId

          public static java.lang.String getInstanceId()

      The runtime instance identifier for the stand alone or home process. This does normally not need to be specified and should not. Any non-worker process will allocate an instance identifier at startup. Instance identifiers make sure that resources that cannot safely be shared among different z2 runtimes (such as e.g. Java runtime resources) can be separated. Instance allocation however is transient and lost at termination of the home or stand alone z2 process.

    - #### isDevelopmentMode

          public static boolean isDevelopmentMode()

      Returns true if and only if the system is running in development mode. This is equivalent to the test of the system property `MODE`. The method returns true only if this property is set to "development" (case-sensitive check!), any other value (including empty or null) yields to false.
      Returns:
        true if system is running in dev-mode, false otherwise

    - #### getProperties

          public static java.util.Properties getProperties()

    - #### isWorker

          public static boolean isWorker()

    - #### isOfflineMode

          public static boolean isOfflineMode()

      Convenience check for the boolean system property `OFFLINE`.
      Returns:

    - #### getHomeFolder

          public static java.io.File getHomeFolder()

      Determine the home folder, that is, the place where repositories will be auto-discovered