Interface ExecutionContext

All Superinterfaces:
AutoCloseable, Closeable

@Beta public interface ExecutionContext extends Closeable
Represents the execution of a given operation. Must be closed at the end of the operation. Usual usage:
 
 try (ExecutionContext ctx = resourceGovernor.beginExecution(operation))
 {
      //some code
 }
 catch (ExecutionRejectedException e)
 {
     //no capacity
 }
 
 
PLEASE NOTE: This API is in the beta stage, it can be changed or even removed in a future release. Compatibility with other features is not guaranteed.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Mark the operation as done.
  • Method Details

    • close

      void close()
      Mark the operation as done. Must be invoked no matter if it failed or succeeded.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable