Interface IOpenable

All Superinterfaces:
IClosable

public interface IOpenable extends 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;
     }
   }

   ...
 }
 
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if the component is opened.
    void
    open(String correlationId)
    Opens the component.

    Methods inherited from interface org.pipservices3.commons.run.IClosable

    close
  • Method Details

    • isOpen

      boolean isOpen()
      Checks if the component is opened.
      Returns:
      true if the component has been opened and false otherwise.
    • open

      void open(String correlationId) throws ApplicationException
      Opens the component.
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      Throws:
      ApplicationException - when error or null no errors occured.