edu.cuny.cat.comm
Class Session<M extends Message>

java.lang.Object
  extended by edu.cuny.cat.comm.Session<M>
Type Parameters:
M - the type of messages that can be processed in the session.
Direct Known Subclasses:
CatpProactiveSession, CatpReactiveSession

public class Session<M extends Message>
extends java.lang.Object

This class represents a communication session.

Version:
$Revision: 1.3 $
Author:
Jinzhong Niu

Field Summary
protected  int MAX_ATTEMPT
           
 
Constructor Summary
Session(Connection<M> connection)
           
 
Method Summary
 boolean forceOut()
          cleans up if this session has to terminate abnormally.
 void sendMessage(M msg)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_ATTEMPT

protected int MAX_ATTEMPT
Constructor Detail

Session

public Session(Connection<M> connection)
Method Detail

sendMessage

public void sendMessage(M msg)
                 throws CatException
Throws:
CatException

forceOut

public boolean forceOut()
cleans up if this session has to terminate abnormally.

Returns:
if the early termination is successful or not.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object