Example usage for org.springframework.web.reactive.function.server ServerRequest attributes

List of usage examples for org.springframework.web.reactive.function.server ServerRequest attributes

Introduction

In this page you can find the example usage for org.springframework.web.reactive.function.server ServerRequest attributes.

Prototype

Map<String, Object> attributes();

Source Link

Document

Get a mutable map of request attributes.

Usage

From source file:org.springframework.cloud.function.web.function.FunctionEndpointInitializer.java

@SuppressWarnings("unchecked")
private Function<Flux<?>, Flux<?>> extract(ServerRequest request) {
    Function<Flux<?>, Flux<?>> function;
    if (handler != null) {
        logger.info("Configured function: " + handler);
        Set<String> names = this.functionCatalog.getNames(Function.class);
        Assert.isTrue(names.contains(handler), "Cannot locate function: " + handler);
        function = this.functionCatalog.lookup(Function.class, handler);
    } else {//from ww  w.  j a v  a2 s  .c o m
        function = (Function<Flux<?>, Flux<?>>) FunctionWebUtils.findFunction(request.method(), functionCatalog,
                request.attributes(), request.path());
    }
    return function;
}