All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iBus.layers.IPMCAST

java.lang.Object
   |
   +----iBus.ProtocolObject
           |
           +----iBus.layers.IPMCAST

public class IPMCAST
extends ProtocolObject
implements Runnable
IPMCAST implements unreliable message delivery using the IP multicast and the UDP protocol. IPMCAST assumes that higher layers take care of message fragmentation and flow control. IPMCAST is typically the bottommost object in a protocol

PARAMETERS:

POSITION IN STACK:

DESIGN:

EVENTS PRODUCED:

EVENTS CONSUMED:

EVENTS HANDLED:

THREADS:


Variable Index

 o maxDatagramSize_
max.

Constructor Index

 o IPMCAST()
Create an IP multicast protocol object

Method Index

 o dnFlush()
Flush the protocol object.
 o dnGetStackURL()
Called by the API protocol object to obtain an URL used to reply to this stack.
 o dnInit()
Initialize the IPMCAST object.
 o dnPush(iBusURL, MessageEvent)
dnPush sends a message by multicast or unicast, depending on the IP address in the URL.
 o dnSubscribe(iBusURL)
Subscribe to ``url''.
 o dnTerminate()
Terminate any threads in the protocol object.
 o dnThrottle(boolean)
The stack is getting overloaded.
 o dnUnsubscribe(iBusURL)
Unsubscribe from ``url''.
 o getEventQueueSize()
Returns the size of the internal event queue.
 o getSenddelay()
Returns the senddelay property.
 o getStackSocket()
returns a DatagramSocket denoting this stack.
 o getSubscriptions()
Returns the subscriptions hashtable.
 o getTTL()
Returns the TTL property.
 o isHierarchical()
Checks whether hierarchical matching is enabled
 o putEvent(Event)
Puts an event into the eventQueue_.
 o run()
Gets events off the eventQueue and passes them up the stack:
 o setSenddelay(int)
Sets the senddelay property.
 o setTTL(int)
Sets the TTL property.
 o subscriptionsForAddr(String)
Checks whether there is a subscription for IP address ``address''.

Variables

 o maxDatagramSize_
 protected static final int maxDatagramSize_
max. UDP datagram size

Constructors

 o IPMCAST
 public IPMCAST()
Create an IP multicast protocol object

Methods

 o dnInit
 public synchronized void dnInit()
Initialize the IPMCAST object. A UDP socket is created for delivering doUnicast () messages and for receiving such point-to-point messages. Further, a StackID is created to uniquely identify the protocol stack the IPMCAST object belongs to. The StackID is piggybacked onto outgoing messages such that receivers know where to send replies to.

Overrides:
dnInit in class ProtocolObject
 o dnFlush
 public void dnFlush()
Flush the protocol object. Deliver any buffered messages.

Overrides:
dnFlush in class ProtocolObject
 o dnTerminate
 public void dnTerminate()
Terminate any threads in the protocol object. The object is unusable afterwards.

Overrides:
dnTerminate in class ProtocolObject
 o dnPush
 public void dnPush(iBusURL dest,
                    MessageEvent msg) throws CommException
dnPush sends a message by multicast or unicast, depending on the IP address in the URL.

Parameters:
dest - the iBus URL of the destination
msg - the iBus message to be sent
Throws: CommException
in case of a communication failure
Overrides:
dnPush in class ProtocolObject
 o dnSubscribe
 public synchronized void dnSubscribe(iBusURL url) throws AlreadySubscribed, CommException
Subscribe to ``url''. If the stack is not a member of subject.getAddress () already, create a MulticastSocket and join it. Otherwise we just put subject.getSubject () into a local hashtable.

Parameters:
url - the iBus URL to subscribe for
Throws: AlreadySubscribed
if this stack has already subscribed to the subject
Throws: CommException
in case of a communication exception when joining the IP multicast group
Overrides:
dnSubscribe in class ProtocolObject
 o dnUnsubscribe
 public synchronized void dnUnsubscribe(iBusURL url) throws NotSubscribed, CommException
Unsubscribe from ``url''. Leave the associated IP group if there are no more subjects we are registered to for that IP group.

Parameters:
url - the iBus URL to unsubscribe from
Throws: NotSubscribed
if this stack is not subscribed to the subject
Throws: CommException
in case of a communication exception when leaving the IP group
Overrides:
dnUnsubscribe in class ProtocolObject
 o dnGetStackURL
 public synchronized iBusURL dnGetStackURL()
Called by the API protocol object to obtain an URL used to reply to this stack. dnGetStackURL is typically implemented by the bottommost protocol object only.

Returns:
the URL of the stack
Overrides:
dnGetStackURL in class ProtocolObject
 o dnThrottle
 public synchronized void dnThrottle(boolean stop)
The stack is getting overloaded. Tell the senders to slow down the rate at which they send messages to us.

Parameters:
stop - true if throttling is required, false if unthrottling is required.
Overrides:
dnThrottle in class ProtocolObject
 o getTTL
 public int getTTL()
Returns the TTL property.

Returns:
the TTL property
 o setTTL
 public void setTTL(int ttl)
Sets the TTL property.

Parameters:
ttl - the TTL property
 o getEventQueueSize
 public int getEventQueueSize()
Returns the size of the internal event queue.

Returns:
the size of the internal event queue
 o getSenddelay
 public int getSenddelay()
Returns the senddelay property.

Returns:
the senddelay property
 o setSenddelay
 public void setSenddelay(int s)
Sets the senddelay property.

Parameters:
s - the senddelay property
 o isHierarchical
 public boolean isHierarchical()
Checks whether hierarchical matching is enabled

Returns:
whether hierarchical matching is enabled
 o run
 public void run()
Gets events off the eventQueue and passes them up the stack:

 o putEvent
 protected synchronized void putEvent(Event e)
Puts an event into the eventQueue_.

Parameters:
e - the event to put
 o getStackSocket
 protected DatagramSocket getStackSocket()
returns a DatagramSocket denoting this stack.

Returns:
a DatagramSocket denoting this stack
 o subscriptionsForAddr
 protected synchronized int subscriptionsForAddr(String address)
Checks whether there is a subscription for IP address ``address''.

Parameters:
address - the IP address to check
Returns:
the number of subscriptions for IP address ``address''
 o getSubscriptions
 protected Hashtable getSubscriptions()
Returns the subscriptions hashtable.

Returns:
the subscriptions hashtable

All Packages  Class Hierarchy  This Package  Previous  Next  Index