netbula.ORPC

Class RpcSvcServlet


public abstract class RpcSvcServlet
extends HttpServlet

An abstract class which serves as the base to create an in-process RPC servlet. To implement a RPC servlet, override the initSvc() function, which returns a Svc derived object for yout RPC service.

Constructor Summary

RpcSvcServlet()

Method Summary

void
doGet(HttpServletRequest req, HttpServletResponse resp)
void
doPost(HttpServletRequest req, HttpServletResponse resp)
String
getServletInfo()
abstract Svc
initSvc()
Override this function to implement an RPC servlet.
String
translateServerName(String specified_host)
Give the Servlet a chance to translate the RPC server host name.
boolean
validate(HttpServletRequest req, String host, int prog, int ver)
Validate the RPC request, return true if OK.

Constructor Details

RpcSvcServlet

public RpcSvcServlet()

Method Details

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse resp)
            throws ServletException,
                   IOException

doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse resp)
            throws ServletException,
                   IOException

getServletInfo

public String getServletInfo()

initSvc

public abstract Svc initSvc()
Override this function to implement an RPC servlet. Use the Msg RPC as an example, this function is simply public Svc initSvc() { return new MsgSvc();}

translateServerName

public String translateServerName(String specified_host)
Give the Servlet a chance to translate the RPC server host name. Override this function to do your hostname translation. Default simply returns the hostname specified in the ClientHTTP.setServer() function sent from client.

validate

public boolean validate(HttpServletRequest req,
                        String host,
                        int prog,
                        int ver)
Validate the RPC request, return true if OK.