# Interface: com.pnfsoftware.jeb.core.IEnginesContext

A context for JEB engines. Engines produce events and relay events from other components under their supervision. The primary task of JEB engines is to manage projects. All engines contexts are managed by the single instance [core](ICoreContext) context. In practice, one single engines context will exist per JEB instance. The engines context provides access to:
 \- JEB projects
 \- top\-level engines plugins, including parsers
 \- other top\-level managers, such as the type library manager or the code signature manager

## Method: clearUnloadedProject

Description: Clear all unloaded projects from the project list. 

 Note: The project list allows for rapid reloading of previously loaded projects.

## Method: close

Description: Close the context. All projects will be unloaded; changes will not be persisted.

## Method: createProject
- parameter: `projectName`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Create a new project.
parameter: projectName: the project name
return: a project object
throws: on IO error

## Method: getCodelessSignatureManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.sig.codeless.CodelessSignatureManager`

Description: Retrieve the codeless signature manager managed by this context.
return: codeless\-signature manager

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

Description: Retrieve the JEB Core that instantiated this context.
return: owning core context

## Method: getDataProvider
- return type: `com.pnfsoftware.jeb.core.dao.IDataProvider`

Description: Get a reference to the DAO.
return: the data provider

## Method: getDebuggerUnitIdentifiers
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.debug.IDebuggerUnitIdentifier>`

Description: Retrieve the list of identifiers specifically for debugger units.
return: a list of debugger identifiers

## Method: getEnginesPlugins
- return type: `java.util.List<com.pnfsoftware.jeb.core.IEnginesPlugin>`

Description: Retrieve a list of engines plugins \(internal modules, third party plugins\).
return: the list of plugins, never null

## Method: getExecutorService
- return type: `java.util.concurrent.ExecutorService`

Description: Get the executor service used by this context. Clients may use it to schedule third\-party tasks.
return: the executor service

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

Description: Retrieve the main project, that is, the first project. This method throws if there is no project opened in this engines context.
return: the main project, never null
throws: if there is no main project

## Method: getNativeDecompilerPlugins
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.INativeDecompilerPlugin<?>>`

Description: Retrieve the list of decompiler plugins.
return: native decompiler plugins

## Method: getNativeDisassemblerPlugins
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.code.asm.INativeDisassemblerPlugin<?>>`

Description: Retrieve the list of disassembler plugins.
return: native disassembler plugins

## Method: getNativeSignatureDBManager
- return type: `com.pnfsoftware.jeb.core.units.code.asm.sig.NativeSignatureDBManager`

Description: Retrieve the native signature DB manager managed by this context.
return: native\-signature database manager

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

Description: Retrieve a network utility object used by this engines context. The network object is configured to use the proxy specified by the owner Core context's properties.
return: network helper

## Method: getPluginManager
- return type: `com.pnfsoftware.jeb.core.IPluginManager`

Description: Get the plugin manager. This method will return null if this context does not offer a plugin manager. 

 Note: JEB demo builds do not support plugins.
return: plugin manager, or null if unavailable

## Method: getProject
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Get a project by key.
parameter: key: mandatory project key
return: the project or null

## Method: getProject
- parameter: `index`, type: `int`
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Get a project by index.
parameter: index: 0\-based index
return: the project or null

## Method: getProjectFile
- parameter: `key`, type: `java.lang.String`
- return type: `java.io.File`

Description: Retrieve the file backing a loaded or unloaded project. The file may not exist or the project may not be backed by a filesystem file, in which case this method will return null.
parameter: key: project key
return: the file or null
throws: on I/O exception

## Method: getProjects
- return type: `java.util.List<com.pnfsoftware.jeb.core.IRuntimeProject>`

Description: Retrieve a copy of the list of projects currently loaded within this context.
return: the list of projects managed by this context

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

Description: Get the property manager for this engines context.
return: the property manager

## Method: getTypeLibraryService
- return type: `com.pnfsoftware.jeb.core.units.code.asm.type.TypeLibraryService`

Description: Retrieve the type library service managed by this context.
return: type\-library service

## Method: getUnitIdentifier
- parameter: `type`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.units.IUnitIdentifier`

