|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread
The VirtualDatabaseWorkerThread
handles a connection with a
C-JDBC driver.
Field Summary | |
private CommandCompleted |
completed
|
private Controller |
controller
|
private CJDBCInputStream |
in
|
private boolean |
isKilled
true ifthis has been killed. |
private Trace |
logger
Logger instance. |
(package private) boolean |
needSkeleton
Needed for parsing |
private CJDBCOutputStream |
out
|
private java.util.HashMap |
streamedResultSet
|
private static int |
threadID
|
private VirtualDatabaseUser |
user
|
private VirtualDatabase |
vdb
Virtual database instantiating this thread. |
private boolean |
waitForCommand
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
VirtualDatabaseWorkerThread(Controller controller,
VirtualDatabase vdb)
Creates a new VirtualDatabaseWorkerThread instance. |
Method Summary | |
long |
getBytesRead()
get bytes read |
long |
getBytesWritten()
get bytes written |
long |
getReadingSpeed()
get reading speed, WARNING! |
long |
getTimeActive()
get time active |
java.lang.String |
getUser()
|
long |
getWritingSpeed()
get writing speed, WARNING! |
private StoredProcedure |
procedureFromStream(boolean isRead)
Read a StoredProcedure from the stream. |
private SelectRequest |
readRequestFromStream()
Read a SelectRequest from the stream. |
java.lang.String[] |
retrieveClientData()
Retrieve general information on this client |
void |
run()
Gets a connection from the connection queue and process it. |
private boolean |
setRequestParameters(AbstractRequest request,
java.lang.String login,
long tid,
boolean transactionStarted)
Set the login and transaction id on the given request. |
void |
shutdown()
Shutdown this thread by setting isKilled value to true. |
private AbstractWriteRequest |
writeRequestFromStream(boolean withKeys)
Read a write request send by the Connection object. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static int threadID
private boolean isKilled
true
ifthis has been killed.
boolean needSkeleton
private VirtualDatabase vdb
private final CommandCompleted completed
private Trace logger
private CJDBCInputStream in
private CJDBCOutputStream out
private VirtualDatabaseUser user
private Controller controller
private boolean waitForCommand
private java.util.HashMap streamedResultSet
Constructor Detail |
public VirtualDatabaseWorkerThread(Controller controller, VirtualDatabase vdb)
VirtualDatabaseWorkerThread
instance.
controller
- the thread was originated fromvdb
- the virtual database instantiating this thread.Method Detail |
public void shutdown()
isKilled
value to true. This
gives time to check for needed rollback transactions
private boolean setRequestParameters(AbstractRequest request, java.lang.String login, long tid, boolean transactionStarted) throws java.sql.SQLException
request
- The request to setlogin
- user login to settid
- the transaction id to set
java.sql.SQLException
public void run()
private StoredProcedure procedureFromStream(boolean isRead) throws java.io.OptionalDataException, java.io.IOException
isRead
- true if we expect a read stored procedure
StoredProcedure
object.
java.io.OptionalDataException
- if an error occurs
java.io.IOException
- if an error occursprivate AbstractWriteRequest writeRequestFromStream(boolean withKeys) throws java.io.OptionalDataException, java.io.IOException
Connection
object. Only the
needed parameters are sent, so we can reconstruct the object on the
controller side, without serializing everything.
withKeys
- true if we expect a write to return keus (as a ResultSet)
AbstractWriteRequest
java.io.OptionalDataException
java.io.IOException
private SelectRequest readRequestFromStream() throws java.io.OptionalDataException, java.io.IOException
SelectRequest
object.
java.io.OptionalDataException
- if an error occurs
java.io.IOException
- if an error occurspublic java.lang.String[] retrieveClientData()
public long getBytesRead()
public long getBytesWritten()
public long getTimeActive()
public long getReadingSpeed()
public long getWritingSpeed()
public java.lang.String getUser()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |