|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jini.discovery.LookupDiscovery
This class allows one to find instances of the lookup service that are nearby on the network, using group names. It provides a simple unified front end to the multicast request and announcement protocols.
ServiceRegistrar
,
DiscoveryListener
,
DiscoveryEvent
,
DiscoveryPermission
Field Summary | |
static java.lang.String[] |
ALL_GROUPS
Attempt to discover all reachable lookup services. |
static java.lang.String[] |
NO_GROUPS
Do nothing (halt discovery temporarily). |
Constructor Summary | |
LookupDiscovery(java.lang.String[] groups)
Construct a new lookup discovery object, set to discover the given set of groups. |
Method Summary | |
void |
addDiscoveryListener(DiscoveryListener l)
Register a listener as interested in receiving DiscoveryEvent notifications. |
void |
addGroups(java.lang.String[] newGroups)
Add a set of groups to the set to be discovered. |
void |
discard(ServiceRegistrar reg)
Discard a registrar from the set of registrars already discovered. |
void |
finalize()
|
java.lang.String[] |
getGroups()
Return the set of group names this LookupDiscovery instance is trying to discover. |
void |
removeDiscoveryListener(DiscoveryListener l)
Indicate that a listener is no longer interested in receiving DiscoveryEvent notifications. |
void |
removeGroups(java.lang.String[] oldGroups)
Remove a set of groups from the set to be discovered. |
void |
setGroups(java.lang.String[] newGroups)
Change the set of groups to be discovered to correspond to the given set. |
void |
terminate()
Terminate the discovery process. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String[] NO_GROUPS
LookupDiscovery(java.lang.String[])
,
setGroups(java.lang.String[])
public static final java.lang.String[] ALL_GROUPS
LookupDiscovery(java.lang.String[])
,
setGroups(java.lang.String[])
Constructor Detail |
public LookupDiscovery(java.lang.String[] groups) throws java.io.IOException
groups
- the set of group names to discover (null for no
set, empty for no discovery)NO_GROUPS
,
ALL_GROUPS
,
setGroups(java.lang.String[])
,
DiscoveryPermission
Method Detail |
public void addDiscoveryListener(DiscoveryListener l)
l
- the listener to registerDiscoveryEvent
public void removeDiscoveryListener(DiscoveryListener l)
l
- the listener to unregisterpublic void discard(ServiceRegistrar reg)
If the registrar has been discovered using this LookupDiscovery object, each listener registered with this object will have its discarded method called with the given registrar as parameter.
reg
- the registrar to discardDiscoveryListener.discarded(net.jini.discovery.DiscoveryEvent)
public java.lang.String[] getGroups()
NO_GROUPS
,
ALL_GROUPS
public void setGroups(java.lang.String[] newGroups) throws java.io.IOException
newGroups
- the new set of groups to discover (null for
all, empty array for no discovery)LookupDiscovery(java.lang.String[])
,
ALL_GROUPS
,
NO_GROUPS
,
DiscoveryPermission
public void addGroups(java.lang.String[] newGroups) throws java.io.IOException
newGroups
- the groups to addDiscoveryPermission
public void removeGroups(java.lang.String[] oldGroups)
oldGroups
- groups to removepublic void terminate()
public void finalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |