org.objectweb.dream.protocol.bus
Class BusProtocolImpl.Session

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

protected class BusProtocolImpl.Session
extends Object
implements BusOutgoingPush, IncomingPush


Field Summary
protected  boolean closed
           
protected  BusExportIdentifier id
           
protected  ExportIdentifier[] lowerIds
           
protected  MessagePassingOutgoingPush lowerOutgoingPush
           
protected  int myAddress
           
protected  IncomingPush upperIncomingPush
           
 
Constructor Summary
protected BusProtocolImpl.Session(BusExportIdentifier id, int myAddress, 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.
 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

myAddress

protected int myAddress

id

protected BusExportIdentifier id

lowerIds

protected ExportIdentifier[] lowerIds

closed

protected boolean closed

lowerOutgoingPush

protected MessagePassingOutgoingPush lowerOutgoingPush

upperIncomingPush

protected IncomingPush upperIncomingPush
Constructor Detail

BusProtocolImpl.Session

protected BusProtocolImpl.Session(BusExportIdentifier id,
                                  int myAddress,
                                  IncomingPush upperIncomingPush)
Method Detail

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.