Class StdCallbackContext

java.lang.Object
software.amazon.cloudformation.proxy.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 Details

    • StdCallbackContext

      public StdCallbackContext()
  • Method Details

    • request

      public <M, R> Function<M,R> request(String callGraph, Function<M,R> func)
    • evictRequestRecord

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

      public <R, C, RT> BiFunction<R,C,RT> response(String callGraph, BiFunction<R,C,RT> func)
    • callGraphs

      public Map<String,Object> callGraphs()
    • 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)