In the RMI CallBack Mechanism the reference of the client is sent to the server along with the request. Firstly is there any way to store the reference of the client in the database which can be retrived later to send the response to that specific client. Secondly, how can the server restrict the request coming from a specific client, i.e how to get the ip address of the client from the reference?

Edward Harned

java.rmi.server.RemoteObject implements Serializable so you can serialize the reference and save it to a byte array or use toString(), etc. We took the below quote rrom the RMI-IIOP Programmer's Guide:

"If you are not using the RMI registry for naming services, you have some other way of bootstrapping your initial remote object reference. For example, your server code may be using Java serialization to write an RMI object reference to an ObjectOutputStream and passing this to your client code for deserializing into an RMI stub."

One way is to have each client pass an identifier. This way if ip addresses change you would not have to change you Server side.

The following is NOT recommended:

You can use toString(), as above, and look at the characters. The ip address is in there, TODAY.  However, this does not mean that the ip address will be in there tomorrow. It also does not mean the ip address is in there for every platform in every way.