本文整理汇总了Java中javax.jmdns.impl.tasks.RecordReaper类的典型用法代码示例。如果您正苦于以下问题:Java RecordReaper类的具体用法?Java RecordReaper怎么用?Java RecordReaper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RecordReaper类属于javax.jmdns.impl.tasks包,在下文中一共展示了RecordReaper类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JmDNSImpl
import javax.jmdns.impl.tasks.RecordReaper; //导入依赖的package包/类
/**
* Create an instance of JmDNS and bind it to a specific network interface given its IP-address.
*
* @param address
* IP address to bind to.
* @param name
* name of the newly created JmDNS
* @throws java.io.IOException
*/
public JmDNSImpl(InetAddress address, String name) throws IOException
{
super();
if (logger.isLoggable(Level.FINER))
{
logger.finer("JmDNS instance created");
}
_cache = new DNSCache(100);
_listeners = Collections.synchronizedList(new ArrayList<DNSListener>());
_serviceListeners = new ConcurrentHashMap<String, List<ServiceListenerStatus>>();
_typeListeners = Collections.synchronizedSet(new HashSet<ServiceTypeListenerStatus>());
_serviceCollectors = new ConcurrentHashMap<String, ServiceCollector>();
_services = new ConcurrentHashMap<String, ServiceInfo>(20);
_serviceTypes = new ConcurrentHashMap<String, Set<String>>(20);
_localHost = HostInfo.newHostInfo(address, this);
_name = (name != null ? name : _localHost.getName());
_timer = new Timer("JmDNS(" + _name + ").Timer", true);
_stateTimer = new Timer("JmDNS(" + _name + ").State.Timer", false);
// _cancelerTimer = new Timer("JmDNS.cancelerTimer");
// (ldeck 2.1.1) preventing shutdown blocking thread
// -------------------------------------------------
// _shutdown = new Thread(new Shutdown(), "JmDNS.Shutdown");
// Runtime.getRuntime().addShutdownHook(_shutdown);
// -------------------------------------------------
// Bind to multicast socket
this.openMulticastSocket(this.getLocalHost());
this.start(this.getServices().values());
new RecordReaper(this).start(_timer);
}
示例2: startReaper
import javax.jmdns.impl.tasks.RecordReaper; //导入依赖的package包/类
@Override
public void startReaper() {
new RecordReaper(_jmDNSImpl).start(_timer);
}