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
public abstract class AbstractSocketProtocolHandler extends Object implements ProtocolHandler
Provides shared helpers for handling a client socket connection.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractSocketProtocolHandler(Socket socket)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Resets the handler data to a basic state.protected longgetSoTimeout()Gets current socket SO_TIMEOUTbooleanisQuitting()Preparing for closing handler connection?voidsetQuitting(boolean quitting)Signal for closing handler.
-
-
-
Constructor Detail
-
AbstractSocketProtocolHandler
protected AbstractSocketProtocolHandler(Socket socket)
-
-
Method Detail
-
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.
-
-