Package com.icegreen.greenmail.server
Class AbstractSocketProtocolHandler
java.lang.Object
com.icegreen.greenmail.server.AbstractSocketProtocolHandler
- All Implemented Interfaces:
ProtocolHandler,Runnable
- Direct Known Subclasses:
ImapHandler,Pop3Handler,SmtpHandler
Provides shared helpers for handling a client socket connection.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Resets the handler data to a basic state.protected longGets current socket SO_TIMEOUTbooleanPreparing for closing handler connection?voidsetQuitting(boolean quitting) Signal for closing handler.
-
Field Details
-
log
protected final org.slf4j.Logger log -
socket
The TCP/IP socket over which the IMAP interaction is occurring -
quitting
protected volatile boolean quitting -
closeMonitor
-
-
Constructor Details
-
AbstractSocketProtocolHandler
-
-
Method Details
-
isQuitting
public boolean isQuitting()Preparing for closing handler connection?- Returns:
- true, if should be closed.
-
setQuitting
public void setQuitting(boolean quitting) Signal for closing handler.- Parameters:
quitting- true, if closing in progress.
-
close
public void close()Resets the handler data to a basic state.- Specified by:
closein interfaceProtocolHandler
-
getSoTimeout
protected long getSoTimeout()Gets current socket SO_TIMEOUT- Returns:
- the timeout or -1 if unable to retrieve.
-