Package com.google.greaze.definition.webservice

Examples of com.google.greaze.definition.webservice.ResponseSpec


  }

  public void service(HttpServletRequest req, HttpServletResponse res) {
    WebServiceCallSpec spec = injector.getInstance(WebServiceCallSpec.class);
    RequestSpec requestSpec = spec.getRequestSpec();
    ResponseSpec responseSpec = spec.getResponseSpec();
    GsonBuilder gsonBuilder = injector.getInstance(GsonBuilder.class);
    RequestReceiver requestReceiver = new RequestReceiver(gsonBuilder, requestSpec);
    WebServiceRequest webServiceRequest = requestReceiver.receive(req);

    Gson gson = injector.getInstance(GsonBuilder.class)
        .registerTypeAdapterFactory(new ResponseBodyGsonTypeAdapterFactory(responseSpec.getBodySpec()))
        .create();
    ResponseSender responseSender = new ResponseSender(gson);
    WebServiceResponse response = buildResponse(responseSpec, webServiceRequest);
    responseSender.send(res, response);
  }
View Full Code Here

TOP

Related Classes of com.google.greaze.definition.webservice.ResponseSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.