Package org.pipservices3.commons.run
Interface IOpenable
- All Superinterfaces:
IClosable
Interface for components that require explicit opening and closing.
For components that perform opening on demand consider using
IClosable
interface instead.
### Example ###
class MyPersistence implements IOpenable {
private Object _client;
...
public boolean isOpen() {
return this._client != null;
}
public void open(String correlationId) {
if (this.isOpen()) {
return;
}
...
}
public void close(String correlationId) {
if (this._client != null) {
this._client.close();
this._client = null;
}
}
...
}
-
Method Summary
-
Method Details
-
isOpen
boolean isOpen()Checks if the component is opened.- Returns:
- true if the component has been opened and false otherwise.
-
open
Opens the component.- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.- Throws:
ApplicationException
- when error or null no errors occured.
-