The
terminate
method performs cleanup duties related to the termination of the event mechanism for lookup service discovery, the event mechanism for service discovery, and the cache management duties of the
ServiceDiscoveryManager
.
For each instance of LookupCache
created and managed by the ServiceDiscoveryManager
, the terminate
method will do the following:
- Either remove all listener objects registered for receipt of
DiscoveryEvent
objects or, if the discovery manager employed by the ServiceDiscoveryManager
was created by the ServiceDiscoveryManager
itself, terminate all discovery processing being performed by that manager object on behalf of the entity.
- Cancel all event leases granted by each lookup service in the managed set of lookup services.
- Un-export all remote listener objects registered with each lookup service in the managed set.
- Terminate all threads involved in the process of retrieving and storing references to discovered services of interest.
Calling any method after the termination will result in an
IllegalStateException
.
@see net.jini.lookup.LookupCache
@see net.jini.discovery.DiscoveryEvent