org.objectweb.dream.protocol.bus.logicalClock
Class ProtocolImpl.Session

java.lang.Object
  extended by org.objectweb.dream.protocol.bus.logicalClock.ProtocolImpl.Session
All Implemented Interfaces:
BusOutgoingPush, IncomingPush
Enclosing class:
ProtocolImpl

protected class ProtocolImpl.Session
extends Object
implements BusOutgoingPush, IncomingPush


Field Summary
protected  boolean initialized
           
protected  LogicalClock logicalClock
           
protected  BusOutgoingPush lowerBusOutgoingPush
           
protected  IncomingPush upperIncomingPush
           
protected  List<Message> waitingToDeliver
           
 
Constructor Summary
protected ProtocolImpl.Session(IncomingPush upperIncomingPush)
           
 
Method Summary
 int getBusSize()
          Returns the size of the bus.
 int getLocalAddress()
          Returns the address of this protocol instance in the bus.
 void incomingClosed(Object outgoingPush, Exception exception)
          Notifies the session, this interface belong, that the lower session accessible through the given interface has been unexpectedly closed.
 void incomingPush(Message message)
          Gives an incoming message to a protocol.
protected  void initialize(LogicalClock logicalClock, BusOutgoingPush lowerBusOutgoingPush)
           
 void outgoingClose(IncomingPush incomingPush)
          Closes the communication channel.
 void outgoingPush(Message message, int to)
          Gives an outgoing message to a protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

upperIncomingPush

protected IncomingPush upperIncomingPush

initialized

protected boolean initialized

lowerBusOutgoingPush

protected BusOutgoingPush lowerBusOutgoingPush

logicalClock

protected LogicalClock logicalClock

waitingToDeliver

protected List<Message> waitingToDeliver
Constructor Detail

ProtocolImpl.Session

protected ProtocolImpl.Session(IncomingPush upperIncomingPush)
Method Detail

initialize

protected void initialize(LogicalClock logicalClock,
                          BusOutgoingPush lowerBusOutgoingPush)

outgoingPush

public void outgoingPush(Message message,
                         int to)
                  throws PushException
Description copied from interface: BusOutgoingPush
Gives an outgoing message to a protocol.

Specified by:
outgoingPush in interface BusOutgoingPush
Parameters:
message - the message to give to the component.
to - the address in the bus of the receiver of the message.
Throws:
PushException - if an exception occurs.
See Also:
BusOutgoingPush.outgoingPush(Message, int)

outgoingClose

public void outgoingClose(IncomingPush incomingPush)
                   throws IOException
Description copied from interface: BusOutgoingPush
Closes the communication channel. The implementation of this method must not call the IncomingPush.incomingClosed(java.lang.Object, java.lang.Exception) method, since this latter is only used to inform a upper session that a lower session has been closed unexpectedly.

Specified by:
outgoingClose in interface BusOutgoingPush
Parameters:
incomingPush - the interface on which incoming messages of the closed communication channel were received.
Throws:
IOException - the closing process failed.
See Also:
BusOutgoingPush.outgoingClose(IncomingPush)

getLocalAddress

public int getLocalAddress()
Description copied from interface: BusOutgoingPush
Returns the address of this protocol instance in the bus.

Specified by:
getLocalAddress in interface BusOutgoingPush
Returns:
the address of this protocol instance in the bus.
See Also:
BusOutgoingPush.getLocalAddress()

getBusSize

public int getBusSize()
Description copied from interface: BusOutgoingPush
Returns the size of the bus.

Specified by:
getBusSize in interface BusOutgoingPush
Returns:
the size of the bus.
See Also:
BusOutgoingPush.getBusSize()

incomingPush

public void incomingPush(Message message)
                  throws PushException
Description copied from interface: IncomingPush
Gives an incoming message to a protocol.

Specified by:
incomingPush in interface IncomingPush
Parameters:
message - the message to give to the component.
Throws:
PushException - if an exception occurs.
See Also:
IncomingPush.incomingPush(Message)

incomingClosed

public void incomingClosed(Object outgoingPush,
                           Exception exception)
Description copied from interface: IncomingPush
Notifies the session, this interface belong, that the lower session accessible through the given interface has been unexpectedly closed.

Specified by:
incomingClosed in interface IncomingPush
Parameters:
outgoingPush - the interface provided by the closed session.
exception - the exception that forced the session to close. May be null.
See Also:
IncomingPush.incomingClosed(Object, Exception)


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.