Interface ExecutionContext

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    @Beta
    public interface ExecutionContext
    extends java.io.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 Detail

      • close

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