Package de.stefanreiser.net.server
Class DefaultWorker
java.lang.Object
java.lang.Thread
de.stefanreiser.net.server.AbstractWorker
de.stefanreiser.net.server.DefaultWorker
- All Implemented Interfaces:
java.lang.Runnable
public class DefaultWorker extends AbstractWorker
- Author:
- Stefan
-
Nested Class Summary
Nested classes/interfaces inherited from class de.stefanreiser.net.server.AbstractWorker
AbstractWorker.Message
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultWorker(java.net.Socket socket, Loggable logger)
-
Method Summary
Modifier and Type Method Description int
maxLineLength()
Accept lines from client up to maxLineLength() characters.protected void
onThreadHasEnded()
Called when Thread.run() ends.protected void
session()
java.lang.String
welcomeMessage()
Methods inherited from class de.stefanreiser.net.server.AbstractWorker
cancel, flush, isCanceled, isLineAvailable, read, run, send, sendln
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
Method Details
-
session
- Specified by:
session
in classAbstractWorker
- Throws:
ServerException
-
welcomeMessage
public java.lang.String welcomeMessage()- Specified by:
welcomeMessage
in classAbstractWorker
-
maxLineLength
public int maxLineLength()Description copied from class:AbstractWorker
Accept lines from client up to maxLineLength() characters.- Specified by:
maxLineLength
in classAbstractWorker
- Returns:
-
onThreadHasEnded
protected void onThreadHasEnded()Description copied from class:AbstractWorker
Called when Thread.run() ends. Can be used to clean up resources.- Specified by:
onThreadHasEnded
in classAbstractWorker
-