public abstract class AbstractServer extends Thread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected boolean |
nosslFlag |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractServer(String name,
int port,
int defaultPort)
Create a ServerSocket to listen for connections.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind()
Bind server socket on defined port.
|
void |
close()
Close server socket
|
abstract AbstractConnection |
createConnectionHandler(Socket clientSocket)
Create a connection handler for the current listener.
|
protected KeyManager[] |
getKeyManagers()
Build key managers from keystore file.
|
int |
getPort()
Server socket TCP port
|
abstract String |
getProtocolName()
Get server protocol name (SMTP, POP, IMAP, ...).
|
protected TrustManager[] |
getTrustManagers()
Build trust managers from truststore file.
|
void |
run()
The body of the server thread.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected AbstractServer(String name, int port, int defaultPort)
name - thread nameport - tcp socket chosen portdefaultPort - tcp socket default portpublic abstract String getProtocolName()
public int getPort()
public void bind()
throws DavMailException
DavMailException - unable to create server socketprotected TrustManager[] getTrustManagers() throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException
CertificateException - on errorNoSuchAlgorithmException - on errorIOException - on errorKeyStoreException - on errorprotected KeyManager[] getKeyManagers() throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException, UnrecoverableKeyException
CertificateException - on errorNoSuchAlgorithmException - on errorIOException - on errorKeyStoreException - on errorUnrecoverableKeyExceptionpublic void run()
public abstract AbstractConnection createConnectionHandler(Socket clientSocket)
clientSocket - client socketpublic void close()
Copyright © 2001–2025 MickaĆ«l Guessant. All rights reserved.