Package com.mckoi.database.jdbcserver
Class MultiThreadedConnectionPoolServer.ClientThread
- java.lang.Object
-
- java.lang.Thread
-
- com.mckoi.database.jdbcserver.MultiThreadedConnectionPoolServer.ClientThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- MultiThreadedConnectionPoolServer
private class MultiThreadedConnectionPoolServer.ClientThread extends java.lang.Thread
This thread blocks waiting for a complete command to arrive from the client it is connected to.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
client_closed
If this is set to true, the thread run method should close off.private boolean
processing_command
This is set to true if we are processing a request from the client.private ServerConnection
server_connection
The ServerConnection object being serviced by this thread.
-
Constructor Summary
Constructors Constructor Description ClientThread(ServerConnection connection)
The Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkCurrentConnection()
Checks each connection in the 'service_connection_list' list.void
close()
Call this method to stop the thread.void
run()
The Runnable method of the farmer thread.-
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
-
-
-
-
Field Detail
-
server_connection
private ServerConnection server_connection
The ServerConnection object being serviced by this thread.
-
client_closed
private boolean client_closed
If this is set to true, the thread run method should close off.
-
processing_command
private boolean processing_command
This is set to true if we are processing a request from the client.
-
-
Constructor Detail
-
ClientThread
public ClientThread(ServerConnection connection)
The Constructor.
-
-
Method Detail
-
checkCurrentConnection
private void checkCurrentConnection() throws java.lang.InterruptedException
Checks each connection in the 'service_connection_list' list. If there is a command pending, and any previous commands on this connection have completed, then this will spawn off a new process to deal with the command.- Throws:
java.lang.InterruptedException
-
close
public void close()
Call this method to stop the thread.
-
run
public void run()
The Runnable method of the farmer thread.- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
-