|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.werxltd.jsonrpc.RPC
public class RPC
This class creates a servlet which implements the JSON-RPC specification.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
LOG
|
| Constructor Summary | |
|---|---|
RPC()
|
|
| Method Summary | |
|---|---|
void |
addMessageListener(JSONRPCEventListener l)
Adds a class that implements the JSONRPCEventListener interface to the internal list of listeners |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Called by servlet container when a request is made. |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Forwards request to doGet method for consistency |
void |
init(javax.servlet.ServletConfig config)
This method reads the servlet configuration for a list of classes it should scan for acceptable Method objects that can be called remotely. |
org.json.JSONObject |
listrpcmethods()
Method lists available RPC methods loaded from configured classes. |
void |
removeMessageListener(JSONRPCEventListener l)
Removes a class that implements the JSONRPCEventListener interface from the internal list of listeners |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Logger LOG
| Constructor Detail |
|---|
public RPC()
| Method Detail |
|---|
public final void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
Modifier
marking them as abstract or interface methods. Static methods are fine.
Valid methods are gathered into a HashMap and instances of
non-static classes are created and reused for subsequent RPC calls.
Class is marked as final to prevent overriding and possible interference upstream.
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletconfig - ServletConfig passed from container upon initialization
javax.servlet.ServletExceptionpublic void addMessageListener(JSONRPCEventListener l)
l - public void removeMessageListener(JSONRPCEventListener l)
l -
public org.json.JSONObject listrpcmethods()
throws org.json.JSONException
org.json.JSONException
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException
doPost in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptiondoGet
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||