Package org.apache.mina.common
Class ExpiringSessionRecycler
java.lang.Object
org.apache.mina.common.ExpiringSessionRecycler
- All Implemented Interfaces:
IoSessionRecycler
An
IoSessionRecycler with sessions that time out on inactivity.
TODO Document me.-
Field Summary
Fields inherited from interface org.apache.mina.common.IoSessionRecycler
NOOP -
Constructor Summary
ConstructorsConstructorDescriptionExpiringSessionRecycler(int timeToLive) ExpiringSessionRecycler(int timeToLive, int expirationInterval) -
Method Summary
Modifier and TypeMethodDescriptionintintvoidCalled when the underlying transport creates or writes a newIoSession.recycle(SocketAddress localAddress, SocketAddress remoteAddress) Attempts to retrieve a recycledIoSession.voidCalled when anIoSessionis explicitly closed.voidsetExpirationInterval(int expirationInterval) voidsetTimeToLive(int timeToLive) void
-
Constructor Details
-
ExpiringSessionRecycler
public ExpiringSessionRecycler() -
ExpiringSessionRecycler
public ExpiringSessionRecycler(int timeToLive) -
ExpiringSessionRecycler
public ExpiringSessionRecycler(int timeToLive, int expirationInterval)
-
-
Method Details
-
put
Description copied from interface:IoSessionRecyclerCalled when the underlying transport creates or writes a newIoSession.- Specified by:
putin interfaceIoSessionRecycler- Parameters:
session- the newIoSession.
-
recycle
Description copied from interface:IoSessionRecyclerAttempts to retrieve a recycledIoSession.- Specified by:
recyclein interfaceIoSessionRecycler- Parameters:
localAddress- the local socket address of theIoSessionthe transport wants to recycle.remoteAddress- the remote socket address of theIoSessionthe transport wants to recycle.- Returns:
- a recycled
IoSession, or null if one cannot be found.
-
remove
Description copied from interface:IoSessionRecyclerCalled when anIoSessionis explicitly closed.- Specified by:
removein interfaceIoSessionRecycler- Parameters:
session- the newIoSession.
-
stopExpiring
public void stopExpiring() -
getExpirationInterval
public int getExpirationInterval() -
getTimeToLive
public int getTimeToLive() -
setExpirationInterval
public void setExpirationInterval(int expirationInterval) -
setTimeToLive
public void setTimeToLive(int timeToLive)
-