Package javax.jmdns.impl
Class JmDNSImpl.ServiceCollector
java.lang.Object
javax.jmdns.impl.JmDNSImpl.ServiceCollector
- All Implemented Interfaces:
EventListener
,ServiceListener
- Enclosing class:
JmDNSImpl
Instances of ServiceCollector are used internally to speed up the performance of method
list(type)
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentMap
<String, ServiceEvent> A set of collected service event waiting to be resolved.private final ConcurrentMap
<String, ServiceInfo> A set of collected service instance names.private boolean
This is used to force a wait on the first invocation of list.private final String
This is the type we are listening for (only used for debugging). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlist
(long timeout) Returns an array of all service infos which have been collected by this ServiceCollector.void
serviceAdded
(ServiceEvent event) A service has been added.void
serviceRemoved
(ServiceEvent event) A service has been removed.void
serviceResolved
(ServiceEvent event) A service has been resolved.toString()
-
Field Details
-
_infos
A set of collected service instance names. -
_events
A set of collected service event waiting to be resolved. -
_type
This is the type we are listening for (only used for debugging). -
_needToWaitForInfos
private volatile boolean _needToWaitForInfosThis is used to force a wait on the first invocation of list.
-
-
Constructor Details
-
ServiceCollector
-
-
Method Details
-
serviceAdded
A service has been added.- Specified by:
serviceAdded
in interfaceServiceListener
- Parameters:
event
- service event
-
serviceRemoved
A service has been removed.- Specified by:
serviceRemoved
in interfaceServiceListener
- Parameters:
event
- service event
-
serviceResolved
A service has been resolved. Its details are now available in the ServiceInfo record.- Specified by:
serviceResolved
in interfaceServiceListener
- Parameters:
event
- service event
-
list
Returns an array of all service infos which have been collected by this ServiceCollector.- Parameters:
timeout
- timeout if the info list is empty.- Returns:
- Service Info array
-
toString
-