Class StdCallbackContext


  • @ThreadSafe
    public class StdCallbackContext
    extends Object
    StdCallbackContext provide a mechanism that automatically provides the memoization for retention and callback of request, responses, stabilize handles during handler invocations. During replay callbacks, this automatically replays responses for different calls along the call graph ensuring that we only execute the portions of the call graph that needs execution and dedupe calls as needed. This is not a sophisticated class that does request inspection based call result, it is primarily a function result memoization that is ensured that it is invoked once. Attempts to call the function multiple times with different arguments will yield the same result for the same call graph key for request(String, Function) and response(String, BiFunction). For stabilize(String, CallChain.Callback), only when True is returned it is memoized.
    • Constructor Detail

      • StdCallbackContext

        public StdCallbackContext()
    • Method Detail

      • evictRequestRecord

        public <R> R evictRequestRecord​(String callGraph)
      • response

        public <ResponseT> ResponseT response​(String callGraph)
      • findFirstRequestByContains

        public <RequestT> RequestT findFirstRequestByContains​(String contains)
      • findAllRequestByContains

        public <RequestT> List<RequestT> findAllRequestByContains​(String contains)
      • findFirstResponseByContains

        public <ResponseT> ResponseT findFirstResponseByContains​(String contains)
      • findAllResponseByContains

        public <ResponseT> List<ResponseT> findAllResponseByContains​(String contains)
      • attempts

        public int attempts​(String callGraph)
      • attempts

        public void attempts​(String callGraph,
                             int attempts)