edu.cuny.cat.comm
Class Session<M extends Message>
java.lang.Object
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
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 |
MAX_ATTEMPT
protected int MAX_ATTEMPT
Session
public Session(Connection<M> connection)
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