Search in sources :

Example 6 with InvocationCreator

use of org.apache.servicecomb.core.invocation.InvocationCreator 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();
}
Also used : RestProducerInvocationFlow(org.apache.servicecomb.common.rest.RestProducerInvocationFlow) VertxServerResponseToHttpServletResponse(org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse) HttpServletResponseEx(org.apache.servicecomb.foundation.vertx.http.HttpServletResponseEx) InvocationCreator(org.apache.servicecomb.core.invocation.InvocationCreator) HttpServletRequestEx(org.apache.servicecomb.foundation.vertx.http.HttpServletRequestEx) VertxServerRequestToHttpServletRequest(org.apache.servicecomb.foundation.vertx.http.VertxServerRequestToHttpServletRequest)

Example 7 with InvocationCreator

use of org.apache.servicecomb.core.invocation.InvocationCreator in project java-chassis by ServiceComb.

the class HighwayServerConnection method onRequest.

protected void onRequest(long msgId, RequestHeader header, Buffer bodyBuffer) {
    if (SCBEngine.getInstance().isFilterChainEnabled()) {
        InvocationCreator creator = () -> createInvocation(msgId, header, bodyBuffer);
        new HighwayProducerInvocationFlow(creator, this, msgId).run();
        return;
    }
    HighwayServerInvoke invoke = new HighwayServerInvoke(endpoint);
    if (invoke.init(this, msgId, header, bodyBuffer)) {
        invoke.execute();
    }
}
Also used : InvocationCreator(org.apache.servicecomb.core.invocation.InvocationCreator)

Example 8 with InvocationCreator

use of org.apache.servicecomb.core.invocation.InvocationCreator in project incubator-servicecomb-java-chassis by apache.

the class HighwayServerConnection method onRequest.

protected void onRequest(long msgId, RequestHeader header, Buffer bodyBuffer) {
    if (SCBEngine.getInstance().isFilterChainEnabled()) {
        InvocationCreator creator = () -> createInvocation(msgId, header, bodyBuffer);
        new HighwayProducerInvocationFlow(creator, this, msgId).run();
        return;
    }
    HighwayServerInvoke invoke = new HighwayServerInvoke(endpoint);
    if (invoke.init(this, msgId, header, bodyBuffer)) {
        invoke.execute();
    }
}
Also used : InvocationCreator(org.apache.servicecomb.core.invocation.InvocationCreator)

Aggregations

InvocationCreator (org.apache.servicecomb.core.invocation.InvocationCreator)8 RestProducerInvocationFlow (org.apache.servicecomb.common.rest.RestProducerInvocationFlow)6 HttpServletRequestEx (org.apache.servicecomb.foundation.vertx.http.HttpServletRequestEx)6 HttpServletResponseEx (org.apache.servicecomb.foundation.vertx.http.HttpServletResponseEx)6 VertxServerRequestToHttpServletRequest (org.apache.servicecomb.foundation.vertx.http.VertxServerRequestToHttpServletRequest)4 VertxServerResponseToHttpServletResponse (org.apache.servicecomb.foundation.vertx.http.VertxServerResponseToHttpServletResponse)4 AsyncContext (javax.servlet.AsyncContext)2 RestVertxProducerInvocationCreator (org.apache.servicecomb.common.rest.RestVertxProducerInvocationCreator)2 VertxRestInvocation (org.apache.servicecomb.common.rest.VertxRestInvocation)2 StandardHttpServletRequestEx (org.apache.servicecomb.foundation.vertx.http.StandardHttpServletRequestEx)2 StandardHttpServletResponseEx (org.apache.servicecomb.foundation.vertx.http.StandardHttpServletResponseEx)2