All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iBus.layers.PULL

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

public class PULL
extends ProtocolObject
implements Runnable

PULL: basic PULL layer.

PULL implements the dnPull method. On a dnPull request it waits until at least one listener is available on the channel or until a timeout occurs. Then the request posting is multicast to the channel. Now PULL blocks the dnPull call until either a reply posting is received, until the last listener is gone without having sent a reply, or until a timeout occurs.

PARAMETERS:

POSITION IN STACK:

DESIGN:

FAULT TOLERANCE:

EVENTS PRODUCED:

EVENTS HANDLED:

EVENTS CONSUMED:

THREADS:


Constructor Index

 o PULL()
Create a PULL object by initializing the ProtocolObject base class

Method Index

 o dnInit()
Initialize the protocol object after the protocol stack has been created.
 o dnPull(iBusURL, MessageEvent)
Called by the object above to issue a blocking pull request.
 o dnPullReply(MessageEvent, PullContext, MessageEvent)
Reply to a pull request.
 o dnTerminate()
Terminate any threads in the protocol object.
 o dnUnregisterTalker(iBusURL)
Called by the object above or by an iBus application to unregister as a talker from a channel.
 o dnUnsubscribe(iBusURL)
Called by the object above or by an iBus application to unsubscribe from a certain channel.
 o getTimeout()
Returns the value of the Timeout propery.
 o run()
A thread to periodically check whether some outstanding request has timed out.
 o setTimeout(int)
Set the Timeout propery.
 o upHandleEvent(Event)
Called by the protocol object beneath to pass an event up to me.

Constructors

 o PULL
 public PULL()
Create a PULL object by initializing the ProtocolObject base class

Methods

 o dnInit
 public synchronized void dnInit()
Initialize the protocol object after the protocol stack has been created. Also checks that the right parameters were given to the protocol object.

Overrides:
dnInit 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 dnPull
 public MessageEvent[] dnPull(iBusURL channel,
                              MessageEvent msg) throws CommException, NotRegistered
Called by the object above to issue a blocking pull request.

Parameters:
channel - the destination channel of the posting
msg - the request message to be sent
Returns:
an array of zero or more reply messages
Throws: CommException
on communication failure
Throws: NotRegistered
in case registerTalker was not called for the channel
Overrides:
dnPull in class ProtocolObject
 o dnPullReply
 public synchronized void dnPullReply(MessageEvent reply,
                                      PullContext pctx,
                                      MessageEvent request) throws CommException
Reply to a pull request.

Parameters:
reply - the reply message to return
pctx - the context of the associated pull request
request - the request message
Throws: CommException
on communication failure
Overrides:
dnPullReply in class ProtocolObject
 o dnUnsubscribe
 public synchronized void dnUnsubscribe(iBusURL channel) throws NotSubscribed, CommException
Called by the object above or by an iBus application to unsubscribe from a certain channel.

Parameters:
channel - the channel to unsubscribe from
Throws: NotSubscribed
if this stack is not subscribed to the channel
Throws: CommException
in case of a communication error
Overrides:
dnUnsubscribe in class ProtocolObject
 o dnUnregisterTalker
 public synchronized void dnUnregisterTalker(iBusURL channel) throws NotRegistered, CommException
Called by the object above or by an iBus application to unregister as a talker from a channel.

Parameters:
channel - the channel to unregister from
Throws: NotRegistered
if this stack is not registered with the channel
Throws: CommException
in case of a communication error
Overrides:
dnUnregisterTalker in class ProtocolObject
 o upHandleEvent
 public void upHandleEvent(Event event)
Called by the protocol object beneath to pass an event up to me. An event can be the arrival of a posting, the detection of a failure, an acknowledgement, etc.

Parameters:
event - determines the type of event
Overrides:
upHandleEvent in class ProtocolObject
 o run
 public void run()
A thread to periodically check whether some outstanding request has timed out.

 o getTimeout
 public int getTimeout()
Returns the value of the Timeout propery.

Returns:
the value of the Timeout propery (milliseconds)
 o setTimeout
 public void setTimeout(int t)
Set the Timeout propery.

Parameters:
t - the new value of the Timeout property (milliseconds)

All Packages  Class Hierarchy  This Package  Previous  Next  Index