|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.jmdns.JmDNS
public class JmDNS
mDNS implementation in Java.
Field Summary | |
---|---|
protected boolean |
closed
Used to fix live lock problem on unregester. |
static String |
VERSION
The version of JmDNS. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String VERSION
protected boolean closed
Constructor Detail |
---|
public JmDNS() throws IOException
IOException
public JmDNS(InetAddress addr) throws IOException
IOException
Method Detail |
---|
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 milliseconds
public 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 types
IOException
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 String toString()
toString
in class Object
public ServiceInfo[] list(String type)
type
- Service type name, such as _http._tcp.local.
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |