public CompletionStage<Result> call(
      Request req) { // TODO: Make this method abstract after removing call(Context)
    return Context.safeCurrent()
        .map(
            threadLocalCtx -> {
              // A previous action did explicitly set a context onto the thread local (via
              // Http.Context.current.set(...))
              // Let's use that context so the user doesn't loose data he/she set onto that ctx
              // (args,...)
              Context newCtx = threadLocalCtx.withRequest(req.removeAttr(CTX_ARGS));
              Context.setCurrent(newCtx);
              return call(newCtx);
            })
        .orElseGet(
            () -> {
              // A previous action did not set a context explicitly, we simply create a new one to
              // pass on the request
              Context ctx = new Context(req.removeAttr(CTX_ARGS), contextComponents);
              ctx.args = req.attrs().getOptional(CTX_ARGS).orElse(new HashMap<>());
              return call(ctx);
            });
  }
public CompletionStage<Result> call(
      Request req) { 
    return Context.safeCurrent()
        .map(
            threadLocalCtx -> {
              
              
              
              
              Context newCtx = threadLocalCtx.withRequest(req.removeAttr(CTX_ARGS));
              Context.setCurrent(newCtx);
              return call(newCtx);
            })
        .orElseGet(
            () -> {
              
              
              Context ctx = new Context(req.removeAttr(CTX_ARGS), contextComponents);
              ctx.args = req.attrs().getOptional(CTX_ARGS).orElse(new HashMap<>());
              return call(ctx);
            });
  }
public CompletionStage < Result > call ( Request req ) { // TODO: Make this method abstract after removing call(Context) return Context . safeCurrent ( ) . map ( threadLocalCtx -> { // A previous action did explicitly set a context onto the thread local (via // Http.Context.current.set(...)) // Let's use that context so the user doesn't loose data he/she set onto that ctx // (args,...) Context newCtx = threadLocalCtx . withRequest ( req . removeAttr ( CTX_ARGS ) ) ; Context . setCurrent ( newCtx ) ; return call ( newCtx ) ; } ) . orElseGet ( ( ) -> { // A previous action did not set a context explicitly, we simply create a new one to // pass on the request Context ctx = new Context ( req . removeAttr ( CTX_ARGS ) , contextComponents ) ; ctx . args = req . attrs ( ) . getOptional ( CTX_ARGS ) . orElse ( new HashMap <> ( ) ) ; return call ( ctx ) ; } ) ; }
Executes this action with the given HTTP request and returns the result.

@param req the http request with which to execute this action
@return a promise to the action's result
Executes this action with the given HTTP request and returns the result .