com.ptc.windchill.upgrade.modeldiff
Class AddConstraints.RunSQLPlus

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.ptc.windchill.upgrade.modeldiff.AddConstraints.RunSQLPlus
All Implemented Interfaces:
Runnable
Enclosing class:
AddConstraints

private class AddConstraints.RunSQLPlus
extends Thread

Run the SQLPlus on a separate thread so that if there is an error, and execution hangs, a 'join(milliseconds)' will timeout. Hanging means that an unexpected return confused our code's test of expected responses and the automated control was given to a hidden, manual, unreachable prompt and is now waiting for "the next command".


Field Summary
private  String commandString_
           
private  AddConstraints.ExecutionException executionException_
           
private  long inactivityTimeout2_
           
private  long overallTimeout2_
           
private  PrintStream printStream_
           
private  String processOutput_
           
private  int returnCode_
           
private  boolean sqlHangError_
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) AddConstraints.RunSQLPlus(String command_string, long inactivity_timeout, long overall_timeout, PrintStream print_stream)
          Sets all arguments to run a timed the SQLPlus session.
 
Method Summary
 AddConstraints.ExecutionException getExecutionException()
          Accessor for the executionException that was created.
 String getProcessOutput()
          The output that a the SQLPlus session would output to the console, if you performed this execution manually.
 int getReturnCode()
          Indicates success, or the type of failure.
 boolean getTestForSQLHangError()
          Used to ask: "Did the login fail, and return control to a VIRTUAL user"?
 void run()
          Runs when the caller issues a &060;Thread&062;.start().
 
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

commandString_

private String commandString_

inactivityTimeout2_

private long inactivityTimeout2_

overallTimeout2_

private long overallTimeout2_

printStream_

private PrintStream printStream_

executionException_

private AddConstraints.ExecutionException executionException_

sqlHangError_

private boolean sqlHangError_

returnCode_

private int returnCode_

processOutput_

private String processOutput_
Constructor Detail

AddConstraints.RunSQLPlus

AddConstraints.RunSQLPlus(String command_string,
                          long inactivity_timeout,
                          long overall_timeout,
                          PrintStream print_stream)
Sets all arguments to run a timed the SQLPlus session.

Parameters:
command_string - Approximately: "sqlplus user/password&064;system commandString".
inactivity_timeout - The max milliseconds between process additions to the output (=0 means no max).
overall_timeout - The max milliseconds for all process output (= 0 means no max).
print_stream - Used to start reading large outputs, even before execution has completed.
Method Detail

run

public void run()
Runs when the caller issues a &060;Thread&062;.start().


getExecutionException

public AddConstraints.ExecutionException getExecutionException()
Accessor for the executionException that was created.

Returns:
ExecutionException This will be null if no error occurred.

getReturnCode

public int getReturnCode()
Indicates success, or the type of failure.

Returns:
The returnCode from executing the SQL.

getProcessOutput

public String getProcessOutput()
The output that a the SQLPlus session would output to the console, if you performed this execution manually.

Returns:
The opening and closing an SQLPlus session, bounding the output from executing SQL command(s).

getTestForSQLHangError

public boolean getTestForSQLHangError()
Used to ask: "Did the login fail, and return control to a VIRTUAL user"?

Returns:
A true if there was a failure in the other thread.