io.quarkus.resteasy.runtime.ContextUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-resteasy Show documentation
Show all versions of quarkus-resteasy Show documentation
REST endpoint framework implementing JAX-RS and more
package io.quarkus.resteasy.runtime;
import java.util.Map;
import org.jboss.resteasy.core.ResteasyContext;
import io.quarkus.vertx.http.runtime.QuarkusHttpHeaders;
import io.vertx.core.MultiMap;
import io.vertx.ext.web.RoutingContext;
public class ContextUtil {
/**
* Used to push context objects from virtual http plugins like AWS Lambda and Azure Functions.
* We keep this code here because it is used in multiple places.
*
* @param routingContext
*/
public static void pushContext(RoutingContext routingContext) {
MultiMap qheaders = routingContext.request().headers();
if (qheaders instanceof QuarkusHttpHeaders) {
for (Map.Entry, Object> entry : ((QuarkusHttpHeaders) qheaders).getContextObjects().entrySet()) {
ResteasyContext.pushContext((Class) entry.getKey(), entry.getValue());
}
}
}
}