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 String
System property that can be specified for the home process and will be propagated to worker processes to name the config properties file.static final String
Default config file.static final String
System property that defines the z2 home folder.static final String
In order to provide cluster wide distinguishing and grouping of z2 processes they may share or distringuish by a cluster idstatic final String
pre-configured process concurrency to be set on the default application thread pool (sys prop)static final String
Home layout folder for main bin artifacts to start z2static final String
The home layout to start (sys prop).static final String
file system layout: Folder for local data.static final String
Home layout folder for local pre-built repostatic final String
file system layout: Folder for repo caches.static final String
file system layout: Folder for temporary data.static final String
The home system states to attain and keep.static final String
Instance id of the home process when conveyed to a child process by a system propertystatic final String
Language level of the built-in Java compiler.static final String
A z2 process may be started in development mode, if setting this system property to the valuedevelopment
.static final String
Value to system properyMODE
for the development modestatic final String
The system can be run in offline mode.static final String
Component name of the worker process, passed as system property to a child processstatic final String
If 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 String
Z2 version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic long
Returns the core build number.static File
Determine the home folder, that is, the place where repositories will be auto-discoveredstatic String
The runtime instance identifier for the stand alone or home process.static Properties
static boolean
Returns true if and only if the system is running in development mode.static boolean
Convenience check for the boolean system propertyOFFLINE
.static boolean
isWorker()
-
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 properyMODE
for 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 totrue
to 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
-