public class ExpiringSessionRecycler extends Object implements IoSessionRecycler
IoSessionRecycler with sessions that time out on inactivity.NOOP| Constructor and Description |
|---|
ExpiringSessionRecycler()
Create a new ExpiringSessionRecycler instance
|
ExpiringSessionRecycler(int timeToLive)
Create a new ExpiringSessionRecycler instance
|
ExpiringSessionRecycler(int timeToLive,
int expirationInterval)
Create a new ExpiringSessionRecycler instance
|
| Modifier and Type | Method and Description |
|---|---|
int |
getExpirationInterval() |
int |
getTimeToLive() |
void |
put(IoSession session)
Called when the underlying transport creates or writes a new
IoSession. |
IoSession |
recycle(SocketAddress remoteAddress,
int port)
Attempts to retrieve a recycled
IoSession. |
void |
remove(IoSession session)
Called when an
IoSession is explicitly closed. |
void |
setExpirationInterval(int expirationInterval)
Set the interval in which a session will live in the map before it is removed.
|
void |
setTimeToLive(int timeToLive)
Update the value for the time-to-live
|
void |
stopExpiring()
Stop the thread from monitoring the map
|
public ExpiringSessionRecycler()
public ExpiringSessionRecycler(int timeToLive)
timeToLive - The delay after which the session is going to be recycledpublic ExpiringSessionRecycler(int timeToLive,
int expirationInterval)
timeToLive - The delay after which the session is going to be recycledexpirationInterval - The delay after which the expiration occurspublic void put(IoSession session)
IoSession.put in interface IoSessionRecyclersession - the new IoSession.public IoSession recycle(SocketAddress remoteAddress, int port)
IoSession.recycle in interface IoSessionRecyclerremoteAddress - the remote socket address of the IoSession the transport wants to recycle.port - The port the Accpetor is listening onIoSession, or null if one cannot be found.public void remove(IoSession session)
IoSession is explicitly closed.remove in interface IoSessionRecyclersession - the new IoSession.public void stopExpiring()
public int getExpirationInterval()
public int getTimeToLive()
public void setExpirationInterval(int expirationInterval)
expirationInterval - The session expiration time in secondspublic void setTimeToLive(int timeToLive)
timeToLive - The time-to-live (seconds)Copyright © 2004–2024 Apache MINA Project. All rights reserved.