jGCS Documentation

net.sf.jgcs.adapters
Class BlockingReceiver

java.lang.Object
  extended by net.sf.jgcs.adapters.BlockingReceiver

public class BlockingReceiver
extends java.lang.Object

This adapter implements a receive() method on top of the given DataSession.

Author:
nuno

Constructor Summary
BlockingReceiver(DataSession session)
          This constructor registers it self as a listener for message and exception listeners.
 
Method Summary
 Message receive()
          Receives a message for the group.
 Message receive(long timeout, java.lang.Object context)
          Receives a message for the group.
 Message receive(java.lang.Object context)
          Receives a message for the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingReceiver

public BlockingReceiver(DataSession session)
                 throws ClosedSessionException
This constructor registers it self as a listener for message and exception listeners.

Parameters:
session - the data session to be used.
Throws:
ClosedSessionException
Method Detail

receive

public Message receive(java.lang.Object context)
                throws JGCSException
Receives a message for the group.

Parameters:
context - the context to be passed to the group communication.
Returns:
the received message.
Throws:
JGCSException

receive

public Message receive()
                throws JGCSException
Receives a message for the group.

Returns:
the received message.
Throws:
JGCSException

receive

public Message receive(long timeout,
                       java.lang.Object context)
                throws JGCSException
Receives a message for the group. This will block until the time expires. If no message was received until this time, null will be returned.

Parameters:
context - the context to be passed to the group communication.
timeout - the time to block (in milliseconds)
Returns:
the received message or null if no message was received.
Throws:
JGCSException

jGCS Documentation

Copyright (c) 2006, Universidade de Lisboa
For updates and related information please see jGCS home page