You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Aditya Dalmia <da...@gmail.com> on 2011/06/09 03:24:46 UTC

Usage of Thrift TServlet for Session operations

Apologies in advance if this is a stupid question.
I was going through the api for thrift TServlet and TProcessor and found
that I could not imagine a way to do user specific processing inside the
Service.Iface implementation.

Maybe code snippet would make things clearer
public MyServiceServlet extends TServlet {
  public MyServiceServlet() {
    super(new MyService.Processor(new MyServiceHandler()),
          new TJSONProtocol.Factory());
  }

  private static class MyServiceHandler implements MyService.Iface {
    public boolean getUserSpecificTruth() {
      // Get information for the user HttpServletRequest.getUserPrincipal()
      // who initiated this request
    }
  }
}


Thanks in advance
Aditya Dalmia