public class ZeroconfDiscoveryAgent extends java.lang.Object implements DiscoveryAgent, ServiceListener
| Constructor and Description |
|---|
ZeroconfDiscoveryAgent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addService(JmDNS jmDNS,
java.lang.String type,
java.lang.String name) |
protected JmDNS |
createJmDNS() |
protected java.net.InetAddress |
createLocalAddress() |
protected ServiceInfo |
createServiceInfo(java.lang.String name,
java.util.Map map) |
java.lang.String |
getGroup() |
JmDNS |
getJmdns() |
java.net.InetAddress |
getLocalAddress() |
java.lang.String |
getLocalhost() |
int |
getPriority() |
java.lang.String |
getType() |
int |
getWeight() |
void |
registerService(java.lang.String name)
register a service
|
void |
removeService(JmDNS jmDNS,
java.lang.String type,
java.lang.String name) |
void |
resolveService(JmDNS jmDNS,
java.lang.String type,
java.lang.String name,
ServiceInfo serviceInfo) |
void |
serviceAdded(ServiceEvent event)
A service has been added.
|
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)
A service has been removed.
|
void |
serviceResolved(ServiceEvent event)
A service has been resolved.
|
void |
setDiscoveryListener(DiscoveryListener listener)
Sets the discovery listener
|
void |
setGroup(java.lang.String group) |
void |
setJmdns(JmDNS jmdns) |
void |
setLocalAddress(java.net.InetAddress localAddress) |
void |
setLocalhost(java.lang.String localhost) |
void |
setPriority(int priority) |
void |
setWeight(int weight) |
void |
start() |
void |
stop() |
public ZeroconfDiscoveryAgent()
public void start() throws java.lang.Exception
public void registerService(java.lang.String name) throws java.io.IOException
DiscoveryAgentregisterService in interface DiscoveryAgentjava.io.IOExceptionpublic void addService(JmDNS jmDNS, java.lang.String type, java.lang.String name)
public void removeService(JmDNS jmDNS, java.lang.String type, java.lang.String name)
public void serviceAdded(ServiceEvent event)
ServiceListenerserviceAdded in interface ServiceListenerevent - The ServiceEvent providing the name and fully qualified type
of the service.public void serviceRemoved(ServiceEvent event)
ServiceListenerserviceRemoved in interface ServiceListenerevent - The ServiceEvent providing the name and fully qualified type
of the service.public void serviceResolved(ServiceEvent event)
ServiceListenerserviceResolved in interface ServiceListenerevent - The ServiceEvent providing the name, the fully qualified
type of the service, and the service info record, or null if the service
could not be resolved.public void resolveService(JmDNS jmDNS, java.lang.String type, java.lang.String name, ServiceInfo serviceInfo)
public int getPriority()
public void setPriority(int priority)
public int getWeight()
public void setWeight(int weight)
public java.net.InetAddress getLocalAddress() throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic void setLocalAddress(java.net.InetAddress localAddress)
public java.lang.String getLocalhost()
public void setLocalhost(java.lang.String localhost)
protected ServiceInfo createServiceInfo(java.lang.String name, java.util.Map map)
protected JmDNS createJmDNS() throws java.io.IOException
java.io.IOExceptionprotected java.net.InetAddress createLocalAddress() throws java.net.UnknownHostException
java.net.UnknownHostExceptionpublic void setDiscoveryListener(DiscoveryListener listener)
DiscoveryAgentsetDiscoveryListener in interface DiscoveryAgentpublic java.lang.String getGroup()
public void setGroup(java.lang.String group)
public java.lang.String getType()
public void serviceFailed(DiscoveryEvent event) throws java.io.IOException
DiscoveryAgentserviceFailed in interface DiscoveryAgentjava.io.IOExceptionCopyright © 2005-2012. All Rights Reserved.