public interface ServiceDiscovered extends Iterable<Discoverable>
Iterable
that gives set of latest Discoverable
every time when
Iterable.iterator()
is invoked.Modifier and Type | Interface and Description |
---|---|
static interface |
ServiceDiscovered.ChangeListener
Represents a callback for watching changes in the discovery list.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Discoverable discoverable)
Checks if the given discoverable contains in the current discovery list.
|
String |
getName()
Returns the name of the service being discovered.
|
Cancellable |
watchChanges(ServiceDiscovered.ChangeListener listener,
Executor executor)
Registers a
ServiceDiscovered.ChangeListener to watch for changes in the discovery list. |
forEach, iterator, spliterator
String getName()
Cancellable watchChanges(ServiceDiscovered.ChangeListener listener, Executor executor)
ServiceDiscovered.ChangeListener
to watch for changes in the discovery list.
The ServiceDiscovered.ChangeListener.onChange(ServiceDiscovered)
method will be triggered when start watching,
and on every subsequent changes in the discovery list.listener
- A ServiceDiscovered.ChangeListener
to watch for changes.executor
- A Executor
for issuing call to the given listener.Cancellable
to cancel the watch.boolean contains(Discoverable discoverable)
discoverable
- The Discoverable
to check for.true
if it exists, false
otherwise.Copyright © 2013-2016 The Apache Software Foundation. All rights reserved.