Package com.aoindustries.aoserv.master
Class SocketServerThread
java.lang.Object
java.lang.Thread
com.aoindustries.aoserv.master.SocketServerThread
- All Implemented Interfaces:
RequestSource
,Runnable
The
AOServServerThread
handles a connection once it is accepted.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionSocketServerThread
(TcpServer server, Socket socket) Creates a new, runningAOServServerThread
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cachesInvalidated
(IntList tableList) Invalidates the listed tables.int
Gets the id of the server that this connection is created from.Gets the protocol version number supported by the client.Logs a security message toSystem.err
.boolean
isClosed()
boolean
isSecure()
Determines if the communication with the client is currently secure.void
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
-
SocketServerThread
Creates a new, runningAOServServerThread
.- Throws:
IOException
SQLException
-
-
Method Details
-
cachesInvalidated
Invalidates the listed tables. Also, if this connector represents a daemon, this invalidate is registered with ServerHandler for invalidation synchronization.IDEA: Could reduce signals under high load by combining entries that are not synchronous. Could even combine synchronous ones as long as all sync entries were acknowledged in the proper order.
- Specified by:
cachesInvalidated
in interfaceRequestSource
- Throws:
IOException
-
getDaemonServer
public int getDaemonServer()Description copied from interface:RequestSource
Gets the id of the server that this connection is created from. This is only used by connections initiated by daemons.- Specified by:
getDaemonServer
in interfaceRequestSource
- Returns:
- the id of the server or
-1
for none
-
getNextInvalidatedTables
- Specified by:
getNextInvalidatedTables
in interfaceRequestSource
-
getConnectorId
- Specified by:
getConnectorId
in interfaceRequestSource
-
getProtocolVersion
Description copied from interface:RequestSource
Gets the protocol version number supported by the client.- Specified by:
getProtocolVersion
in interfaceRequestSource
-
getSecurityMessageHeader
Logs a security message toSystem.err
. Also sends email messages toaoserv.server
.- Specified by:
getSecurityMessageHeader
in interfaceRequestSource
-
getCurrentAdministrator
- Specified by:
getCurrentAdministrator
in interfaceRequestSource
-
isSecure
Description copied from interface:RequestSource
Determines if the communication with the client is currently secure.- Specified by:
isSecure
in interfaceRequestSource
- Throws:
UnknownHostException
-
run
public void run() -
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceRequestSource
-