org.jboss.remoting.detection.multicast
Class MulticastDetector

java.lang.Object
  extended by org.jboss.remoting.detection.AbstractDetector
      extended by org.jboss.remoting.detection.multicast.MulticastDetector
All Implemented Interfaces:
javax.management.MBeanRegistration, AbstractDetectorMBean, Detector, MulticastDetectorMBean

public class MulticastDetector
extends AbstractDetector
implements MulticastDetectorMBean

MulticastDetector is a remoting detector that broadcasts detection messages using muliticast. The default multicast ip is 224.1.9.1 and port 2410.

Version:
$Revision: 4969 $
Author:
Jeff Haynie, Adrian Brock, Tom Elrod

Field Summary
 
Fields inherited from class org.jboss.remoting.detection.AbstractDetector
log, mbeanserver, networkRegistry, objectName, registryObjectName
 
Constructor Summary
MulticastDetector()
           
 
Method Summary
protected  void forceHeartbeat()
          Used to force detection messages to be sent by remoting servers and consumed by detector and registered with network registry.
 java.net.InetAddress getAddress()
          return the multicast address of the detector
 java.net.InetAddress getBindAddress()
          return the bind address of the detector
 int getBufferSize()
           
 java.lang.String getDefaultIP()
           
 int getPort()
          get the port that the detector is multicasting to
protected  void heartbeat()
          subclasses must implement to provide the specific heartbeat protocol for this server to send out to other servers on the network
 void setAddress(java.net.InetAddress ip)
          set the interface address of the multicast
 void setBindAddress(java.net.InetAddress ip)
          set the bind address of the multicast
 void setBufferSize(int bufferSize)
           
 void setDefaultIP(java.lang.String defaultIP)
           
 void setPort(int port)
          set the port for detections to be multicast to
 void start()
          called by MBeanServer to start the mbean lifecycle
 void stop()
          called by the MBeanServer to stop the mbean lifecycle
 
Methods inherited from class org.jboss.remoting.detection.AbstractDetector
checkInvokerServer, createDetection, detect, forceDetection, getConfiguration, getDefaultTimeDelay, getHeartbeatDelay, getHeartbeatPeriod, getHeartbeatTimeDelay, getPingerDelay, getPingerPeriod, isRemoteDetection, postDeregister, postRegister, preDeregister, preRegister, setConfiguration, setDefaultTimeDelay, setHeartbeatTimeDelay, startHeartbeat, startPinger, stopHeartbeat, stopPinger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.remoting.detection.AbstractDetectorMBean
getConfiguration, getDefaultTimeDelay, getHeartbeatTimeDelay, setConfiguration, setDefaultTimeDelay, setHeartbeatTimeDelay
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preDeregister, preRegister
 

Constructor Detail

MulticastDetector

public MulticastDetector()
Method Detail

getDefaultIP

public java.lang.String getDefaultIP()
Specified by:
getDefaultIP in interface MulticastDetectorMBean
Returns:
The IP that is used to broadcast detection messages on via multicast.

setDefaultIP

public void setDefaultIP(java.lang.String defaultIP)
Specified by:
setDefaultIP in interface MulticastDetectorMBean
Parameters:
defaultIP - The IP that is used to broadcast detection messages on via multicast.

getAddress

public java.net.InetAddress getAddress()
return the multicast address of the detector

Specified by:
getAddress in interface MulticastDetectorMBean
Returns:

setAddress

public void setAddress(java.net.InetAddress ip)
set the interface address of the multicast

Specified by:
setAddress in interface MulticastDetectorMBean
Parameters:
ip -

getBindAddress

public java.net.InetAddress getBindAddress()
return the bind address of the detector

Specified by:
getBindAddress in interface MulticastDetectorMBean
Returns:

setBindAddress

public void setBindAddress(java.net.InetAddress ip)
set the bind address of the multicast

Specified by:
setBindAddress in interface MulticastDetectorMBean
Parameters:
ip -

getPort

public int getPort()
get the port that the detector is multicasting to

Specified by:
getPort in interface MulticastDetectorMBean
Returns:

setPort

public void setPort(int port)
set the port for detections to be multicast to

Specified by:
setPort in interface MulticastDetectorMBean
Parameters:
port -

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface MulticastDetectorMBean
Returns:
The size of the byte array in the DatagramPacket.

setBufferSize

public void setBufferSize(int bufferSize)
Specified by:
setBufferSize in interface MulticastDetectorMBean
Parameters:
bufferSize - The size of the byte array in the DatagramPacket.

start

public void start()
           throws java.lang.Exception
called by MBeanServer to start the mbean lifecycle

Specified by:
start in interface Detector
Overrides:
start in class AbstractDetector
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
called by the MBeanServer to stop the mbean lifecycle

Specified by:
stop in interface Detector
Overrides:
stop in class AbstractDetector
Throws:
java.lang.Exception

heartbeat

protected void heartbeat()
subclasses must implement to provide the specific heartbeat protocol for this server to send out to other servers on the network

Specified by:
heartbeat in class AbstractDetector

forceHeartbeat

protected void forceHeartbeat()
Description copied from class: AbstractDetector
Used to force detection messages to be sent by remoting servers and consumed by detector and registered with network registry.

Specified by:
forceHeartbeat in class AbstractDetector


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.