# Class: com.pnfsoftware.jeb.client.AbstractClientContext

Base context for official JEB clients. It is used by the RCP client context \(GUI\), the Controller \(floating\) context, as well as the headless runner. 

 On top of the abstract methods, which must be implemented, client code that override the following method must call the super\-class method:
 \- [#initialize(String[])](#initialize(String[]))
 \- [#start()](#start())
 \- [#stop()](#stop())

## Protected Constructor: AbstractClientContext


## Protected Field: args
Type: `java.lang.String[]`

## Protected Field: basicChecksPassed
Type: `boolean`

## Protected Field: coreOptions
Type: `com.pnfsoftware.jeb.core.CoreOptions`
Description: A reference to core options that will be used when the JEB core context is instantiated in [#start()](#start()). Clients which decide to provide non\-standard options should set this field **before** calling [#start()](#start()).

## Protected Field: inputpath
Type: `java.lang.String`

## Protected Field: scriptpath
Type: `java.lang.String`

## Protected Field: ugerrstr
Type: `java.lang.String`

## Static Field: CLIENT_RUNNING_FILENAME_PREFIX
Type: `java.lang.String`

Constant value: `.jebc_ts`

## Static Field: INSTALLER_LOCK_FILENAME
Type: `java.lang.String`

Constant value: `.jebi_lock`

## Static Field: defaultClientConfigPath
Type: `java.lang.String`

Constant value: `jeb-client.cfg`

## Static Field: defaultEnginesConfigPath
Type: `java.lang.String`

Constant value: `jeb-engines.cfg`

## Static Field: defaultPluginsFolderName
Type: `java.lang.String`

Constant value: `coreplugins`

## Static Field: defaultScriptsFolderName
Type: `java.lang.String`

Constant value: `scripts`

## Static Field: defaultTelemetryDatabasePath
Type: `java.lang.String`

Constant value: `jt.db`

## Protected Method: assignCommandlineArguments
- parameter: `argv`, type: `java.lang.String[]`

Description: Assigns [#args](#args) and [#inputpath](#inputpath). May overwrite [#configpath](#configpath) and [#engconfigpath](#engconfigpath). May assign [#scriptpath](#scriptpath).
parameter: argv: 

## Method: checkRunningInstaller
- return type: `boolean`


## Method: checkUpdate
- return type: `boolean`

Description: Not called locally: it is entirely up to the client to implement and decide who calls this method.

## Method: closeMainProject
- return type: `boolean`


## Method: closeOpenedProject
- return type: `boolean`


## Method: displayDemoInformation
- parameter: `demoInfo`, type: `java.lang.String`

Description: Called from [#start()](#start()).

## Method: displayEula
- parameter: `eula`, type: `java.lang.String`
- return type: `boolean`

Description: Called from [#start()](#start()).

## Protected Method: dumpProgramError
- parameter: `str`, type: `java.lang.String`
- return type: `boolean`


## Method: dumpUpdateToDisk
- parameter: `data`, type: `byte[]`
- parameter: `password`, type: `java.lang.String`


## Method: getArguments
- return type: `java.lang.String[]`


## Method: getConfiguration
- return type: `org.apache.commons.configuration2.Configuration`


## Method: getControllerInterface
- return type: `java.lang.String`


## Method: getControllerMessage
- return type: `java.lang.String`


## Method: getControllerPort
- return type: `int`


## Method: getControllerProtocol
- return type: `int`


## Method: getCoreContext
- return type: `com.pnfsoftware.jeb.core.ICoreContext`

Description: Get the JEB core instance. Should never be null unless an error happened in [#start()](#start()) or the context is one of a floating controller.
return: 

## Method: getEnginesContext
- return type: `com.pnfsoftware.jeb.core.IEnginesContext`

Description: Get the JEB engines instance. Should never be null unless an error happened in [#start()](#start()) or the context is one of a floating controller.

## Method: getInputpath
- return type: `java.lang.String`


## Method: getLastPublicAnnouncementId
- return type: `int`


## Method: getLatestAvailableUpdate
- return type: `com.pnfsoftware.jeb.core.Version`


## Method: getLogLevel
- return type: `int`


## Method: getMainProject
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Same as [#getOpenedProject()](#getOpenedProject()).

## Method: getMaxMemory
- return type: `long`


## Method: getNetworkUtility
- return type: `com.pnfsoftware.jeb.util.net.Net`


## Method: getOpenedProject
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Retrieve the current project, if any. Same as [#getMainProject()](#getMainProject()).
return: may be null

## Method: getPreferredLanguage
- return type: `java.lang.String`


## Method: getProcessId
- return type: `long`


## Method: getPropertyDefinitionManager
- return type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`


## Method: getPropertyManager
- return type: `com.pnfsoftware.jeb.core.properties.IPropertyManager`


## Method: getProxyString
- return type: `java.lang.String`


## Method: getScriptpath
- return type: `java.lang.String`


## Method: getScriptsDirectory
- return type: `java.lang.String`

Description: Retrieve the JEB scripts directory path.
return: never null, however, the path returned may not reference an existing directory

## Method: getScriptsDirfile
- return type: `java.io.File`

Description: Retrieve and if necessary create the JEB scripts directory.
return: the script directory

## Method: getTelemetry
- return type: `com.pnfsoftware.jeb.client.telemetry.ITelemetryDatabase`


## Method: getTransientStore
- return type: `java.util.Map<java.lang.Object,java.lang.Object>`


## Method: getUpdateChannel
- return type: `int`


## Method: getUsedMemory
- return type: `long`


## Method: getUuid
- return type: `long`


## Method: hasOpenedProject
- return type: `boolean`


## Method: initialize
- parameter: `argv`, type: `java.lang.String[]`


## Protected Method: initializeEngines

Description: Initialize the core context and an engines context.
throws: 

## Method: isDevelopmentMode
- return type: `boolean`


## Method: isHeadless
- return type: `boolean`


## Method: logMemoryUsage


## Method: notifyFloatingClient
- parameter: `notification`, type: `com.pnfsoftware.jeb.core.events.ControllerNotification`

Description: May be called from anywhere, any thread.

## Method: notifySupportExpired

Description: Called from [#start()](#start()).

## Method: onUpdatedSoftware
- parameter: `changelist`, type: `java.lang.String`
- parameter: `oldVersion`, type: `com.pnfsoftware.jeb.core.Version`

Description: Notify a concrete client that a new version of JEB is being run for the first time. 

 Called from [#start()](#start()).
parameter: changelist: an optional change log
parameter: oldVersion: the last version of JEB that was run \(note: the current version is always            available as a [static public field](AbstractContext#app_ver)\)

## Method: open
- parameter: `path`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.IUnit`


## Method: ping
- parameter: `downloadOrder`, type: `int`
- parameter: `clientChannel`, type: `int`
- parameter: `sbi`, type: `com.pnfsoftware.jeb.client.SoftwareBuildInfo`
- parameter: `progressCallback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- parameter: `verbose`, type: `boolean`
- return type: `int`

Description: Ping the JEB update server, and optionally download a JEB update on a compatible update channel.
parameter: downloadOrder: orders:            
            
- 0= no download \(pure ping\)
-             
- 1=soft download \(download only if not a major version bump; else a code 3 may            be returned if an update is available; the client must call this method once more            with downloadOrder=2 to download the files\)
-             
- 2= always download
-
parameter: clientChannel: current client channel, ie maximum allowed channel a build must confirm            to; see [Version](Version) for a list of available channels
parameter: sbi: optional information about the update
parameter: progressCallback: optional callback, used if the update package is to be downloaded
parameter: verbose: if true, messages are logged; if false, only important messages are logged
return: return values are:         
         
- \-2: error, corrupt update
-          
- \-1: error, unknown
-          
- 0: up to date
-          
- 1: update available, but caller does not want to download
-          
- 2: update available and downloaded
-          
- 2: update available, not downloaded, \(currently: the only reason is, it is a         major update, eg v3 to v4\) \- use downloadOrder=2 to force the download and         install
-

## Method: retrieveLatestPublicAnnouncement
- return type: `com.pnfsoftware.jeb.client.PublicAnnouncement`


## Method: retrieveLicenseKey
- parameter: `licdata`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Called from [#start()](#start()).

## Method: setControllerInterface
- parameter: `iface`, type: `java.lang.String`


## Method: setControllerPort
- parameter: `port`, type: `int`


## Method: setControllerProtocol
- parameter: `protocol`, type: `int`


## Method: setDevelopmentMode
- parameter: `enabled`, type: `boolean`


## Method: setLastPublicAnnouncementId
- parameter: `id`, type: `int`


## Method: setLatestAvailableUpdate
- parameter: `version`, type: `com.pnfsoftware.jeb.core.Version`


## Method: setLogLevel
- parameter: `level`, type: `int`


## Method: setPreferredLanguage
- parameter: `langcode`, type: `java.lang.String`


## Method: setProxyString
- parameter: `strProxyinfo`, type: `java.lang.String`


## Method: setScriptsDirectory
- parameter: `folder`, type: `java.lang.String`


## Method: setUpdateChannel
- parameter: `channel`, type: `int`


## Method: setupController
- return type: `boolean`

Description: Called from [#start()](#start()).

## Method: shouldCheckPublicAnnouncements
- return type: `boolean`


## Method: shouldCheckUpdates
- return type: `boolean`


## Method: start

Description: Install update, if any. Allow the display of client\-specific material such as: EULA, changelog, etc. If loating, initialize the floating client. Performs a license check for release builds. If not a controller, initialize a JEB [core](#corectx) and [engines](#engctx).
throws: 

## Method: stop


## Static Method: formatMemoryUsage
- return type: `java.lang.String`


## Static Method: formatProcessInfo
- parameter: `inclPid`, type: `boolean`
- parameter: `inclMeminfo`, type: `boolean`
- parameter: `inclTimes`, type: `boolean`
- parameter: `inclCmdline`, type: `boolean`
- return type: `java.lang.String`

Description: Format various process information bits. Each bit is formatted on a single line.
parameter: inclPid: 
parameter: inclMeminfo: 
parameter: inclTimes: 
parameter: inclCmdline: 
return: 

## Static Method: generateLicenseInformation
- return type: `java.lang.String`


