Thanks for your message, but I am afraid the problem is different. Let me explain it better with this code:
1) The monitor is exported to the RMI registry
2) Proxy is an object created at AnotherClass and when AnotherClass invokes wait() the proxy holds the lock.
3) Proxy is not exported to the RMI registry
4) When Monitor constructor is executed the output is:
PROXY 3 tdg.guarana.toolkit.port.communicator.adapter.jbi.responder.Proxy@8720392 <<<<<<<<<<<<<<<< The problem!
As you can see latter when update() is called the object seems to be another one. I am wondering this is due to the object proxy was copied to the RMI registry.
What's your opinion about it?
Regards,
Rafael.
This message was edited 1 time. Last update was at by Rafael Z. Frantz
Your code does not compile and i don't think you have given us the entire code. I don't see anyone calling the update() method.
Are these two classes executed in different JVMs?
These 3 classes are running in a JVM1 and the update() method is invoked by another object that runs in a JVM2. All them in both JVMs are exported to RMI registry, one registry in JVM1 and another at JVM2. The code is not complete since it is long and complex. I´ve tried to put something that focus on the problem.
In JVM1 then proxy calls wait() and own the lock, the problem is that at the time it is exported to the registry at JVM1 the stub at the registry that receives the notification from JVM2 that invokes update(). In this case, the update at the stub cannot call NotifyAll() since it does not own the lock. So no effect in the code...
Regards,
Rafael.
subject: JVM copies an object when it is exported to RMI registry?