Description: Retrieve an identifier by [type](WellKnownUnitTypes).
parameter: type: identifier type \(recall that decompilers are prefixed with            [WellKnownUnitTypes#pfxTypeDecompiler](WellKnownUnitTypes#pfxTypeDecompiler) and debuggers with            [WellKnownUnitTypes#pfxTypeDebugger](WellKnownUnitTypes#pfxTypeDebugger)\)
return: an identifier or null if there is none

## Method: getUnitIdentifiers
- return type: `java.util.List<com.pnfsoftware.jeb.core.units.IUnitIdentifier>`

Description: Retrieve the list of all identifiers that projects managed by this context may have access to.
return: a list of unit identifiers \(aka, parsers\)

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

Description: Determine whether some projects are loaded within this engines context.
return: true if at least one project is loaded

## Method: isIdentifierEnabled
- parameter: `identifier`, type: `com.pnfsoftware.jeb.core.units.IUnitIdentifier`
- return type: `boolean`

Description: Determine if an identifier is enabled.
parameter: identifier: the identifier
return: true if enabled, false otherwise

## Method: loadProject
- parameter: `key`, type: `java.lang.String`
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Load an existing project or create a new project.
parameter: key: an existing or new project key \(the final project key may be different\); may be a            path to a JDB2 file
return: a project reference
throws: on IO error
throws: on serialization error

## Method: loadProject
- parameter: `key`, type: `java.lang.String`
- parameter: `projectMustExist`, type: `boolean`
- parameter: `callback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `com.pnfsoftware.jeb.core.IRuntimeProject`

Description: Load an existing project or create a new project.
parameter: key: an existing or new project key \(the final project key may be different\); may be a            path to a JDB2 file
parameter: projectMustExist: if true, the project must exist \(that is, the key must reference an            existing JDB2 database, else the method will raise\)
parameter: callback: an optional callback object fed that will be continuously fed with            information regarding the loading status
return: a project reference
throws: on IO error
throws: on serialization error

## Method: saveProject
- parameter: `key`, type: `java.lang.String`
- return type: `boolean`

Description: Save the state of a project \(including artifacts and all units\) to the project database. If the project DB is backed up by a filesystem, the project will be persisted to a JDB2 file.
parameter: key: the project key
return: success indicator
throws: on IO error
throws: on deserialization error

## Method: saveProject
- parameter: `projectKey`, type: `java.lang.String`
- parameter: `persistenceKey`, type: `java.lang.String`
- parameter: `optionalParameters`, type: `java.util.Map<java.lang.String,java.lang.Object>`
- parameter: `callback`, type: `com.pnfsoftware.jeb.util.base.IProgressCallback`
- return type: `boolean`

Description: Save the state of a project \(including artifacts and all units\) to the project database. If the project DB is backed up by a filesystem, the project will be persisted to a JDB2 file.
parameter: projectKey: the project key
parameter: persistenceKey: optional persistence key; set it to override the current key and            persist to a different location
parameter: optionalParameters: opaque dictionary of optional parameters \(reserved for internal            use\)
parameter: callback: an optional callback object that will be continuously fed with information            regarding the saving status
return: success indicator
throws: on IO error
throws: on deserialization error

## Method: setIdentifierEnabled
- parameter: `identifier`, type: `com.pnfsoftware.jeb.core.units.IUnitIdentifier`
- parameter: `enabled`, type: `boolean`
- return type: `boolean`

Description: Enable or disable an identifier.
parameter: identifier: the identifier
parameter: enabled: true to enable the identifier, false otherwise; in the latter case,            [canIdentify\(...\)](IUnitIdentifier#canIdentify(com.pnfsoftware.jeb.core.input.IInput, IUnitCreator)) will never get called
return: success indicator

## Method: unitProperty
- parameter: `unitType`, type: `java.lang.String`
- parameter: `propertyName`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Convenience method to generate unit properties. Refer to [UnitUtil](UnitUtil) for additional methods.
parameter: unitType: unit type
parameter: propertyName: property name
return: the fully\-qualified property name, to be used to query the Engines property manager         or a Project property manager

## Method: unloadProject
- parameter: `key`, type: `java.lang.String`
- return type: `boolean`

Description: Unload a project.
parameter: key: the project key
return: success indicator

## Method: unloadProject
- parameter: `key`, type: `java.lang.String`
- parameter: `clear`, type: `boolean`
- return type: `boolean`

Description: Unload a project and optionally clear its entry from the project list.
parameter: key: the project key
parameter: clear: if true, the project entry will be removed from the project list
return: success indicator

## Method: unloadProjects

Description: Unload all projects.

## Method: unloadProjects
- parameter: `clear`, type: `boolean`

Description: Unload all projects and optionally clear entries from the project list.
parameter: clear: if true, project entries will be removed from the project list

