Package com.openfin.desktop
Class RuntimeConfiguration
- java.lang.Object
-
- org.json.JSONObject
-
- com.openfin.desktop.RuntimeConfiguration
-
public class RuntimeConfiguration extends org.json.JSONObjectConfiguration for launching OpenFin Runtime Created by wche on 3/26/2016.
-
-
Constructor Summary
Constructors Constructor Description RuntimeConfiguration()Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAppAsset(org.json.JSONObject assetConfig)Add configuration of an app assetvoidaddConfigurationItem(String key, Object value)Add a configuration setting for launching Runtime.voidaddService(String name, String manifestUrl)StringgenerateRuntimeConfig()Generates JSON string that can be passed as --config to RVM and InsallerStringgetAdditionalRvmArguments()Get additional arguments for RVM and InstallerStringgetLaunchRVMPath()return value of launchRVMPathStringgetLicenseKey()Get license key for RuntimeStringgetLocalManifestFileName()Get name of local manifest file nameStringgetManifestLocation()Get location of app manifest.intgetMaxMessageSize()Get max size of each message between Java adapter and RuntimeStringgetRuntimeFallbackVersion()Get fallback version number of Runtime to launchintgetRuntimePort()Get port number of Runtime websocket serverStringgetRuntimeVersion()Get version number of RuntimeStringgetSecurityRealm()Get security realmbooleanisDoNotLaunch()Get value of RVM option doNotLaunch settingbooleanisNonPersistent()Get value of nonPersistentbooleanisUseNamedPipePortDiscovery()static org.json.JSONObjectloadManifest(String manifestUrl)Utltity method to load a amnifest from an URLvoidsetAdditionalRuntimeArguments(String additionalRuntimeArguments)Set additional arguments for RuntimevoidsetAdditionalRvmArguments(String additionalRvmArguments)Set additional arguments for RVM and InstallervoidsetDevToolsPort(int port)Set port for accessing devtools on localhostvoidsetDialogSettings(org.json.JSONObject dialogSettings)set configuration to customize the appearance of the RVM progress dialogvoidsetDoNotLaunch(boolean doNotLaunch)RVM option, to perform all of the startup sequence steps but do not launch the appvoidsetLaunchRVMPath(String path)By default, Java adapter launches Runtime with OpenFin installer.voidsetLicenseKey(String licenseKey)Set license key for RuntimevoidsetLocalManifestFileName(String localManifestFileName)Set name of automatically generated local manifest file.voidsetManifestLocation(String manifestLocation)Set location of app manifestvoidsetMaxMessageSize(int maxMessageSize)Set max size of each message between Java adapter and RuntimevoidsetNonPersistent(Boolean nonPersistent)Automatically disconnect the adapter from the runtime when the last application or persistent connection closes Defaults to falsevoidsetRuntimeFallbackVersion(String runtimeFallbackVersion)Set fallback version number of Runtime to launchvoidsetRuntimePort(int runtimePort)Set port number of Runtime websocket servervoidsetRuntimeVersion(String version)Set version number of Runtime to launchvoidsetRvmVersion(String rvmVersion)set Defines the minimum RVM version the app requires.voidsetSecurityRealm(String securityRealm)Set security realm of RuntimevoidsetShortCut(org.json.JSONObject shortCut)set configuration for shortcutvoidsetSplashScreenImage(String splashScreenImage)Specify an image to display while the runtime is loading.voidsetStartupApp(org.json.JSONObject startupApp)Set configuration of startup application.voidsetSupportInformation(String supportInformation)Specify customized error messages during launchvoidsetUseNamedPipePortDiscovery(boolean useNamedPipePortDiscovery)-
Methods inherited from class org.json.JSONObject
accumulate, append, clear, doubleToString, entrySet, fromJson, fromJson, get, getBigDecimal, getBigInteger, getBoolean, getDouble, getEnum, getFloat, getInt, getJSONArray, getJSONObject, getLong, getMapType, getNames, getNames, getNumber, getString, has, increment, isDecimalNotation, isEmpty, isNull, keys, keySet, length, names, numberToString, opt, optBigDecimal, optBigInteger, optBoolean, optBoolean, optBooleanObject, optBooleanObject, optDouble, optDouble, optDoubleObject, optDoubleObject, optEnum, optEnum, optFloat, optFloat, optFloatObject, optFloatObject, optInt, optInt, optIntegerObject, optIntegerObject, optJSONArray, optJSONArray, optJSONObject, optJSONObject, optLong, optLong, optLongObject, optLongObject, optNumber, optNumber, optQuery, optQuery, optString, optString, put, put, put, put, put, put, put, put, putOnce, putOpt, query, query, quote, quote, remove, similar, stringToNumber, stringToValue, testValidity, toJSONArray, toMap, toString, toString, valueToString, wrap, write, write
-
-
-
-
Method Detail
-
setDevToolsPort
public void setDevToolsPort(int port)
Set port for accessing devtools on localhost- Parameters:
port- port number
-
setRuntimeVersion
public void setRuntimeVersion(String version)
Set version number of Runtime to launch- Parameters:
version- version number
-
getRuntimeVersion
public String getRuntimeVersion()
Get version number of Runtime- Returns:
- version of Runtime
-
getRuntimeFallbackVersion
public String getRuntimeFallbackVersion()
Get fallback version number of Runtime to launch- Returns:
- fallback version
-
setRuntimeFallbackVersion
public void setRuntimeFallbackVersion(String runtimeFallbackVersion)
Set fallback version number of Runtime to launch- Parameters:
runtimeFallbackVersion- fallback version of Runtime
-
setSecurityRealm
public void setSecurityRealm(String securityRealm)
Set security realm of Runtime- Parameters:
securityRealm- name of security realm
-
getSecurityRealm
public String getSecurityRealm()
Get security realm- Returns:
- security realm
-
setAdditionalRuntimeArguments
public void setAdditionalRuntimeArguments(String additionalRuntimeArguments)
Set additional arguments for Runtime- Parameters:
additionalRuntimeArguments- additional arguments
-
addAppAsset
public void addAppAsset(org.json.JSONObject assetConfig)
Add configuration of an app asset- Parameters:
assetConfig- configuration in JSON format
-
getAdditionalRvmArguments
public String getAdditionalRvmArguments()
Get additional arguments for RVM and Installer- Returns:
- additional arguments
-
setRvmVersion
public void setRvmVersion(String rvmVersion)
set Defines the minimum RVM version the app requires. This option is available in RVM 2.3 or greater- Parameters:
rvmVersion- version of RVM required
-
setShortCut
public void setShortCut(org.json.JSONObject shortCut)
set configuration for shortcut- Parameters:
shortCut- config for shortcut
-
setDialogSettings
public void setDialogSettings(org.json.JSONObject dialogSettings)
set configuration to customize the appearance of the RVM progress dialog- Parameters:
dialogSettings- config for dialog
-
setSplashScreenImage
public void setSplashScreenImage(String splashScreenImage)
Specify an image to display while the runtime is loading. It takes any image file (including semi-transparent PNGs)- Parameters:
splashScreenImage- URL of the image
-
setSupportInformation
public void setSupportInformation(String supportInformation)
Specify customized error messages during launch- Parameters:
supportInformation- config for support info
-
setAdditionalRvmArguments
public void setAdditionalRvmArguments(String additionalRvmArguments)
Set additional arguments for RVM and Installer- Parameters:
additionalRvmArguments- set additional arguments
-
setStartupApp
public void setStartupApp(org.json.JSONObject startupApp)
Set configuration of startup application.- Parameters:
startupApp- configuration in JSON format
-
getLicenseKey
public String getLicenseKey()
Get license key for Runtime- Returns:
- license key
-
setLicenseKey
public void setLicenseKey(String licenseKey)
Set license key for Runtime- Parameters:
licenseKey- license key
-
isNonPersistent
public boolean isNonPersistent()
Get value of nonPersistent- Returns:
- value of nonPersistent
-
setNonPersistent
public void setNonPersistent(Boolean nonPersistent)
Automatically disconnect the adapter from the runtime when the last application or persistent connection closes Defaults to false- Parameters:
nonPersistent- true for non persistent connection
-
setDoNotLaunch
public void setDoNotLaunch(boolean doNotLaunch)
RVM option, to perform all of the startup sequence steps but do not launch the app- Parameters:
doNotLaunch- true to add --do-not-launch options for RVM
-
isDoNotLaunch
public boolean isDoNotLaunch()
Get value of RVM option doNotLaunch setting- Returns:
- value of doNotLaunch
-
isUseNamedPipePortDiscovery
public boolean isUseNamedPipePortDiscovery()
-
setUseNamedPipePortDiscovery
public void setUseNamedPipePortDiscovery(boolean useNamedPipePortDiscovery)
-
addConfigurationItem
public void addConfigurationItem(String key, Object value)
Add a configuration setting for launching Runtime. value can be type of Integer, Long, Double, String or JSONObject- Parameters:
key- key value of the settingvalue- value of the setting
-
setLaunchRVMPath
public void setLaunchRVMPath(String path)
By default, Java adapter launches Runtime with OpenFin installer. If RVM path is set, installer is skipped and RVM is started instead.- Parameters:
path- path for RVM
-
getLaunchRVMPath
public String getLaunchRVMPath()
return value of launchRVMPath- Returns:
- path
-
getManifestLocation
public String getManifestLocation()
Get location of app manifest. If manifest is set, some fields, such as runtimeVersion, will be copied from the manifest- Returns:
- location of app manifest
-
getLocalManifestFileName
public String getLocalManifestFileName()
Get name of local manifest file name- Returns:
- file name
-
setLocalManifestFileName
public void setLocalManifestFileName(String localManifestFileName)
Set name of automatically generated local manifest file. Only name of the file, not path, should be specified. An extension of ".json" is appended.- Parameters:
localManifestFileName- file name
-
setManifestLocation
public void setManifestLocation(String manifestLocation)
Set location of app manifest- Parameters:
manifestLocation- location of app manifest
-
getMaxMessageSize
public int getMaxMessageSize()
Get max size of each message between Java adapter and Runtime- Returns:
- max size
-
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize)
Set max size of each message between Java adapter and Runtime- Parameters:
maxMessageSize- max size
-
getRuntimePort
public int getRuntimePort()
Get port number of Runtime websocket server- Returns:
- port number
-
setRuntimePort
public void setRuntimePort(int runtimePort)
Set port number of Runtime websocket server- Parameters:
runtimePort- port number
-
generateRuntimeConfig
public String generateRuntimeConfig()
Generates JSON string that can be passed as --config to RVM and Insaller- Returns:
- JSON string
-
-