Examples of InnerResponse


Examples of org.persvr.remote.InnerResponse

    public void setRequest(HttpServletRequest request) {
      this.request = request;
    }
    public int sendNotification(Notification notification, Client connection,boolean first) throws IOException {
      String pathInfo = notification.getPathInfo();
      InnerResponse innerResponse = new InnerResponse(prefix + pathInfo);
        ObservedCall call = notification.getCall();
        innerResponse.setHeader("Event", call.getMethod());
        IndividualRequest request = connection.getIndividualRequest(null, response);
        request.setRequestedPath(pathInfo, Identification.idForString(pathInfo));
        Object target = call.getContent();
        String output;
      if (target == Scriptable.NOT_FOUND || target == Undefined.instance){
        innerResponse.setStatus(204);
        output ="";
      }
      else
        output = request.serialize(target);
      innerResponse.setHeader("Last-Modified", "" + new Date()); // TODO: This should come from the transaction
      innerResponse.getOutputStream().print(output);
      String message = innerResponse.asString();
      response.getOutputStream().print(message);
      response.getOutputStream().flush();
      return message.length();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.