Class OperationContext

Object
OperationContext

public final class OperationContext extends Object
Context objects for general operations that allow for logging and recording execution time.
Author:
Owen Feehan
  • Constructor Details

    • OperationContext

      public OperationContext(Logger logger)
      Creates with a Logger ignoring execution-times.
      Parameters:
      logger - the logger.
    • OperationContext

      public OperationContext(ExecutionTimeRecorder executionTimeRecorder, Logger logger)
      Creates a new OperationContext instance.
      Parameters:
      executionTimeRecorder - Allows for the execution time of certain operations to be recorded.
      logger - Where to write informative messages to, and and any non-fatal errors (fatal errors are throw as exceptions).
  • Method Details

    • getExecutionTimeRecorder

      public ExecutionTimeRecorder getExecutionTimeRecorder()
      Allows for the execution time of certain operations to be recorded.
    • getLogger

      public Logger getLogger()
      Where to write informative messages to, and and any non-fatal errors (fatal errors are throw as exceptions).
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object