Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Generated using TypeDoc
Interface for components that require explicit opening and closing.
For components that perform opening on demand consider using IClosable interface instead.
IOpenable
Opener
Example
class MyPersistence implements IOpenable { private _client: any; ... public isOpen(): boolean { return this._client != null; } public open(correlationId: string, callback: (err: any) => void): void { if (this.isOpen()) { callback(null); return; } ... } public close(correlationId: string, callback: (err: any) => void): void { if (this._client != null) { this._client.close(); this._client = null; } callback(null); } ... }