Class Closer

java.lang.Object
org.pipservices3.commons.run.Closer

public class Closer extends Object
Helper class that closes previously opened components.
See Also:
  • Constructor Details

    • Closer

      public Closer()
  • Method Details

    • closeOne

      public static void closeOne(String correlationId, Object component) throws ApplicationException
      Closes specific component.

      To be closed components must implement ICloseable interface. If they don't the call to this method has no effect.

      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      component - the component that is to be closed.
      Throws:
      ApplicationException - when error or null no errors occured.
      See Also:
    • close

      public static void close(String correlationId, Iterable<Object> components) throws ApplicationException
      Closes multiple components.

      To be closed components must implement ICloseable interface. If they don't the call to this method has no effect.

      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      components - the list of components that are to be closed.
      Throws:
      ApplicationException - when error or null no errors occured.
      See Also: