This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have implemented a ConnectionFactory with a getData Method, which returns a new ConnectionObject. These ConnectionObject implements the unreferenced interface. In the main method of the ConnectionFactory i create a registry and bind the ConnectionFactory there. When the client exits abnormally the unreferenced method from the ConnectionObject is never called. Can you please help me to figure out why this not work.
Unreferenced.unreferenced() is called immediately when a client finishes with a remote object cleanly, but if a client exits abnormally (crashes) you will have to wait a certain amount of time, depending on these settings: java.rmi.dgc.leaseValue (default is 10 minutes) sun.rmi.dgc.checkInterval (default is 5 minutes) leaseValue is how long your client is granted a reference to the remote object on the server. checkInteval is how often the server checks for expired leases. Check it out here: http://java.sun.com/j2se/1.3/docs/guide/rmi/javarmiproperties.html and here: http://java.sun.com/j2se/1.3/docs/guide/rmi/sunrmiproperties.html
Are you sure that this is the problem? I thought I read somewhere recently that unreferenced is only called if there are no remote references to the object, and a registry binding counts as one reference.
Hi Alex Could you please elaborate on the ConnectionFactory which you have used in your application? Thanks Ravindra
SCEA, SCBCD, SCWCD, SCJD, SCJP
BJ Grau
Ranch Hand
Joined: Jul 10, 2001
Posts: 234
posted
0
Originally posted by Reid M. Pinchback: Are you sure that this is the problem? I thought I read somewhere recently that unreferenced is only called if there are no remote references to the object, and a registry binding counts as one reference.
You are right about the registry counting as a client, but in this case I'm assuming that only his ConnectionFactory is bound to the registry.
The default for Unreferenced is 15 minutes. And it is in reference to a Remote Object, and not an object in the Registry. The registry object will exist as long as the registry is running. Mark