public class RMIHandlerServlet extends MMBaseServlet
doPost HttpServlet method. The
doPost method of this class interprets a servlet
request's query string as a command of the form
"RMICommandHandler. Once the
doPost method has parsed the requested command, it
calls the execute method on one of several command handlers in the
commands array.
The command that actually proxies remote calls is the
ServletForwardCommand. When the execute method is
invoked on the ServletForwardCommand, the command will open a
connection on a local port specified by its param
parameter and will proceed to write the body of the relevant post
request into this connection. It is assumed that an RMI server
(e.g. SampleRMIServer) is listening on the local port, "param."
The "forward" command will then read the RMI server's response and
send this information back to the RMI client as the body of the
response to the HTTP post method.
Because the ServletHandler uses a local socket to proxy remote
calls, the servlet has the ability to forward remote calls to local
RMI objects that reside in the ServletVM or outside of it.
Servlet documentation may be found at the following location:
http://jserv.javasoft.com/products/java-server/documentation/
webserver1.0.2/apidoc/Package-javax.servlet.http.html| Modifier and Type | Class and Description |
|---|---|
protected static class |
RMIHandlerServlet.ServletClientException
ServletClientException is thrown when an error is detected
in a client's request.
|
protected static class |
RMIHandlerServlet.ServletServerException
ServletServerException is thrown when an error occurs here on the server.
|
mmbase, retryAfter| Constructor and Description |
|---|
RMIHandlerServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Provide more intelligible errors for methods that are likely to
be called.
|
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
void |
forward(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param)
Execute the forward command.
|
void |
getHostname(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param) |
String |
getServletInfo()
Returns information about this servlet.
|
void |
hostname(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param) |
void |
init(javax.servlet.ServletConfig config) |
void |
ping(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param) |
associateMapping, checkInited, decRefCount, destroy, getAssociations, getBasePath, getMMBase, getRequestURL, getServletByAssociation, getServletByMapping, getServletMappings, getServletMappingsByAssociation, incRefCount, init, service, setInitException, setMMBasedoDelete, doHead, doOptions, doTrace, getLastModified, servicepublic void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
doGet in class MMBaseServletreq - http Servlet request, contains incoming command and
argumentsres - http Servlet responsejavax.servlet.ServletException - and IOException when invoking
methods of req or res.IOExceptionpublic void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
IOException
doPut in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionpublic String getServletInfo()
MMBaseServletgetServletInfo in interface javax.servlet.ServletgetServletInfo in class MMBaseServletpublic void forward(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param)
throws RMIHandlerServlet.ServletClientException,
RMIHandlerServlet.ServletServerException,
IOException
req - The servlet request.res - The servlet response.param - Port to which data will be sent.RMIHandlerServlet.ServletClientExceptionRMIHandlerServlet.ServletServerExceptionIOExceptionpublic void getHostname(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param)
throws IOException
IOExceptionpublic void ping(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param)
public void hostname(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
String param)
throws IOException
IOExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}