/** * {@inheritDoc} */ @Override public void addServiceListener(String type, ServiceListener listener) { this.addServiceListener(type, listener, ListenerStatus.ASYNCHONEOUS); }
/** * {@inheritDoc} */ @Override public void addServiceListener(String type, ServiceListener listener) { this.addServiceListener(type, listener, ListenerStatus.ASYNCHRONOUS); }
/** * {@inheritDoc} */ @Override public void addServiceListener(String type, ServiceListener listener) { this.addServiceListener(type, listener, ListenerStatus.ASYNCHONEOUS); }
/** * {@inheritDoc} */ @Override public void addServiceListener(String type, ServiceListener listener) { this.addServiceListener(type, listener, ListenerStatus.ASYNCHONEOUS); }
ServiceInfoImpl resolveServiceInfo(String type, String name, String subtype, boolean persistent) { this.cleanCache(); String loType = type.toLowerCase(); this.registerServiceType(type); if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS); } // Check if the answer is in the cache. final ServiceInfoImpl info = this.getServiceInfoFromCache(type, name, subtype, persistent); // We still run the resolver to do the dispatch but if the info is already there it will quit immediately this.startServiceInfoResolver(info); return info; }
ServiceInfoImpl resolveServiceInfo(String type, String name, String subtype, boolean persistent) { this.cleanCache(); String loType = type.toLowerCase(); this.registerServiceType(type); if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS); } // Check if the answer is in the cache. final ServiceInfoImpl info = this.getServiceInfoFromCache(type, name, subtype, persistent); // We still run the resolver to do the dispatch but if the info is already there it will quit immediately this.startServiceInfoResolver(info); return info; }
ServiceInfoImpl resolveServiceInfo(String type, String name, String subtype, boolean persistent) { this.cleanCache(); String loType = type.toLowerCase(); this.registerServiceType(type); if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHRONOUS); } // Check if the answer is in the cache. final ServiceInfoImpl info = this.getServiceInfoFromCache(type, name, subtype, persistent); // We still run the resolver to do the dispatch but if the info is already there it will quit immediately this.startServiceInfoResolver(info); return info; }
ServiceInfoImpl resolveServiceInfo(String type, String name, String subtype, boolean persistent) { this.cleanCache(); String loType = type.toLowerCase(); this.registerServiceType(type); if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS); } // Check if the answer is in the cache. final ServiceInfoImpl info = this.getServiceInfoFromCache(type, name, subtype, persistent); // We still run the resolver to do the dispatch but if the info is already there it will quit immediately this.startServiceInfoResolver(info); return info; }
collector = _serviceCollectors.get(loType); if (newCollectorCreated) { this.addServiceListener(type, collector, ListenerStatus.SYNCHONEOUS);
collector = _serviceCollectors.get(loType); if (newCollectorCreated) { this.addServiceListener(type, collector, ListenerStatus.SYNCHONEOUS);
collector = _serviceCollectors.get(loType); if (newCollectorCreated) { this.addServiceListener(type, collector, ListenerStatus.SYNCHONEOUS);
/** * {@inheritDoc} */ @Override public ServiceInfo[] list(String type, long timeout) { this.cleanCache(); // Implementation note: The first time a list for a given type is // requested, a ServiceCollector is created which collects service // infos. This greatly speeds up the performance of subsequent calls // to this method. The caveats are, that 1) the first call to this // method for a given type is slow, and 2) we spawn a ServiceCollector // instance for each service type which increases network traffic a // little. String loType = type.toLowerCase(); boolean newCollectorCreated = false; if (this.isCanceling() || this.isCanceled()) { return new ServiceInfo[0]; } ServiceCollector collector = _serviceCollectors.get(loType); if (collector == null) { newCollectorCreated = _serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null; collector = _serviceCollectors.get(loType); if (newCollectorCreated) { this.addServiceListener(type, collector, ListenerStatus.SYNCHRONOUS); } } logger.debug("{}-collector: {}", this.getName(), collector); // At this stage the collector should never be null but it keeps findbugs happy. return (collector != null ? collector.list(timeout) : new ServiceInfo[0]); }
if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHRONOUS);
if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS);
if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS);
if (_serviceCollectors.putIfAbsent(loType, new ServiceCollector(type)) == null) { this.addServiceListener(loType, _serviceCollectors.get(loType), ListenerStatus.SYNCHONEOUS);