java.lang.Object
i2p.susi.webmail.pop3.IdleCloser
Close the POP3 connection after a certain idle time.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classChecks the mailbox for idleness.private classCloses the idle mailbox connection.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LogThe log for the closer.private static final intDefault idle time before closing, less than the five minute timeout of the postman pop3 server.private booleanTrue while the close thread runs.private booleanTrue once the closer is shut down.private final POP3MailBoxThe mailbox watched for idleness.private static final intSmallest configured idle time.private final SimpleTimer2.TimedEventThe timer running the idle checks.Constructor Summary
ConstructorsConstructorDescriptionIdleCloser(POP3MailBox mailbox) Creates a new idle closer for the given mailbox.Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels the idle closer.private static longThe configured idle time.
Field Details
mailbox
The mailbox watched for idleness.timer
The timer running the idle checks._log
The log for the closer.isClosing
private volatile boolean isClosingTrue while the close thread runs.isDead
private volatile boolean isDeadTrue once the closer is shut down.DEFAULT_IDLE_SECONDS
private static final int DEFAULT_IDLE_SECONDSDefault idle time before closing, less than the five minute timeout of the postman pop3 server.- See Also:
MIN_IDLE_CONFIG
private static final int MIN_IDLE_CONFIGSmallest configured idle time.- See Also:
Constructor Details
IdleCloser
Creates a new idle closer for the given mailbox.- Parameters:
mailbox- the POP3 mailbox to monitor
Method Details
cancel
public void cancel()Cancels the idle closer.getMaxIdle
private static long getMaxIdle()The configured idle time.- Returns:
- the idle time in milliseconds