org.apache.openejb.server.discovery
Class MulticastDiscoveryAgent

java.lang.Object
  extended by org.apache.openejb.server.discovery.MulticastDiscoveryAgent
All Implemented Interfaces:
DiscoveryAgent, SelfManaging, ServerService, Service

public class MulticastDiscoveryAgent
extends java.lang.Object
implements DiscoveryAgent, ServerService, SelfManaging

Version:
$Rev$ $Date$

Constructor Summary
MulticastDiscoveryAgent()
           
 
Method Summary
 java.lang.String getHost()
           
 java.lang.String getIP()
           
 java.lang.String getName()
           
 int getPort()
           
 int getTimeToLive()
           
 void init(java.util.Properties props)
           
 boolean isLoopbackMode()
           
static void main(java.lang.String[] args)
           
 void registerService(java.net.URI serviceUri)
          register a service
 void reportFailed(java.net.URI serviceUri)
          A process actively using a service may see it go down before the DiscoveryAgent notices the service's failure.
 void service(java.io.InputStream in, java.io.OutputStream out)
           
 void service(java.net.Socket socket)
           
 void setDiscoveryListener(DiscoveryListener listener)
          Sets the discovery listener
 void setHost(java.lang.String host)
           
 void setLoopbackMode(boolean loopbackMode)
           
 void setTimeToLive(int timeToLive)
           
 void start()
          start the discovery agent
 void stop()
          stop the channel
 void unregisterService(java.net.URI serviceUri)
          register a service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MulticastDiscoveryAgent

public MulticastDiscoveryAgent()
Method Detail

init

public void init(java.util.Properties props)
Specified by:
init in interface Service

getIP

public java.lang.String getIP()
Specified by:
getIP in interface ServerService

getName

public java.lang.String getName()
Specified by:
getName in interface ServerService

getPort

public int getPort()
Specified by:
getPort in interface ServerService

setDiscoveryListener

public void setDiscoveryListener(DiscoveryListener listener)
Description copied from interface: DiscoveryAgent
Sets the discovery listener

Specified by:
setDiscoveryListener in interface DiscoveryAgent

registerService

public void registerService(java.net.URI serviceUri)
                     throws java.io.IOException
Description copied from interface: DiscoveryAgent
register a service

Specified by:
registerService in interface DiscoveryAgent
Throws:
java.io.IOException

unregisterService

public void unregisterService(java.net.URI serviceUri)
                       throws java.io.IOException
Description copied from interface: DiscoveryAgent
register a service

Specified by:
unregisterService in interface DiscoveryAgent
Throws:
java.io.IOException

reportFailed

public void reportFailed(java.net.URI serviceUri)
Description copied from interface: DiscoveryAgent
A process actively using a service may see it go down before the DiscoveryAgent notices the service's failure. That process can use this method to notify the DiscoveryAgent of the failure so that other listeners of this DiscoveryAgent can also be made aware of the failure.

Specified by:
reportFailed in interface DiscoveryAgent

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

start

public void start()
           throws ServiceException
start the discovery agent

Specified by:
start in interface ServerService
Throws:
java.lang.Exception
ServiceException

stop

public void stop()
          throws ServiceException
stop the channel

Specified by:
stop in interface ServerService
Throws:
java.lang.Exception
ServiceException

service

public void service(java.io.InputStream in,
                    java.io.OutputStream out)
             throws ServiceException,
                    java.io.IOException
Specified by:
service in interface ServerService
Throws:
ServiceException
java.io.IOException

service

public void service(java.net.Socket socket)
             throws ServiceException,
                    java.io.IOException
Specified by:
service in interface ServerService
Throws:
ServiceException
java.io.IOException

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

isLoopbackMode

public boolean isLoopbackMode()

setLoopbackMode

public void setLoopbackMode(boolean loopbackMode)

getTimeToLive

public int getTimeToLive()

setTimeToLive

public void setTimeToLive(int timeToLive)


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.