com.jacob.com
Class STA

java.lang.Object
  extended by java.lang.Thread
      extended by com.jacob.com.STA
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
MainSTA

public class STA
extends java.lang.Thread

A class that implements a Single Threaded Apartment. Users will subclass this and override OnInit() and OnQuit() where they will create and destroy a COM component that wants to run in an STA other than the main STA.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 int threadID
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
STA()
           
 
Method Summary
 void doMessagePump()
          run a message pump for the main STA
 boolean OnInit()
          Override this method to create and initialize any COM component that you want to run in this thread.
 void OnQuit()
          Override this method to destroy any resource before the thread exits and COM in uninitialized
 void quit()
           
 void quitMessagePump()
          quit message pump for the main STA
 void run()
           
 
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

threadID

public int threadID
Constructor Detail

STA

public STA()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

OnInit

public boolean OnInit()
Override this method to create and initialize any COM component that you want to run in this thread. If anything fails, return false to terminate the thread.


OnQuit

public void OnQuit()
Override this method to destroy any resource before the thread exits and COM in uninitialized


quit

public void quit()

doMessagePump

public void doMessagePump()
run a message pump for the main STA


quitMessagePump

public void quitMessagePump()
quit message pump for the main STA