public class ZeroconfDiscoveryAgent extends Object implements DiscoveryAgent
| Constructor and Description |
|---|
ZeroconfDiscoveryAgent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addService(JmDNS jmDNS,
String type,
String name) |
protected JmDNS |
createJmDNS() |
protected InetAddress |
createLocalAddress() |
protected ServiceInfo |
createServiceInfo(String name,
Map map) |
String |
getGroup() |
JmDNS |
getJmdns() |
InetAddress |
getLocalAddress() |
String |
getLocalhost() |
int |
getPriority() |
String |
getType() |
int |
getWeight() |
void |
registerService(String name)
register a service
|
void |
removeService(JmDNS jmDNS,
String type,
String name) |
void |
resolveService(JmDNS jmDNS,
String type,
String name,
ServiceInfo serviceInfo) |
void |
serviceAdded(ServiceEvent event) |
void |
serviceFailed(DiscoveryEvent event)
A process actively using a service may see it go down before the DiscoveryAgent notices the
service's failure.
|
void |
serviceRemoved(ServiceEvent event) |
void |
serviceResolved(ServiceEvent event) |
void |
setDiscoveryListener(DiscoveryListener listener)
Sets the discovery listener
|
void |
setGroup(String group) |
void |
setJmdns(JmDNS jmdns) |
void |
setLocalAddress(InetAddress localAddress) |
void |
setLocalhost(String localhost) |
void |
setPriority(int priority) |
void |
setType(String typeSuffix) |
void |
setWeight(int weight) |
void |
start() |
void |
stop() |
public ZeroconfDiscoveryAgent()
public void registerService(String name) throws IOException
DiscoveryAgentregisterService in interface DiscoveryAgentIOExceptionpublic void addService(JmDNS jmDNS, String type, String name)
public void removeService(JmDNS jmDNS, String type, String name)
public void serviceAdded(ServiceEvent event)
public void serviceRemoved(ServiceEvent event)
public void serviceResolved(ServiceEvent event)
public void resolveService(JmDNS jmDNS, String type, String name, ServiceInfo serviceInfo)
public int getPriority()
public void setPriority(int priority)
public int getWeight()
public void setWeight(int weight)
public JmDNS getJmdns() throws IOException
IOExceptionpublic void setJmdns(JmDNS jmdns)
public InetAddress getLocalAddress() throws UnknownHostException
UnknownHostExceptionpublic void setLocalAddress(InetAddress localAddress)
public String getLocalhost()
public void setLocalhost(String localhost)
protected ServiceInfo createServiceInfo(String name, Map map)
protected JmDNS createJmDNS() throws IOException
IOExceptionprotected InetAddress createLocalAddress() throws UnknownHostException
UnknownHostExceptionpublic void setDiscoveryListener(DiscoveryListener listener)
DiscoveryAgentsetDiscoveryListener in interface DiscoveryAgentpublic void serviceFailed(DiscoveryEvent event) throws IOException
DiscoveryAgentserviceFailed in interface DiscoveryAgentIOExceptionCopyright © 2005–2016 The Apache Software Foundation. All rights reserved.