Package org.h2.server
Class TcpServerThread
- java.lang.Object
-
- org.h2.server.TcpServerThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class TcpServerThread extends java.lang.Object implements java.lang.Runnable
One server thread is opened per client connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TcpServerThread.CachedInputStream
An input stream with a position.
-
Field Summary
Fields Modifier and Type Field Description private SmallMap
cache
private int
clientVersion
private Command
commit
private long
lastRemoteSettingsId
private SmallLRUCache<java.lang.Long,TcpServerThread.CachedInputStream>
lobs
private TcpServer
server
private SessionLocal
session
private java.lang.String
sessionId
private boolean
stop
private java.lang.Thread
thread
private int
threadId
protected Transfer
transfer
-
Constructor Summary
Constructors Constructor Description TcpServerThread(java.net.Socket socket, TcpServer server, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
cancelStatement(java.lang.String targetSessionId, int statementId)
Cancel a running statement.(package private) void
close()
Close a connection.private void
closeSession()
private int
getState(int oldModificationId)
(package private) java.lang.Thread
getThread()
private void
process()
void
run()
private void
sendError(java.lang.Throwable t, boolean withStatus)
private void
sendRows(ResultInterface result, long count)
private void
setParameters(Command command)
(package private) void
setThread(java.lang.Thread thread)
private void
trace(java.lang.String s)
-
-
-
Field Detail
-
transfer
protected final Transfer transfer
-
server
private final TcpServer server
-
session
private SessionLocal session
-
stop
private boolean stop
-
thread
private java.lang.Thread thread
-
commit
private Command commit
-
cache
private final SmallMap cache
-
lobs
private final SmallLRUCache<java.lang.Long,TcpServerThread.CachedInputStream> lobs
-
threadId
private final int threadId
-
clientVersion
private int clientVersion
-
sessionId
private java.lang.String sessionId
-
lastRemoteSettingsId
private long lastRemoteSettingsId
-
-
Constructor Detail
-
TcpServerThread
TcpServerThread(java.net.Socket socket, TcpServer server, int id)
-
-
Method Detail
-
trace
private void trace(java.lang.String s)
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
closeSession
private void closeSession()
-
close
void close()
Close a connection.
-
sendError
private void sendError(java.lang.Throwable t, boolean withStatus)
-
setParameters
private void setParameters(Command command) throws java.io.IOException
- Throws:
java.io.IOException
-
process
private void process() throws java.io.IOException
- Throws:
java.io.IOException
-
getState
private int getState(int oldModificationId)
-
sendRows
private void sendRows(ResultInterface result, long count) throws java.io.IOException
- Throws:
java.io.IOException
-
setThread
void setThread(java.lang.Thread thread)
-
getThread
java.lang.Thread getThread()
-
cancelStatement
void cancelStatement(java.lang.String targetSessionId, int statementId)
Cancel a running statement.- Parameters:
targetSessionId
- the session idstatementId
- the statement to cancel
-
-