Re: Recommendations for working with LookupCache
Mark Brouwer <[email protected]>
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
Patrick Wright wrote: > reused. In a simple test setup I created to understand the behavior, > the lookup cache retained the reference both to service-instance-1 > (I-1) and service-instance-2 (I-2) even if the discard(service) method > was called on the cache. This is problematic, since without any > additional checks it is possible that either I-1 or I-2 would then be > returned from the lookup factory, even if I-1 was no longer available > (referred to a non-existing service instance). Are you really sure that when you called discard on the LookupCache for I-1 that I-1 was still returned by the LookupCache. This should not be possible, the service is eligible for rediscovery but in the situation you explained this could only happen if you registered I-1 with the Lookup Service with a very long lease expiration (> 10 min). I can only think of the service you passed in is not the one you obtained from the lookup cache, based on equals. -- Mark -------------------------------------------------------------------------- Getting Started: http://www.jini.org/wiki/Category:Getting_Started Community Web Site: http://jini.org jini-users Archive: http://archives.java.sun.com/archives/jini-users.html Unsubscribing: email "signoff JINI-USERS" to [email protected]