Package com.sshtools.common.nio
Class IdleStateManager
java.lang.Object
com.sshtools.common.nio.IdleStateManager
Class that checks the idle state of another class.
- Author:
- Lee David Painter
-
Constructor Summary
ConstructorsConstructorDescriptionIdleStateManager(int servicePeriodSeconds, int numInactiveServicesPeriodsPerIdle) -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReady()Called by a selector to determine when the service run is ready to be executed.voidvoidremove(IdleStateListener obj) Called by a listener when they want to remove themselvesvoidreset(IdleStateListener obj) Called by a listener when they want their idle state to be reset.voidservice()Called by a thread which is managing idle states
-
Constructor Details
-
IdleStateManager
public IdleStateManager(int servicePeriodSeconds, int numInactiveServicesPeriodsPerIdle)
-
-
Method Details
-
reset
Called by a listener when they want their idle state to be reset.- Parameters:
obj- IdleStateListener
-
register
-
remove
Called by a listener when they want to remove themselves- Parameters:
obj- IdleStateListener
-
isReady
public boolean isReady()Called by a selector to determine when the service run is ready to be executed.- Returns:
- boolean
-
service
public void service()Called by a thread which is managing idle states
-