![]() |
LookupDiscovery
|
|---|
|
How to find the lookup services by group name.
|
Each instance of this class initiates a search for nearby
lookup services. The search continues as long as it is
active (until the terminate() method is sent to it).
As qualifying lookup services are encountered,
the LookupDiscovery object calls the The lookup services are members of groups. When instantiating the LookupDiscovery object, you must specify the groups you want and only those lookup services are returned. If a service requester attempts to call a discovered
lookup service and receives a RemoteException, the requester
is expected to call the |
Classes implement the DiscoveryListener interface when they want
to know when lookup services become available and when they go
away (discovered() and discarded()
methods respectively).
Implementers must register their object with a
When a service goes away, the |
This is the object that is passed to the DiscoveryListener
methods when a new lookup service is discovered or when one
goes away.
It only has one method, |
Since the LookupDiscovery object continues to look
for lookup services long after it has been instantiated,
this example includes a call to join()
in the main() method to pause the example
long enough to discover the reggie lookup service.
The next call in To exit this example, press ctrl-c.
|
|
Figure 1: LookupDiscoveryExample |
|
Since there is only one lookup service active (reggie), there
is only one lookup service discovered.
|
To run this example:
|
|
by Noel Enete . . . www.enete.com . . . noel@enete.com |