public class SystemConfig extends Object implements ObjectFactoryModule, Serializable
ObjectFactoryModule
,
AppInfoCollector
,
Serialized FormModifier and Type | Field and Description |
---|---|
static String |
ACTUAL_CONFIG_PATH_PROPERTY
The ACTUAL CONFIG PATH PROPERTY.
|
static String |
ACTUAL_DATA_PATH_PROPERTY
The ACTUAL DATA PATH PROPERTY.
|
static String |
ACTUAL_LICENSE_PATH_PROPERTY
The ACTUAL LICENSE PATH PROPERTY.
|
static String |
ACTUAL_LOG_PATH_PROPERTY
The ACTUAL LOAG PATH PROPERTY.
|
static String |
APP_DATA
The Constant APP_DATA.
|
static String |
APP_FRAME_ICON
The APPLICATION FRAME ICON property.
|
static String |
APP_NAME
The APPLICATION NAME property.
|
static String |
BUILD_DATE
BUILD DATE property.
|
static String |
CACHE_SQL_STATEMENTS_PROPERTY
The CACHE_SQL_STATEMENTS_PROPERTY.
|
static String |
CLIENT_DEPLOYMENT
CLIENT DEPLOYMENT - regular client app without server tier.
|
static String |
CLIENT_MODE
The CLIENT MODE name.
|
static String |
CLIENT_SERVER_MODE
The CLIENT SERVER MODE name.
|
static String |
CONFIG_FILE_NAME
The property which defines the name of the main properties file.
|
static String |
COPYRIGHT
COPYRIGHT property.
|
static String |
DATA_CONFIG_PATH
DATA CONFIG suffix.
|
static String |
DATA_FOLDER_PATH
DATA FOLDER PATH suffix.
|
static String |
DATA_PATH_PROPERTY
DATA PATH PROPERTY.
|
static String |
DEFAULT_LANG
The DEFAULT LANGUAGE.
|
static String |
DEFAULT_VENDOR
DEFAULT VENDOR.
|
static String |
DEPLOYMENT_PROPERTY
DEPLOYMENT PROPERTY.
|
static String |
ERRORS_PATH
ERRORS PATH suffix.
|
static String |
HISTORY_FOLDER
The history folder.
|
static String |
HOME_PATH_PROPERTY
HOME PATH PROPERTY.
|
static String |
HTTP_PROXY_EXCLUDE
HTTP PROXY EXCLUDE property.
|
static String |
HTTP_PROXY_HOST
HTTP PROXY HOST property.
|
static String |
HTTP_PROXY_PASSWORD
HTTP PROXY PASSWORD property.
|
static String |
HTTP_PROXY_PORT
HTTP PROXY PORT property.
|
static String |
HTTP_PROXY_TYPE
HTTP PROXY TYPE property.
|
static String |
HTTP_PROXY_USER
HTTP PROXY USER property.
|
static String |
IDE_CONFIG_FILE_PROPERTY
The IDE CONFIG FILE PROPERTY.
|
static String |
IDE_SETTINGS_FILE_NAME
The IDE SETTINGS FILE NAME PROPERTY.
|
static String |
IDE_SETTINGS_FILE_PROPERTY
The IDE SETTINGS FILE PROPERTY.
|
static String |
JAR_PREFIX
The default prefix for the framework jar files.
|
static String |
JDBC_PATH
JDBC PATH suffix.
|
static String |
LIB_PATH
LIB PATH suffix.
|
static String |
LOCAL_CLASSPATH
LOCAL CLASSPATH property.
|
static String |
LOG_FILE_NAME
The LOG_FILE_NAME property.
|
static String |
LOGS_PATH
The Constant LOGS_PATH.
|
static String |
ON_START_UP
The ON_START_UP property.
|
static String |
ON_START_UP_AS_CONFIGURED
Start app as configured.
|
static String |
ON_START_UP_CLIENT
Always start app in the client mode.
|
static String |
ON_START_UP_CLIENT_IF
Start app in the client mode if server not found or not responding.
|
static String |
PLUGIN_PATH
PLUGIN PATH suffix.
|
static String |
ROOT_DATA_PATH_PROPERTY
The ROOT DATA PATH PROPERTY.
|
static String |
SCRIPTS_PATH
SCRIPTS PATH suffix.
|
static String |
SERVER_BASE_URL
SERVER BASE URL property.
|
static String |
SERVER_DEPLOYMENT
SERVER DEPLOYMENT - server side deployment.
|
static String |
SERVER_URL
SERVER URL property.
|
static String |
SHARED_CLASSPATH
SHARED CLASSPATH property.
|
static String |
SHELL_EXT_PROP
SHELL EXTENSION PROP.
|
static String |
SPRING_CONFIG_LOCATION_PROPERTY
The location of the SPRING application properties file.
|
static String |
TEMP_PATH
TEMP PATH suffix.
|
static String |
TEST_DEPLOYMENT
TEST_DEPLOYMENT - unit test.
|
static String |
TITLE
TITLE property.
|
static String |
UPDATE_URL
UPDATE URL property.
|
static String |
URL_TOKENS
The prefix for properties which represent url tokens.
|
static String |
VENDOR
VENDOR property.
|
static String |
VERSION
VERSION property.
|
static String |
WEB_MODE
The WEB MODE name.
|
static String |
WEB_SERVICE_DEPLOYMENT
WEB-SERVICE DEPLOYMENT - web service deployment.
|
static String |
WORKING_PATH
WORKING PATH.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(String fromName,
String toName)
Binds fromName to toName.
|
boolean |
canSwitchToClientMode()
Checks if app can switch to client mode.
|
String |
get(String name)
Gets the binded name by the original name.
|
String |
get(String name,
String defaultValue)
Gets the value of the property.
|
String |
get(String name,
String defaultValue,
Map<String,String> sysProperties)
Gets the value of the property.
|
String |
getAltLibsPath()
Gets the lib path for the test mode.
|
AppInfo |
getAppInfo()
Gets the application root path.
|
String |
getAppName()
Gets the application name.
|
String |
getBuildDate()
Gets the build date in the MM/dd/yyyy HH:mm:ss format.
|
String |
getConfigFolderName()
Gets the configuration folder path.
|
Map<String,String> |
getContextProperties()
Gets either system properties or tenant properties or local thread
properties.
|
String |
getDataConfigFolder()
Gets the temp folder path.
|
String |
getDataFolderName()
Gets the data folder path.
|
String |
getDeploymentType()
Gets the deployment type.
|
String |
getErrorsFolder()
Gets the errors folder path.
|
EtlThreadContext |
getEtlThreadContext()
Gets the etl thread context.
|
String |
getFileName(String fileName,
String path)
Gets the file name.
|
String |
getHistoryFolder()
Gets the history folder.
|
String |
getHome()
Gets the home folder path.
|
String |
getKillFolder()
Gets the kill folder.
|
String |
getLibsPath()
Gets the lib path.
|
String |
getLicenseFolderName()
Gets the folder name for software the licenses.
|
LocalEtlThreadContext |
getLocalEtlThreadContext()
Gets the local etl thread context.
|
Map<String,String> |
getLocalProperties()
Gets either system properties or tenant properties.
|
String |
getLogsFolder()
Gets the logs folder path.
|
String |
getMode()
Gets the mode.
|
String |
getObjectProperty(Object object)
Returns system property using the following algorithm:
getSystemProperty(object.getClass().getName() + "." + object.toString(),
object.toString()) |
String |
getOnStartUpBehavior()
Gets the on start up behavior.
|
String |
getPathByProp(String propName,
String defaultPath)
Gets the path by property.
|
String |
getPathUsingAppFolders(String path)
Gets the path using default app folders {app.home}, {app.data} and
{app.rootdata}.
|
String |
getPluginsPath()
Gets the plug ins path.
|
Map<String,String> |
getProperties()
Gets either system properties or tenant properties.
|
String |
getProperty(String name)
Gets the property.
|
Map<String,String> |
getPropsByMask(String mask)
Gets the properties by mask.
|
String |
getRootDataFolderPath()
Gets the root data folder path.
|
String |
getScriptsFolder()
Gets the scripts folder path.
|
String |
getServerBaseUrl()
Gets the server base url.
|
String |
getServerUrl()
Gets the server url.
|
Map<String,String> |
getSysProperties()
Gets the sys properties.
|
Map<String,String> |
getSystemProperties()
Gets the system properties.
|
Properties |
getSystemPropertiesAsProperties()
Gets the system properties as properties.
|
String |
getSystemProperty(String name)
Gets the system property by name.
|
String |
getSystemProperty(String name,
String defaultValue)
Gets the system property by name.
|
String |
getSystemProperty(String name,
String defaultValue,
Map<String,String> sysProperties)
Gets the system property by name.
|
String |
getSystemPropertyForDeployment(String name,
String defaultValue)
Gets the system property for deployment.
|
String |
getTempFolder()
Gets the temp folder path.
|
ThreadContext |
getThreadContext()
Gets the thread context.
|
String |
getTitle(String defaultTile)
Gets the app title.
|
String |
getUpdateFolder()
Gets the update folder.
|
String |
getVersion()
Gets the product version.
|
static SystemConfig |
instance()
Returns SystemConfig instance.
|
boolean |
isClient()
Checks if it is a client deployment.
|
boolean |
isClientServer()
Checks if it is a client-server mode.
|
boolean |
isServer()
Checks if it is a server deployment.
|
boolean |
isWebService()
Checks if it is a web service deployment.
|
void |
loadProps(String resourceName)
Loads properties from the resourceName.
|
Properties |
loadPropsFromClassPath(String resourceName)
Loads properties from class path.
|
Properties |
loadPropsFromFile(String fileName)
Loads properties from the file.
|
boolean |
mustSwitchToClientMode()
Returns true if app must switch to client mode.
|
void |
realodProperties()
Realod properties.
|
void |
removeEtlThreadContext()
Removes the etl thread context.
|
void |
removeLocalEtlThreadContext()
Removes the local etl thread context.
|
void |
removeSystemProperty(String name)
Removes the system property.
|
void |
removeThreadContext()
Removes the thread context.
|
void |
resetToClientMode()
Resets system to client mode.
|
void |
setEtlThreadContext(EtlThreadContext threadContext)
Sets the etl thread context.
|
void |
setLocalEtlThreadContext(LocalEtlThreadContext localThreadContext)
Sets the local etl thread context.
|
void |
setSystemProperty(String name,
String value)
Sets the system property.
|
void |
setThreadContext(ThreadContext threadContext)
Sets the thread context.
|
String |
toString() |
public static final String APP_DATA
public static final String DEFAULT_VENDOR
public static final String DEFAULT_LANG
public static final String CLIENT_MODE
public static final String CLIENT_SERVER_MODE
public static final String WEB_MODE
public static final String CLIENT_DEPLOYMENT
public static final String SERVER_DEPLOYMENT
public static final String WEB_SERVICE_DEPLOYMENT
public static final String TEST_DEPLOYMENT
public static final String HISTORY_FOLDER
public static final String WORKING_PATH
public static final String DATA_FOLDER_PATH
public static final String CONFIG_FILE_NAME
public static final String JAR_PREFIX
public static final String LIB_PATH
public static final String PLUGIN_PATH
public static final String ERRORS_PATH
public static final String TEMP_PATH
public static final String DATA_CONFIG_PATH
public static final String LOGS_PATH
public static final String SCRIPTS_PATH
public static final String JDBC_PATH
public static final String URL_TOKENS
public static final String SERVER_URL
public static final String SERVER_BASE_URL
public static final String UPDATE_URL
public static final String ON_START_UP
public static final String HTTP_PROXY_HOST
public static final String HTTP_PROXY_PORT
public static final String HTTP_PROXY_USER
public static final String HTTP_PROXY_TYPE
public static final String HTTP_PROXY_PASSWORD
public static final String HTTP_PROXY_EXCLUDE
public static final String HOME_PATH_PROPERTY
public static final String ACTUAL_DATA_PATH_PROPERTY
public static final String ACTUAL_LOG_PATH_PROPERTY
public static final String ACTUAL_CONFIG_PATH_PROPERTY
public static final String ACTUAL_LICENSE_PATH_PROPERTY
public static final String DATA_PATH_PROPERTY
public static final String ROOT_DATA_PATH_PROPERTY
public static final String DEPLOYMENT_PROPERTY
public static final String SHELL_EXT_PROP
public static final String TITLE
public static final String VENDOR
public static final String COPYRIGHT
public static final String VERSION
public static final String BUILD_DATE
public static final String APP_NAME
public static final String LOG_FILE_NAME
public static final String APP_FRAME_ICON
public static final String SHARED_CLASSPATH
public static final String LOCAL_CLASSPATH
public static final String IDE_SETTINGS_FILE_NAME
public static final String IDE_CONFIG_FILE_PROPERTY
public static final String IDE_SETTINGS_FILE_PROPERTY
public static final String SPRING_CONFIG_LOCATION_PROPERTY
public static final String CACHE_SQL_STATEMENTS_PROPERTY
public static final String ON_START_UP_AS_CONFIGURED
public static final String ON_START_UP_CLIENT_IF
public static final String ON_START_UP_CLIENT
public static SystemConfig instance()
public void bind(String fromName, String toName)
ObjectFactoryModule
bind
in interface ObjectFactoryModule
fromName
- the "from" class nametoName
- the "to" class namepublic boolean canSwitchToClientMode()
public String get(String name)
ObjectFactoryModule
get
in interface ObjectFactoryModule
name
- the original namepublic String get(String name, String defaultValue)
name
- the property namedefaultValue
- the default valuepublic String get(String name, String defaultValue, Map<String,String> sysProperties)
name
- the property namedefaultValue
- the default valuesysProperties
- the pre-populated sys propertiespublic String getAltLibsPath()
public AppInfo getAppInfo()
public String getAppName()
public String getConfigFolderName()
public String getDataFolderName()
public String getDeploymentType()
public String getErrorsFolder()
public String getTempFolder()
public String getDataConfigFolder()
public String getLogsFolder()
public String getFileName(String fileName, String path)
fileName
- the file namepath
- the pathpublic String getHistoryFolder()
public String getHome()
public String getLibsPath()
public String getLicenseFolderName()
public String getMode()
public String getObjectProperty(Object object)
getSystemProperty(object.getClass().getName() + "." + object.toString(),
object.toString())
object
- the objectpublic String getOnStartUpBehavior()
public String getPathByProp(String propName, String defaultPath)
propName
- the property namedefaultPath
- the default pathpublic String getPathUsingAppFolders(String path)
path
- the pathpublic String getPluginsPath()
public String getProperty(String name)
name
- the property namepublic Map<String,String> getPropsByMask(String mask)
mask
- the maskpublic String getRootDataFolderPath()
public String getKillFolder()
public String getScriptsFolder()
public String getServerBaseUrl()
public String getServerUrl()
public Map<String,String> getSystemProperties()
public Properties getSystemPropertiesAsProperties()
public String getSystemProperty(String name)
name
- the name of the propertypublic String getSystemProperty(String name, String defaultValue)
name
- the namedefaultValue
- the default valuepublic String getSystemProperty(String name, String defaultValue, Map<String,String> sysProperties)
name
- the namedefaultValue
- the default valuesysProperties
- the pre-populated sys propertiespublic Map<String,String> getSysProperties()
public String getSystemPropertyForDeployment(String name, String defaultValue)
Example:
app.test.client=abc
app.test.server=xyz
name
- the namedefaultValue
- the default valuepublic ThreadContext getThreadContext()
public EtlThreadContext getEtlThreadContext()
public LocalEtlThreadContext getLocalEtlThreadContext()
public Map<String,String> getProperties()
public Map<String,String> getContextProperties()
public Map<String,String> getLocalProperties()
public String getTitle(String defaultTile)
defaultTile
- the default tilepublic String getUpdateFolder()
public String getVersion()
public String getBuildDate()
public boolean isClient()
public boolean isClientServer()
public boolean isServer()
public boolean isWebService()
public void loadProps(String resourceName)
resourceName
- the resource namepublic Properties loadPropsFromClassPath(String resourceName)
resourceName
- the resource namepublic Properties loadPropsFromFile(String fileName)
fileName
- the file namepublic boolean mustSwitchToClientMode()
public void realodProperties()
public void removeSystemProperty(String name)
name
- the property's namepublic void removeThreadContext()
public void removeEtlThreadContext()
public void removeLocalEtlThreadContext()
public void resetToClientMode()
public void setSystemProperty(String name, String value)
name
- the name of the propertyvalue
- the valuepublic void setThreadContext(ThreadContext threadContext)
threadContext
- the new thread contextpublic void setEtlThreadContext(EtlThreadContext threadContext)
threadContext
- the new etl thread contextpublic void setLocalEtlThreadContext(LocalEtlThreadContext localThreadContext)
localThreadContext
- the new local etl thread contextpublic String toString()
toString
in class Object
Copyright © 2010-2020 Toolsverse. All Rights Reserved.