|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.artima.place.MulticastDiscoveryLink
A Link
that performs queries in lookup services located via
multicast discovery.
Constructor Summary | |
MulticastDiscoveryLink(net.jini.core.lookup.ServiceTemplate template)
Construct a MulticastDiscoveryLink with the passed
ServiceTemplate . |
|
MulticastDiscoveryLink(java.lang.String[] groups,
net.jini.core.lookup.ServiceTemplate template)
Construct a MulticastDiscoveryLink with the passed
groups String array and ServiceTemplate . |
Method Summary | |
void |
addProgressListener(ProgressListener listener)
Adds the specified ProgressListener to receive progress
events from this object. |
boolean |
equals(java.lang.Object o)
Two MulticastDiscoveryLink s are equal if they
produce the same Jini service item. |
java.lang.String[] |
getGroups()
Returns the groups used by this link in performing multicast discovery when activated. |
net.jini.core.lookup.ServiceTemplate |
getServiceTemplate()
Returns a duplicate of the ServiceTemplace used in
lookups when this link is activated. |
void |
removeProgressListener(ProgressListener listener)
Removes the specified ProgressListener so that it no
longer receives progress events from this object. |
net.jini.core.lookup.ServiceItem |
retrieveService()
Retrieve this service. |
void |
stopRetrieval()
Requests a retrieval to stop. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MulticastDiscoveryLink(net.jini.core.lookup.ServiceTemplate template) throws java.io.IOException, java.lang.ClassNotFoundException
MulticastDiscoveryLink
with the passed
ServiceTemplate
.
The activate
method will perform multicast discovery of
all reachable lookup services, and query each discovered lookup
service with the passed ServiceTemplate
.
template
- the ServiceTemplate
with which to peform
lookups when this link is activatedjava.io.IOException
- if an I/O error occurs when attempting to serialize
or deserialize the ServiceTemplate
.java.lang.ClassNotFoundException
- if a class can't be found when attempting
deserialize the duplicate ServiceTemplate
.public MulticastDiscoveryLink(java.lang.String[] groups, net.jini.core.lookup.ServiceTemplate template) throws java.io.IOException, java.lang.ClassNotFoundException
MulticastDiscoveryLink
with the passed
groups String
array and ServiceTemplate
.
The activate
method will perform multicast discovery,
and query each discovered lookup service with the passed
ServiceTemplate
.
Does multicast discovery and lookups. When this link is activated it
will just keep trying until either a match is found or the user
aborts. If multiple matches are found, a random match is returned.
groups
- an array of String
group names with which
perform multicast discovery when this link is activated.template
- the ServiceTemplate
with which to peform
lookups when this link is activatedMethod Detail |
public net.jini.core.lookup.ServiceItem retrieveService() throws java.rmi.RemoteException, StoppedException
activate
method will return promptly, returning a LinkActivation
object that enables clients to abort an activation. Invoking activate
again while an activation is currently in progress just starts a new
activation independent of the already running one.retrieveService
in interface Link
ServiceItem
the retrieved service itemRemoteException
- to indicate a failure in retrieving the serviceStoppedException
- to indicate that the request was stoppedpublic void stopRetrieval()
Link
stopRetrival()
has no effect. The stopRetrieval()
method does
not throw an exception to indicate the activation has already
succeeded, failed, or been aborted, but returns normally in these
cases.stopRetrieval
in interface Link
public net.jini.core.lookup.ServiceTemplate getServiceTemplate() throws java.io.IOException, java.lang.ClassNotFoundException
ServiceTemplace
used in
lookups when this link is activated. The duplicate is created by
serializing and then deserializing the actual
ServiceTemplate
.ServiceTemplate
used by this
link when activatedjava.io.IOException
- if an I/O error occurs when attempting to duplicate
the ServiceTemplate
.java.lang.ClassNotFoundException
- if a class can't be found when attempting
deserialize the duplicate ServiceTemplate
.public java.lang.String[] getGroups()
null
return value indicates
this link will attempt discovery of all reachable lookup services
when activated.public boolean equals(java.lang.Object o)
MulticastDiscoveryLink
s are equal if they
produce the same Jini service item. Therefore, two
MulticastDiscoveryLink objects, must have semantically identical service
templates, and identical sets of lookup groups.equals
in class java.lang.Object
public void addProgressListener(ProgressListener listener)
ProgressListener
to receive progress
events from this object. If listener
is null
, no
exception is thrown and no action is performed.addProgressListener
in interface ProgressEventGenerator
listener
- the ProgressListener
to addpublic void removeProgressListener(ProgressListener listener)
ProgressListener
so that it no
longer receives progress events from this object. This method performs
no function, nor does it throw an exception, if the listener specified
by the argument was not previously added to this object. If
listener
is null
, no exception is thrown and no
action is performed.removeProgressListener
in interface ProgressEventGenerator
listener
- the ProgressListener
to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |