org.activemq.transport.zeroconf
Class ZeroconfDiscoveryAgent

java.lang.Object
  extended by org.activemq.transport.DiscoveryAgentSupport
      extended by org.activemq.transport.zeroconf.ZeroconfDiscoveryAgent
All Implemented Interfaces:
EventListener, javax.jmdns.ServiceListener, org.activemq.service.Service, org.activemq.transport.DiscoveryAgent

public class ZeroconfDiscoveryAgent
extends org.activemq.transport.DiscoveryAgentSupport
implements javax.jmdns.ServiceListener

A DiscoveryAgent using Zeroconf via the jmDNS library

Version:
$Revision$

Field Summary
 
Fields inherited from class org.activemq.transport.DiscoveryAgentSupport
listeners
 
Constructor Summary
ZeroconfDiscoveryAgent()
           
 
Method Summary
 void addService(javax.jmdns.JmDNS jmDNS, String type, String name)
           
protected  javax.jmdns.JmDNS createJmDNS()
           
protected  InetAddress createLocalAddress()
           
protected  javax.jmdns.ServiceInfo createServiceInfo(String name, Map map)
           
 javax.jmdns.JmDNS getJmdns()
           
 InetAddress getLocalAddress()
           
 String getLocalhost()
           
 int getPriority()
           
 String getType()
           
 int getWeight()
           
 void registerService(String name, Map details)
           
 void removeService(javax.jmdns.JmDNS jmDNS, String type, String name)
           
 void resolveService(javax.jmdns.JmDNS jmDNS, String type, String name, javax.jmdns.ServiceInfo serviceInfo)
           
 void serviceAdded(javax.jmdns.ServiceEvent event)
           
 void serviceRemoved(javax.jmdns.ServiceEvent event)
           
 void serviceResolved(javax.jmdns.ServiceEvent event)
           
 void setJmdns(javax.jmdns.JmDNS jmdns)
           
 void setLocalAddress(InetAddress localAddress)
           
 void setLocalhost(String localhost)
           
 void setPriority(int priority)
           
 void setType(String type)
           
 void setWeight(int weight)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.activemq.transport.DiscoveryAgentSupport
addDiscoveryListener, fireAddService, fireRemoveService, removeDiscoveryListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZeroconfDiscoveryAgent

public ZeroconfDiscoveryAgent()
Method Detail

start

public void start()
           throws JMSException
Specified by:
start in interface org.activemq.service.Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
Specified by:
stop in interface org.activemq.service.Service
Throws:
JMSException

registerService

public void registerService(String name,
                            Map details)
                     throws JMSException
Specified by:
registerService in interface org.activemq.transport.DiscoveryAgent
Throws:
JMSException

addService

public void addService(javax.jmdns.JmDNS jmDNS,
                       String type,
                       String name)

removeService

public void removeService(javax.jmdns.JmDNS jmDNS,
                          String type,
                          String name)

resolveService

public void resolveService(javax.jmdns.JmDNS jmDNS,
                           String type,
                           String name,
                           javax.jmdns.ServiceInfo serviceInfo)

getType

public String getType()

setType

public void setType(String type)

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

getWeight

public int getWeight()

setWeight

public void setWeight(int weight)

getJmdns

public javax.jmdns.JmDNS getJmdns()

setJmdns

public void setJmdns(javax.jmdns.JmDNS jmdns)

getLocalAddress

public InetAddress getLocalAddress()
                            throws UnknownHostException
Throws:
UnknownHostException

setLocalAddress

public void setLocalAddress(InetAddress localAddress)

getLocalhost

public String getLocalhost()

setLocalhost

public void setLocalhost(String localhost)

createServiceInfo

protected javax.jmdns.ServiceInfo createServiceInfo(String name,
                                                    Map map)

createJmDNS

protected javax.jmdns.JmDNS createJmDNS()
                                 throws IOException
Throws:
IOException

createLocalAddress

protected InetAddress createLocalAddress()
                                  throws UnknownHostException
Throws:
UnknownHostException

serviceAdded

public void serviceAdded(javax.jmdns.ServiceEvent event)
Specified by:
serviceAdded in interface javax.jmdns.ServiceListener

serviceRemoved

public void serviceRemoved(javax.jmdns.ServiceEvent event)
Specified by:
serviceRemoved in interface javax.jmdns.ServiceListener

serviceResolved

public void serviceResolved(javax.jmdns.ServiceEvent event)
Specified by:
serviceResolved in interface javax.jmdns.ServiceListener


Copyright © 2004-2009 Protique, Ltd.. All Rights Reserved.