|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread org.eigenbase.test.concurrent.ConcurrentTestCommandExecutor
class ConcurrentTestCommandExecutor
ConcurrentTestCommandExecutor is a thread that executes a sequence of
commands
on a JDBC connection.
Nested Class Summary | |
---|---|
static class |
ConcurrentTestCommandExecutor.Sync
Synchronization object that allows multiple ConcurrentTestCommandExecutors to execute commands in lock-step. |
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private Iterator |
commands
Command sequence for this thread. |
private Connection |
connection
JDBC connection for commands. |
private PrintStream |
debugPrintStream
Debugging print stream. |
private Throwable |
error
First exception thrown by the thread. |
private ConcurrentTestCommand |
errorCommand
Command throwing error * |
private Properties |
jdbcProps
JDBC Connection properties. |
private String |
jdbcURL
JDBC URL to connect with. |
private Statement |
statement
Current JDBC Statement. |
private ConcurrentTestCommandExecutor.Sync |
synchronizer
Used to synchronize command execution. |
private Integer |
threadId
The id for this thread. |
private String |
when
Location of error . |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ConcurrentTestCommandExecutor(int threadId,
String threadName,
String jdbcURL,
Properties jdbcProps,
Iterator commands,
ConcurrentTestCommandExecutor.Sync synchronizer,
PrintStream debugPrintStream)
Constructs a ConcurrentTestCommandExecutor with the given thread ID, JDBC URL, commands and synchronization object. |
Method Summary | |
---|---|
void |
clearStatement()
Clears the thread's current JDBC statement. |
Connection |
getConnection()
Obtains the thread's JDBC connection. |
Throwable |
getFailureCause()
Checks whether an exception occurred during execution. |
ConcurrentTestCommand |
getFailureCommand()
|
String |
getFailureLocation()
Returns location (e.g., command number) for exception returned by getFailureCause() . |
Statement |
getStatement()
Obtains the thread's current JDBC statement. |
ConcurrentTestCommandExecutor.Sync |
getSynchronizer()
Retrieves the object used to synchronize threads at a point in the list of commands. |
Integer |
getThreadId()
|
private void |
handleError(Throwable error,
String when,
ConcurrentTestCommand command)
Handles details of an exception during execution. |
void |
run()
Executes the configured commands. |
void |
setStatement(Statement stmt)
Sets the thread's current JDBC statement. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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 Integer threadId
private String jdbcURL
private Properties jdbcProps
private Iterator commands
private ConcurrentTestCommandExecutor.Sync synchronizer
private Connection connection
private Statement statement
private Throwable error
private String when
error
.
private final PrintStream debugPrintStream
private ConcurrentTestCommand errorCommand
Constructor Detail |
---|
ConcurrentTestCommandExecutor(int threadId, String threadName, String jdbcURL, Properties jdbcProps, Iterator commands, ConcurrentTestCommandExecutor.Sync synchronizer, PrintStream debugPrintStream)
threadId
- the thread ID (see ConcurrentTestCommandGenerator
)threadName
- the thread's namejdbcURL
- the JDBC URL to connect tojdbcProps
- JDBC Connnection properties (user, password, etc.)commands
- the sequence of commands to execute -- null elements
indicate no-opssynchronizer
- synchronization object (may not be null);debugPrintStream
- if non-null a PrintStream to use for debugging
output (may help debugging thread synchronization issues)Method Detail |
---|
public void run()
run
in interface Runnable
run
in class Thread
private void handleError(Throwable error, String when, ConcurrentTestCommand command)
public Connection getConnection()
public Statement getStatement()
public void setStatement(Statement stmt)
clearStatement()
.
public void clearStatement()
setStatement(Statement)
.
public ConcurrentTestCommandExecutor.Sync getSynchronizer()
public Throwable getFailureCause()
getFailureLocation()
for details on which command
caused the failure.
public String getFailureLocation()
getFailureCause()
.
public ConcurrentTestCommand getFailureCommand()
public Integer getThreadId()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |