Package net.jini.discovery
Interface DiscoveryManagement
- All Known Implementing Classes:
LookupDiscovery,LookupDiscoveryManager,LookupLocatorDiscovery,SharedDiscoveryManagement.SharedDiscoveryManager
public interface DiscoveryManagement
This interface defines methods related to the discovery event mechanism and discovery process
termination. Through this interface an entity can register or un-register for discovery events,
discard a lookup service, or terminate the discovery process.
- Author:
- Sun Microsystems, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddDiscoveryListener(DiscoveryListener listener) Adds an instance ofDiscoveryListenerto the set of objects listening for discovery events.voiddiscard(ServiceRegistrar proxy) Removes an instance ofServiceRegistrarfrom the managed set of lookup services, making the corresponding lookup service eligible for re-discovery.Returns an array of instances ofServiceRegistrar, each corresponding to a proxy to one of the currently discovered lookup services.voidremoveDiscoveryListener(DiscoveryListener listener) Removes a listener from the set of objects listening for discovery events.voidEnds all discovery processing being performed by the current implementation of this interface.
-
Method Details
-
addDiscoveryListener
Adds an instance ofDiscoveryListenerto the set of objects listening for discovery events. Once the listener is registered, it will be notified of all lookup services discovered to date, and will then be notified as new lookup services are discovered or existing lookup services are discarded.If
nullis input to this method, aNullPointerExceptionis thrown. If the listener input to this method duplicates (using theequalsmethod) another element in the current set of listeners, no action is taken.- Parameters:
listener- an instance ofDiscoveryListenercorresponding to the listener to add to the set of listeners.- Throws:
NullPointerException- ifnullis input to thelistenerparameter- See Also:
-
removeDiscoveryListener
Removes a listener from the set of objects listening for discovery events. If the listener object input to this method does not exist in the set of listeners, then this method will take no action.- Parameters:
listener- an instance ofDiscoveryListenercorresponding to the listener to remove from the set of listeners.- See Also:
-
getRegistrars
ServiceRegistrar[] getRegistrars()Returns an array of instances ofServiceRegistrar, each corresponding to a proxy to one of the currently discovered lookup services. For each invocation of this method, a new array is returned.- Returns:
- array of instances of
ServiceRegistrar, each corresponding to a proxy to one of the currently discovered lookup services - See Also:
-
discard
Removes an instance ofServiceRegistrarfrom the managed set of lookup services, making the corresponding lookup service eligible for re-discovery. This method takes no action if the parameter input to this method isnull, or if it does not match (usingequals) any of the elements in the managed set.- Parameters:
proxy- the instance ofServiceRegistrarto remove from the managed set of lookup services- See Also:
-
terminate
void terminate()Ends all discovery processing being performed by the current implementation of this interface. After this method is invoked, no new lookup services will be discovered, and the effect of any new operations performed on the current implementation object are undefined. Any additional termination semantics must be defined by the implementation class itself.
-