com.jacob.com
Class STA

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

public class STA
extends 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
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 int threadID
          referenced by STA.cpp
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
STA()
          constructor for 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()
          calls quitMessagePump
 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
referenced by STA.cpp

Constructor Detail

STA

public STA()
constructor for STA

Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class 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.

Returns:
always returns true

OnQuit

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


quit

public void quit()
calls quitMessagePump


doMessagePump

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


quitMessagePump

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



http://jacob-project.sourceforge.net