| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cindy.session.AbstractSession
public abstract class AbstractSession
Abstract session.
| Constructor Summary | |
|---|---|
AbstractSession()
 | 
|
| Method Summary | |
|---|---|
 void | 
addSessionFilter(int index,
                 SessionFilter filter)
Add session filter.  | 
 void | 
addSessionFilter(SessionFilter filter)
Add session filter.  | 
 boolean | 
containsAttribute(java.lang.Object key)
Returns true if the session contains an attribute for the specified key.  | 
protected  void | 
dispatchException(java.lang.Throwable throwable)
 | 
 Future | 
flush(Packet packet)
Send packet with normal priority.  | 
 Future | 
flush(Packet packet,
      int priority)
Send packet with specified priority.  | 
 java.lang.Object | 
getAttribute(java.lang.Object key)
Get the session attribute mapped with the specified key.  | 
 java.util.Map | 
getAttributes()
Get all session attributs.  | 
 java.net.SocketAddress | 
getLocalAddress()
Get the local address which the session bind with.  | 
 PacketDecoder | 
getPacketDecoder()
Get packet decoder.  | 
 PacketEncoder | 
getPacketEncoder()
Get packet encoder.  | 
 int | 
getReadPacketSize()
 | 
 java.net.SocketAddress | 
getRemoteAddress()
Get the remote address which the session connmected to.  | 
 SessionFilter | 
getSessionFilter(int index)
Get session filter.  | 
 SessionFilterChain | 
getSessionFilterChain(boolean reversed)
Get session filter chain.  | 
protected  SessionFilterChain | 
getSessionFilterChain(SessionFilter operateFilter,
                      boolean reversed)
 | 
 SessionFilter[] | 
getSessionFilters()
Get all session filters.  | 
 SessionHandler | 
getSessionHandler()
Get session handler.  | 
 int | 
getSessionTimeout()
Get session timeout, in millisecond.  | 
 void | 
removeAttribute(java.lang.Object key)
Removes the attribute for this key if it is present.  | 
 void | 
removeSessionFilter(SessionFilter filter)
Remove session filter.  | 
 Future | 
send(java.lang.Object obj)
Send object with normal priority.  | 
 Future | 
send(java.lang.Object obj,
     int priority)
Send object with specified priority.  | 
protected abstract  Future | 
send(java.lang.Object obj,
     Packet packet,
     int priority)
 | 
 void | 
setAttribute(java.lang.Object key,
             java.lang.Object attribute)
Set session attribute.  | 
 void | 
setLocalAddress(java.net.SocketAddress address)
Set the local address which the session bind with.  | 
 void | 
setPacketDecoder(PacketDecoder decoder)
Set packet decoder.  | 
 void | 
setPacketEncoder(PacketEncoder encoder)
Set packet encoder.  | 
 void | 
setReadPacketSize(int size)
 | 
 void | 
setRemoteAddress(java.net.SocketAddress address)
Set the remote address which the session will connected to.  | 
 void | 
setSessionHandler(SessionHandler handler)
Set session handler.  | 
 void | 
setSessionTimeout(int timeout)
Set session timeout, in millisecond.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface net.sf.cindy.Session | 
|---|
close, getSessionType, isStarted, start | 
| Constructor Detail | 
|---|
public AbstractSession()
| Method Detail | 
|---|
public void setRemoteAddress(java.net.SocketAddress address)
Session
setRemoteAddress in interface Sessionaddress - the remote addresspublic java.net.SocketAddress getRemoteAddress()
Session
getRemoteAddress in interface Sessionpublic void setLocalAddress(java.net.SocketAddress address)
Session
setLocalAddress in interface Sessionaddress - the local addresspublic java.net.SocketAddress getLocalAddress()
Session
getLocalAddress in interface Sessionpublic PacketDecoder getPacketDecoder()
Session
getPacketDecoder in interface Sessionpublic PacketEncoder getPacketEncoder()
Session
getPacketEncoder in interface Sessionpublic void setPacketDecoder(PacketDecoder decoder)
Session
setPacketDecoder in interface Sessiondecoder - packet decoderpublic void setPacketEncoder(PacketEncoder encoder)
Session
setPacketEncoder in interface Sessionencoder - packet encoderpublic int getReadPacketSize()
public void setReadPacketSize(int size)
public java.util.Map getAttributes()
Session
getAttributes in interface Sessionpublic java.lang.Object getAttribute(java.lang.Object key)
Session
getAttribute in interface Sessionkey - key
public boolean containsAttribute(java.lang.Object key)
Session
containsAttribute in interface Sessionkey - key
public void setAttribute(java.lang.Object key,
                         java.lang.Object attribute)
Session
setAttribute in interface Sessionkey - keyattribute - attributepublic void removeAttribute(java.lang.Object key)
Session
removeAttribute in interface Sessionkey - keypublic int getSessionTimeout()
Session
getSessionTimeout in interface Sessionpublic void setSessionTimeout(int timeout)
Session
setSessionTimeout in interface Sessiontimeout - session timeoutpublic void setSessionHandler(SessionHandler handler)
Session
setSessionHandler in interface Sessionhandler - session handlerpublic SessionHandler getSessionHandler()
Session
getSessionHandler in interface Sessionpublic void addSessionFilter(SessionFilter filter)
Session
addSessionFilter in interface Sessionfilter - session filter
public void addSessionFilter(int index,
                             SessionFilter filter)
Session
addSessionFilter in interface Sessionindex - indexfilter - session filterpublic void removeSessionFilter(SessionFilter filter)
Session
removeSessionFilter in interface Sessionfilter - session filterpublic SessionFilter getSessionFilter(int index)
Session
getSessionFilter in interface Sessionindex - index
public SessionFilter[] getSessionFilters()
Session
getSessionFilters in interface Sessionpublic Future flush(Packet packet)
Session
flush in interface Sessionpacket - send packet
public Future flush(Packet packet,
                    int priority)
Session
flush in interface Sessionpacket - send packetpriority - send priority
public Future send(java.lang.Object obj)
SessionPacket use associated PacketEncoder. This
 method is a shorthand for send(obj, 0).
send in interface Sessionobj - send object
public Future send(java.lang.Object obj,
                   int priority)
SessionPacket use
 associated PacketEncoder.
send in interface Sessionobj - send objectpriority - send priority
protected abstract Future send(java.lang.Object obj,
                               Packet packet,
                               int priority)
public SessionFilterChain getSessionFilterChain(boolean reversed)
Session
getSessionFilterChain in interface Sessionreversed - some events like xxxSend/xxxSent need to be dispatched in
            reversed order
protected SessionFilterChain getSessionFilterChain(SessionFilter operateFilter,
                                                   boolean reversed)
protected void dispatchException(java.lang.Throwable throwable)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||