public class ExpiringSessionRecycler extends java.lang.Object implements IoSessionRecycler
IoSessionRecycler
with sessions that time out on inactivity.
TODO Document me.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 localAddress,
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)
IoSessionRecycler
IoSession
.put
在接口中 IoSessionRecycler
session
- the new IoSession
.public IoSession recycle(java.net.SocketAddress localAddress, java.net.SocketAddress remoteAddress)
IoSessionRecycler
IoSession
.recycle
在接口中 IoSessionRecycler
localAddress
- the local socket address of the IoSession
the
transport wants to recycle.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)
IoSessionRecycler
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)