# Interface: com.pnfsoftware.jeb.client.api.IClientContext

This important interface represents a client context for scripting. Client contexts are provided  to JEB scripts at execution time.

## Abstract Method: closeMainProject
- return type: `boolean`

Description: Convenience method used to close the main project \(if any\), that is, the first project of the  first engines context managed by the JEB back\-end. If no project is opened, this method will  return false.
return: success indicator

## Abstract Method: getArguments
- return type: `java.lang.String[]`

Description: Get the input arguments provided to this client context. The returned array depends on how  the context was instantiated and called.
return: an array \(possibly empty\) or null if arguments are irrelevant in the current context

## Abstract Method: getBaseDirectory
- return type: `java.lang.String`

Description: Get the JEB base directory.
return: the base directory

## Abstract Method: getConfigDirectory
- return type: `java.lang.String`

Description: Get the directory containing JEB's configuration files \(jeb\-client.cfg, jeb\-engines.cfg\).
return: the configuration directory \(in most cases, it will be the same as          [#getProgramDirectory()](#getProgramDirectory())\)

## Abstract Method: getEnginesContext
- return type: `com.pnfsoftware.jeb.core.IEnginesContext`

Description: Get the primary JEB engines context.
return: the primary engines context, possibly null if none was initialized

## Abstract Method: getMainProject
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Convenience method used to retrieve the main project \(if any\), that is, the first project of  the first engines context managed by the JEB back\-end. If no project is opened, this method  will return null.
return: the main project or null

## Abstract Method: getMaxMemory
- return type: `long`

Description: Get the theoretical maximum amount of memory that JEB can allocate and use.
return: total theoretical memory that JEB could use, in bytes

## Abstract Method: getProcessId
- return type: `long`

Description: Retrieve the process id of the Java VM executing JEB.
return: JEB's PID

## Abstract Method: getProgramDirectory
- return type: `java.lang.String`

Description: Get the JEB program directory. Typically, this is the bin/ sub\-directory located within JEB  installation folder.
return: the program directory

## Abstract Method: getPropertyManager
- return type: `com.pnfsoftware.jeb.core.properties.IPropertyManager`

Description: Get the client property manager.
return: property manager

## Abstract Method: getSoftwareVersion
- return type: `com.pnfsoftware.jeb.core.Version`

Description: Get the JEB back\-end software version.
return: the software version

## Abstract Method: getStartupTimestamp
- return type: `int`

Description: Get the client start\-up timestamp.
return: Unix timestamp in seconds

## Abstract Method: getTransientStore
- return type: `java.util.Map<java.lang.Object,java.lang.Object>`

Description: Retrieve a reference to the transient store provided by this context. Clients may use this  map to store context\-level global objects. The store and its objects are not persisted with a  project JDB2 database.  

  Interface specifications for implementations:
  \- Null keys are forbidden, null values are allowed
  \- Insertion, retrieval and deletion are thread\-safe
  \- Iterating is not thread\-safe
  \- The insertion order is not guaranteed during iteration
return: a non\-null read\-write map

## Abstract Method: getUsedMemory
- return type: `long`

Description: Get the amount of memory currently used by JEB.
return: used memory in bytes

## Abstract Method: open
- parameter: `path`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.IUnit`
- throws: `java.io.IOException`

Description: Convenience method used to create a JEB project \(or retrieve the current project if one is  opened\), load a file artifact into the project, process it, and return the resulting  top\-level unit.  

  If the input file is a JDB2 saved project, that project is opened and returned. The method  will throw [IllegalStateException](java.lang.IllegalStateException) if a project is already opened.
parameter: path: input file to be analyzed, or an existing project saved as a JDB2 database             \(\*.jdb2\)
return: the top\-level unit yielded from the analysis of the provided artifact; if the input          path was a JDB2 project, the top\-level unit of the first project's artifact is          returned
throws: on IO error

