|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--mini.rmi.registry.ServletRegistry
Registry implemented as servlet. Passes RMI calls to remote objects.
Optional servlet parameters:
Note: If you need to subclass a different servlet, you can use the common wrapping trick:
public class MyServletRegistry extends SomeOtherServlet {
private ServletRegistry servletRegistry = new ServletRegistry();
public void init(ServletConfig config) throws ServletException {
servletRegistry.init(config);
// ...
}
protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
if (Naming.MINIRMI_CONTENT_TYPE.equals(req.getContentType())) {
servletRegistry.doPost(req, res);
return;
}
// ...
}
}
| Constructor Summary | |
ServletRegistry()
|
|
| Method Summary | |
void |
bind(java.lang.String name,
Remote object)
Binds specified name to object. |
protected void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Serves as registry entry point: handles lookups and RMI calls. |
static java.lang.String |
getClientHost()
Called by UnicastRemoteObject.getClientHost() method. |
void |
init(javax.servlet.ServletConfig config)
Initialization. |
protected java.lang.Object |
invokeMethod(Remote target,
java.lang.reflect.Method method,
java.lang.Object[] params)
Method that actually invokes each RMI method. |
java.lang.String[] |
list()
Returns array of names bound in registry. |
Remote |
lookup(java.lang.String name)
Returns object associated with specified name. |
void |
rebind(java.lang.String name,
Remote object)
Rebinds specified name to a new object. |
java.lang.Object |
replaceObject(java.lang.Object object,
java.lang.String clientJavaVersion)
Override if you need to replace objects sent in RMI response. |
void |
setLogging(boolean b)
Switches all logging on/off. |
void |
signObjID(ObjID oid)
Signs object's ObjID. |
void |
unbind(java.lang.String name)
Destroys the binding for specified name. |
boolean |
verifyObjID(ObjID oid)
Returns true if object's ObjID was not tampered. |
| Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doGet, 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 |
| Constructor Detail |
public ServletRegistry()
| Method Detail |
public void bind(java.lang.String name,
Remote object)
throws RemoteException,
AlreadyBoundException
bind in interface Registry
protected void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws javax.servlet.ServletException,
java.io.IOException
doPost in class javax.servlet.http.HttpServlet
public static java.lang.String getClientHost()
throws ServerNotActiveException
UnicastRemoteObject.getClientHost() method.ServerNotActiveException - if called from non-RMI thread
public void init(javax.servlet.ServletConfig config)
throws javax.servlet.ServletException
init in class javax.servlet.GenericServlet
protected java.lang.Object invokeMethod(Remote target,
java.lang.reflect.Method method,
java.lang.Object[] params)
throws java.lang.reflect.InvocationTargetException
target - object which method will be invokedmethod - method to be invokedparams - parameters passed to methodpublic java.lang.String[] list()
list in interface Registry
public Remote lookup(java.lang.String name)
throws RemoteException
lookup in interface Registry
public void rebind(java.lang.String name,
Remote object)
throws RemoteException
rebind in interface Registry
public java.lang.Object replaceObject(java.lang.Object object,
java.lang.String clientJavaVersion)
object - object that may be replacedclientJavaVersion - Java version detected on client -
(values: "1.1", "1.2", "1.3", "1.4" or null -
if client uses miniRMI older than 0.94)public void setLogging(boolean b)
public void signObjID(ObjID oid)
throws java.lang.Exception
java.lang.Exception - if error ocurrs during signingverifyObjID(ObjID)public void unbind(java.lang.String name)
unbind in interface Registry
public boolean verifyObjID(ObjID oid)
throws java.lang.Exception
java.lang.Exception - if error ocurrs during verifysignObjID(ObjID)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||