org.jgroups.protocols
Class OMOLSR

java.lang.Object
  extended by org.jgroups.stack.Protocol
      extended by org.jgroups.protocols.OMOLSR

public class OMOLSR
extends org.jgroups.stack.Protocol

An Overlay Multicast protocol. Multicast messages are intercepted by this protocol and are sent by means of several unicast messages. This protocol constructs a multicast mesh in order to send multicast messages in a efficient manner.

Author:
Marcel Arrufat Arias, Gerard Paris Aixala

Field Summary
 
Fields inherited from class org.jgroups.stack.Protocol
down_prot, log, props, stack, stats, up_prot
 
Constructor Summary
OMOLSR()
           
 
Method Summary
 java.lang.Object down(org.jgroups.Event evt)
          An event is to be sent down the stack.
 java.lang.Object eventDown(org.jgroups.Event evt)
           
 java.lang.Object eventUp(org.jgroups.Event evt)
           
 java.lang.String getName()
           
 void sendUnicastDataMessage(org.jgroups.Message msg)
           
 boolean setProperties(java.util.Properties props)
          sets the properties of the OMOLSR protocol.
 void setUnicastHandlerListener(UnicastHandlerListener listener)
           
 void start()
          Starts the protocol, sets the port where broadcast messages are received
 void stop()
          Stops the protocol, by unregistering itself from the OMcastHandler
 java.lang.Object up(org.jgroups.Event evt)
          An event was received from the layer below.
 
Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getDownProtocol, getProperties, getUpProtocol, init, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setPropertiesInternal, setProtocolStack, setUpProtocol, statsEnabled, upThreadEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMOLSR

public OMOLSR()
Method Detail

down

public java.lang.Object down(org.jgroups.Event evt)
An event is to be sent down the stack. The layer may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the layer may need to add a header to it (or do nothing at all) before sending it down the stack using PassDown. In case of a GET_ADDRESS event (which tries to retrieve the stack's address from one of the bottom layers), the layer may need to send a new response event back up the stack using passUp().

Overrides:
down in class org.jgroups.stack.Protocol

eventDown

public java.lang.Object eventDown(org.jgroups.Event evt)

eventUp

public java.lang.Object eventUp(org.jgroups.Event evt)

getName

public java.lang.String getName()
Specified by:
getName in class org.jgroups.stack.Protocol
See Also:
Protocol.getName()

sendUnicastDataMessage

public void sendUnicastDataMessage(org.jgroups.Message msg)
Parameters:
msg -

setProperties

public boolean setProperties(java.util.Properties props)
sets the properties of the OMOLSR protocol. The following properties are available property: bc_port port where broadcast message will be sent

Overrides:
setProperties in class org.jgroups.stack.Protocol
Parameters:
props - - a property set containing only OMOLSR properties
Returns:
returns true if all properties were parsed properly returns false if there are unrecnogized properties in the property set

setUnicastHandlerListener

public void setUnicastHandlerListener(UnicastHandlerListener listener)

start

public void start()
           throws java.lang.Exception
Starts the protocol, sets the port where broadcast messages are received

Overrides:
start in class org.jgroups.stack.Protocol
Throws:
java.lang.Exception

stop

public void stop()
Stops the protocol, by unregistering itself from the OMcastHandler

Overrides:
stop in class org.jgroups.stack.Protocol

up

public java.lang.Object up(org.jgroups.Event evt)
An event was received from the layer below. Usually the current layer will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally the event is either a) discarded, or b) an event is sent down the stack using PassDown or c) the event (or another event) is sent up the stack using PassUp.

Overrides:
up in class org.jgroups.stack.Protocol
Parameters:
evt - - the event that has been sent from the layer below