use of org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse in project incubator-servicecomb-java-chassis by apache.
the class VertxRestDispatcher method onRequest.
private void onRequest(RoutingContext context) {
if (transport == null) {
transport = CseContext.getInstance().getTransportManager().findTransport(Const.RESTFUL);
}
HttpServletRequestEx requestEx = new VertxServerRequestToHttpServletRequest(context);
HttpServletResponseEx responseEx = new VertxServerResponseToHttpServletResponse(context.response());
RestProducerInvocation restProducerInvocation = new RestProducerInvocation();
context.put(RestConst.REST_PRODUCER_INVOCATION, restProducerInvocation);
restProducerInvocation.invoke(transport, requestEx, responseEx, httpServerFilters);
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse in project java-chassis by ServiceComb.
the class VertxRestDispatcher method onRequest.
protected void onRequest(RoutingContext context) {
if (transport == null) {
transport = SCBEngine.getInstance().getTransportManager().findTransport(Const.RESTFUL);
microserviceMeta = SCBEngine.getInstance().getProducerMicroserviceMeta();
}
HttpServletRequestEx requestEx = new VertxServerRequestToHttpServletRequest(context);
HttpServletResponseEx responseEx = new VertxServerResponseToHttpServletResponse(context.response());
if (SCBEngine.getInstance().isFilterChainEnabled()) {
InvocationCreator creator = new RestVertxProducerInvocationCreator(context, microserviceMeta, transport.getEndpoint(), requestEx, responseEx);
new RestProducerInvocationFlow(creator, requestEx, responseEx).run();
return;
}
VertxRestInvocation vertxRestInvocation = new VertxRestInvocation();
context.put(RestConst.REST_PRODUCER_INVOCATION, vertxRestInvocation);
vertxRestInvocation.invoke(transport, requestEx, responseEx, httpServerFilters);
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse in project java-chassis by ServiceComb.
the class DefaultEdgeDispatcher method requestByFilter.
protected void requestByFilter(RoutingContext context, String microserviceName, String versionRule, String path) {
HttpServletRequestEx requestEx = new VertxServerRequestToHttpServletRequest(context);
HttpServletResponseEx responseEx = new VertxServerResponseToHttpServletResponse(context.response());
InvocationCreator creator = new EdgeInvocationCreator(context, requestEx, responseEx, microserviceName, versionRule, path);
new RestProducerInvocationFlow(creator, requestEx, responseEx).run();
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse in project java-chassis by ServiceComb.
the class EdgeInvocation method init.
public void init(String microserviceName, RoutingContext context, String path, List<HttpServerFilter> httpServerFilters) {
this.microserviceName = microserviceName;
this.requestEx = new VertxServerRequestToHttpServletRequest(context, path);
this.responseEx = new VertxServerResponseToHttpServletResponse(context.response());
this.routingContext = context;
this.httpServerFilters = httpServerFilters;
requestEx.setAttribute(RestConst.REST_REQUEST, requestEx);
}
use of org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse in project incubator-servicecomb-java-chassis by apache.
the class EdgeInvocation method init.
public void init(String microserviceName, RoutingContext context, String path, List<HttpServerFilter> httpServerFilters) {
this.microserviceName = microserviceName;
this.requestEx = new VertxServerRequestToHttpServletRequest(context, path);
this.responseEx = new VertxServerResponseToHttpServletResponse(context.response());
this.httpServerFilters = httpServerFilters;
requestEx.setAttribute(RestConst.REST_REQUEST, requestEx);
}
Aggregations