Package com.zfabrik.util.runtime
Class Foundation
java.lang.Object
com.zfabrik.util.runtime.Foundation
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
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property that can be specified for the home process and will be propagated to worker processes to name the config properties file.static final StringDefault config file.static final StringSystem property that defines the z2 home folder.static final StringIn order to provide cluster wide distinguishing and grouping of z2 processes they may share or distringuish by a cluster idstatic final Stringpre-configured process concurrency to be set on the default application thread pool (sys prop)static final StringHome layout folder for main bin artifacts to start z2static final StringThe home layout to start (sys prop).static final Stringfile system layout: Folder for local data.static final StringHome layout folder for local pre-built repostatic final Stringfile system layout: Folder for repo caches.static final Stringfile system layout: Folder for temporary data.static final StringThe home system states to attain and keep.static final StringInstance id of the home process when conveyed to a child process by a system propertystatic final StringLanguage level of the built-in Java compiler.static final StringA z2 process may be started in development mode, if setting this system property to the valuedevelopment.static final StringValue to system properyMODEfor the development modestatic final StringThe system can be run in offline mode.static final StringComponent name of the worker process, passed as system property to a child processstatic final StringIf set toBASIC(case independent), the all system properties <protocol>.proxyUser and <protocol>.proxyPassword will be considered for basic authentication to a proxy server.static final StringZ2 version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longReturns the core build number.static FileDetermine the home folder, that is, the place where repositories will be auto-discoveredstatic StringThe runtime instance identifier for the stand alone or home process.static Propertiesstatic booleanReturns true if and only if the system is running in development mode.static booleanConvenience check for the boolean system propertyOFFLINE.static booleanisWorker()
-
Field Details
-
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
A z2 process may be started in development mode, if setting this system property to the valuedevelopment.In development mode the runtime may support development specific features like test code compilation
- See Also:
-
MODE_DEVELOPMENT
Value to system properyMODEfor the development mode- See Also:
-
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 totrueto run in offline mode. Defaults tofalse- See Also:
-
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
Default config file.- See Also:
-
HOME_LAYOUT_COMPONENT
The home layout to start (sys prop). This is kept for compatibility reasons and simply adds toHOME_START- See Also:
-
HOME_START
The home system states to attain and keep. Can be specified as comma-separated list- See Also:
-
HOME_LAYOUT_WORK
file system layout: Folder for temporary data. Using code must use a subfolder!- See Also:
-
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
file system layout: Folder for local data. Depends on installation folder. Is computed and available via the foundation- See Also:
-
HOME_CONCURRENCY
pre-configured process concurrency to be set on the default application thread pool (sys prop)- See Also:
-
PROCESS_WORKER
Component name of the worker process, passed as system property to a child process- See Also:
-
INSTANCE_ID
Instance id of the home process when conveyed to a child process by a system property- See Also:
-
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
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
If set toBASIC(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
Home layout folder for local pre-built repo- See Also:
-
HOME_LAYOUT_BIN
Home layout folder for main bin artifacts to start z2- See Also:
-
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
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 propertyMODE. 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
-
isWorker
public static boolean isWorker() -
isOfflineMode
public static boolean isOfflineMode()Convenience check for the boolean system propertyOFFLINE.- Returns:
-
getHomeFolder
Determine the home folder, that is, the place where repositories will be auto-discovered
-