public class ExpiringSessionRecycler extends java.lang.Object implements IoSessionRecycler
IoSessionRecycler
with sessions that time out on inactivity.NOOP
构造器和说明 |
---|
ExpiringSessionRecycler() |
ExpiringSessionRecycler(int timeToLive) |
ExpiringSessionRecycler(int timeToLive,
int expirationInterval) |
限定符和类型 | 方法和说明 |
---|---|
int |
getExpirationInterval() |
int |
getTimeToLive() |
void |
put(IoSession session)
Called when the underlying transport creates or writes a new
IoSession . |
IoSession |
recycle(java.net.SocketAddress remoteAddress)
Attempts to retrieve a recycled
IoSession . |
void |
remove(IoSession session)
Called when an
IoSession is explicitly closed. |
void |
setExpirationInterval(int expirationInterval) |
void |
setTimeToLive(int timeToLive) |
void |
stopExpiring() |
public ExpiringSessionRecycler()
public ExpiringSessionRecycler(int timeToLive)
public ExpiringSessionRecycler(int timeToLive, int expirationInterval)
public void put(IoSession session)
IoSession
.put
在接口中 IoSessionRecycler
session
- the new IoSession
.public IoSession recycle(java.net.SocketAddress remoteAddress)
IoSession
.recycle
在接口中 IoSessionRecycler
remoteAddress
- the remote socket address of the IoSession
the transport wants to recycle.IoSession
, or null if one cannot be found.public void remove(IoSession session)
IoSession
is explicitly closed.remove
在接口中 IoSessionRecycler
session
- the new IoSession
.public void stopExpiring()
public int getExpirationInterval()
public int getTimeToLive()
public void setExpirationInterval(int expirationInterval)
public void setTimeToLive(int timeToLive)