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 TypeMethodDescriptionint
int
void
Called when the underlying transport creates or writes a newIoSession
.recycle
(SocketAddress localAddress, SocketAddress remoteAddress) Attempts to retrieve a recycledIoSession
.void
Called when anIoSession
is explicitly closed.void
setExpirationInterval
(int expirationInterval) void
setTimeToLive
(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:IoSessionRecycler
Called when the underlying transport creates or writes a newIoSession
.- Specified by:
put
in interfaceIoSessionRecycler
- Parameters:
session
- the newIoSession
.
-
recycle
Description copied from interface:IoSessionRecycler
Attempts to retrieve a recycledIoSession
.- Specified by:
recycle
in interfaceIoSessionRecycler
- Parameters:
localAddress
- the local socket address of theIoSession
the transport wants to recycle.remoteAddress
- the remote socket address of theIoSession
the transport wants to recycle.- Returns:
- a recycled
IoSession
, or null if one cannot be found.
-
remove
Description copied from interface:IoSessionRecycler
Called when anIoSession
is explicitly closed.- Specified by:
remove
in 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)
-