Class Foundation

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

public class Foundation extends 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 Details

    • HOME

      public static final 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:
    • MODE

      public static final 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:
    • MODE_DEVELOPMENT

      public static final String MODE_DEVELOPMENT
      Value to system propery MODE for the development mode
      See Also:
    • OFFLINE

      public static final 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:
    • CONFIG_FILE

      public static final 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:
    • CONFIG_FILE_DEF

      public static final String CONFIG_FILE_DEF
      Default config file.
      See Also:
    • HOME_LAYOUT_COMPONENT

      public static final 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:
    • HOME_START

      public static final String HOME_START
      The home system states to attain and keep. Can be specified as comma-separated list
      See Also:
    • HOME_LAYOUT_WORK

      public static final String HOME_LAYOUT_WORK
      file system layout: Folder for temporary data. Using code must use a subfolder!
      See Also:
    • HOME_LAYOUT_REPOS

      public static final String HOME_LAYOUT_REPOS
      file system layout: Folder for repo caches. Depends on installation folder. Is computed and available via the foundation
      See Also:
    • HOME_LAYOUT_DATA

      public static final String HOME_LAYOUT_DATA
      file system layout: Folder for local data. Depends on installation folder. Is computed and available via the foundation
      See Also:
    • HOME_CONCURRENCY

      public static final String HOME_CONCURRENCY
      pre-configured process concurrency to be set on the default application thread pool (sys prop)
      See Also:
    • PROCESS_WORKER

      public static final String PROCESS_WORKER
      Component name of the worker process, passed as system property to a child process
      See Also:
    • INSTANCE_ID

      public static final String INSTANCE_ID
      Instance id of the home process when conveyed to a child process by a system property
      See Also:
    • HOME_CLUSTER

      public static final 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:
    • LANGUAGE_LEVEL

      public static final 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:
    • PROXY_AUTH

      public static final 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:
    • HOME_LAYOUT_LOCAL

      public static final String HOME_LAYOUT_LOCAL
      Home layout folder for local pre-built repo
      See Also:
    • HOME_LAYOUT_BIN

      public static final String HOME_LAYOUT_BIN
      Home layout folder for main bin artifacts to start z2
      See Also:
    • Z2_VERSION

      public static final String Z2_VERSION
      Z2 version
      See Also:
  • Constructor Details

    • Foundation

      public Foundation()
  • Method Details

    • 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 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 Properties getProperties()
    • isWorker

      public static boolean isWorker()
    • isOfflineMode

      public static boolean isOfflineMode()
      Convenience check for the boolean system property OFFLINE.
      Returns:
    • getHomeFolder

      public static File getHomeFolder()
      Determine the home folder, that is, the place where repositories will be auto-discovered