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 forrequest(String, Function)andresponse(String, BiFunction). Forstabilize(String, CallChain.Callback), only when True is returned it is memoized.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStdCallbackContext.Deserializerstatic classStdCallbackContext.Serializer
-
Constructor Summary
Constructors Constructor Description StdCallbackContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intattempts(String callGraph)voidattempts(String callGraph, int attempts)Map<String,Object>callGraphs()<R> RevictRequestRecord(String callGraph)<RequestT> List<RequestT>findAllRequestByContains(String contains)<ResponseT>
List<ResponseT>findAllResponseByContains(String contains)<RequestT> RequestTfindFirstRequestByContains(String contains)<ResponseT>
ResponseTfindFirstResponseByContains(String contains)<M,R>
Function<M,R>request(String callGraph, Function<M,R> func)<ResponseT>
ResponseTresponse(String callGraph)<R,C,RT>
BiFunction<R,C,RT>response(String callGraph, BiFunction<R,C,RT> func)
-
-
-
Method Detail
-
evictRequestRecord
public <R> R evictRequestRecord(String callGraph)
-
response
public <R,C,RT> BiFunction<R,C,RT> response(String callGraph, BiFunction<R,C,RT> func)
-
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)
-
-