Package com.example.server.app
Class BaseServerListener
java.lang.Object
java.lang.Thread
com.example.common.listener.BaseListener
com.example.server.app.BaseServerListener
Derived class representing a listener for a server application.
Implements the Listener interface and extends the BaseListener class.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class com.example.common.listener.BaseListener
streamIO, transportListener
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorsConstructorDescriptionBaseServerListener
(int portIn, StreamIO streamIO, TransportFactory transportFactory, MessageQueue<TransportConnection> requestQueue) Constructor for BaseServerListener. -
Method Summary
Methods inherited from class com.example.common.listener.BaseListener
run
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
-
BaseServerListener
public BaseServerListener(int portIn, StreamIO streamIO, TransportFactory transportFactory, MessageQueue<TransportConnection> requestQueue) Constructor for BaseServerListener.- Parameters:
portIn
- The port number on which the listener will accept connections.streamIO
- The StreamIO object for input/output operations.transportFactory
- The TransportFactory for creating TransportConnections.requestQueue
- The queue for storing incoming TransportConnections.
-
-
Method Details
-
worker
Worker method for the listener. Accepts incoming connections and adds them to the request queue for processing.- Specified by:
worker
in classBaseListener
- Throws:
IOException
- if an I/O error occurs during connection acceptance.
-