Modifier and Type | Field and Description |
---|---|
protected boolean |
closed
Used to fix live lock problem on unregester.
|
static String |
VERSION
The version of JmDNS.
|
Constructor and Description |
---|
JmDNS()
Create an instance of JmDNS.
|
JmDNS(InetAddress addr)
Create an instance of JmDNS and bind it to a
specific network interface given its IP-address.
|
Modifier and Type | Method and Description |
---|---|
void |
addServiceListener(String type,
ServiceListener listener)
Listen for services of a given type.
|
void |
addServiceTypeListener(ServiceTypeListener listener)
Listen for service types.
|
void |
close()
Close down jmdns.
|
String |
getHostName()
Return the HostName associated with this JmDNS instance.
|
InetAddress |
getInterface()
Return the address of the interface to which this instance of JmDNS is
bound.
|
org.apache.activemq.jmdns.HostInfo |
getLocalHost() |
ServiceInfo |
getServiceInfo(String type,
String name)
Get service information.
|
ServiceInfo |
getServiceInfo(String type,
String name,
int timeout)
Get service information.
|
ServiceInfo[] |
list(String type)
Returns a list of service infos of the specified type.
|
void |
printServices()
List Services and serviceTypes.
|
protected void |
recover()
Recover jmdns when there is an error.
|
void |
registerService(ServiceInfo info)
Register a service.
|
void |
registerServiceType(String type)
Register a service type.
|
void |
removeServiceListener(String type,
ServiceListener listener)
Remove listener for services of a given type.
|
void |
removeServiceTypeListener(ServiceTypeListener listener)
Remove listener for service types.
|
void |
requestServiceInfo(String type,
String name)
Request service information.
|
void |
requestServiceInfo(String type,
String name,
int timeout)
Request service information.
|
String |
toString() |
void |
unregisterAllServices()
Unregister all services.
|
void |
unregisterService(ServiceInfo info)
Unregister a service.
|
protected boolean closed
public JmDNS() throws IOException
IOException
public JmDNS(InetAddress addr) throws IOException
IOException
public String getHostName()
public org.apache.activemq.jmdns.HostInfo getLocalHost()
public InetAddress getInterface() throws IOException
IOException
public ServiceInfo getServiceInfo(String type, String name)
type
- fully qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.public ServiceInfo getServiceInfo(String type, String name, int timeout)
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.timeout
- timeout in millisecondspublic void requestServiceInfo(String type, String name)
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.public void requestServiceInfo(String type, String name, int timeout)
type
- full qualified service type, such as _http._tcp.local.
.name
- unqualified service name, such as foobar
.timeout
- timeout in millisecondspublic void addServiceTypeListener(ServiceTypeListener listener) throws IOException
listener
- listener for service typesIOException
public void removeServiceTypeListener(ServiceTypeListener listener)
listener
- listener for service typespublic void addServiceListener(String type, ServiceListener listener)
_http._tcp.local.
.type
- full qualified service type, such as _http._tcp.local.
.listener
- listener for service updatespublic void removeServiceListener(String type, ServiceListener listener)
listener
- listener for service updatespublic void registerService(ServiceInfo info) throws IOException
IOException
public void unregisterService(ServiceInfo info)
public void unregisterAllServices()
public void registerServiceType(String type)
protected void recover()
public void close()
public void printServices()
public ServiceInfo[] list(String type)
type
- Service type name, such as _http._tcp.local.
.Copyright © 2005–2017. All rights reserved.