Asylo
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
com.asylo.client.EnclaveManager Class Reference

A manager class responsible for creating and managing enclave instances. More...

Inheritance diagram for com.asylo.client.EnclaveManager:
Inheritance graph
[legend]
Collaboration diagram for com.asylo.client.EnclaveManager:
Collaboration graph
[legend]

Public Member Functions

void close ()
 
void loadEnclave (EnclaveLoadConfig config)
 Loads a new enclave utilizing the passed enclave loader configuration settings. More...
 
EnclaveClient getEnclaveClient (String enclaveName)
 Returns the EnclaveClient which is loaded previously by calling loadEnclave(EnclaveLoadConfig). More...
 
void destroyEnclaveClient (EnclaveClient enclaveClient, EnclaveFinal enclaveFinal)
 Destroys an enclave client. More...
 
- Public Member Functions inherited from com.asylo.client.AutoCloseablePointer
void close ()
 This function hands over control to the child class by calling closeNative(long) for cleaning up the native resources and memory. More...
 

Static Public Member Functions

static EnclaveManager getInstance ()
 Returns the EnclaveManager singleton object. More...
 

Protected Member Functions

void closeNative (long pointer)
 
- Protected Member Functions inherited from com.asylo.client.AutoCloseablePointer
 AutoCloseablePointer (final long pointer)
 
final long getPointer ()
 
abstract void closeNative (final long pointer)
 Child classes should free up native resources and memory when this function is invoked. More...
 

Detailed Description

A manager class responsible for creating and managing enclave instances.

EnclaveManager is a singleton class that tracks the status of enclaves within a process. Users can access singleton instance by calling the static getInstance() method.

Member Function Documentation

◆ close()

void com.asylo.client.EnclaveManager.close ( )
inline

◆ closeNative()

void com.asylo.client.EnclaveManager.closeNative ( long  pointer)
inlineprotected

◆ destroyEnclaveClient()

void com.asylo.client.EnclaveManager.destroyEnclaveClient ( EnclaveClient  enclaveClient,
EnclaveFinal  enclaveFinal 
)
inline

Destroys an enclave client.

It first passes the EnclaveFinal to enclave's EnterAndExecute method and then it frees up the native memory of the client. It should not be called more than once for a client.

Parameters
enclaveClientClient which needs to be destroyed.
enclaveFinalFinal input to the client.
Exceptions
EnclaveExceptionif there is any problem in destruction of the enclave.
IllegalStateExceptionif enclaveClient is already destroyed.

◆ getEnclaveClient()

EnclaveClient com.asylo.client.EnclaveManager.getEnclaveClient ( String  enclaveName)
inline

Returns the EnclaveClient which is loaded previously by calling loadEnclave(EnclaveLoadConfig).

Parameters
enclaveNameName of the enclave registered with the enclave manager.
Returns
EnclaveClient loaded before.
Exceptions
EnclaveExceptionif it cannot return the client.

◆ getInstance()

static EnclaveManager com.asylo.client.EnclaveManager.getInstance ( )
inlinestatic

Returns the EnclaveManager singleton object.

Returns
EnclaveManager singleton object.
Exceptions
EnclaveExceptionif EnclaveManager cannot be created.

◆ loadEnclave()

void com.asylo.client.EnclaveManager.loadEnclave ( EnclaveLoadConfig  config)
inline

Loads a new enclave utilizing the passed enclave loader configuration settings.

The loaded enclave is bound to the value of the field name in EnclaveLoadConfig. It is an error to specify a name which is already bound to an enclave.

Parameters
configLoading configuration of the enclave.
Exceptions
EnclaveExceptionif manager is not able to load enclave properly.

The documentation for this class was generated from the following file: