|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.moesol.bindings.platform_sdk.component_services.OleThread
public class OleThread
Creates a COM/OLE Apartment Thread. In the COM/OLE architecture Aparment threads must pump windows messages. OleThread satisfies this requirement. Typical usage is to create a subclass that is a singleton.
public class MyOleThread extends OleThread { private MyOleThread() { super("MyOleThread"); } public static synchronized MyOleThread instance() { if (s_instance == null) { s_instance = new MyOleThread(); s_instance.startAndInit(); } return s_instance; } private static MyOleThread s_instance = null; }You can use invokeLater and invokeAndWait in a similar manner as the EventQueue.
MyOleThread.instance().invokeLater(new Runnable() { public void run() { // code that runs on MyOleThread and in the // MyOleThread apartment. } });
Constructor Summary | |
---|---|
OleThread(String name)
|
Method Summary | |
---|---|
void |
attachCurrent()
|
void |
finalize()
|
static OleThread |
getCurrentOleThread()
|
Thread |
getJavaThread()
|
void |
invokeAndWait(Runnable runable)
|
void |
invokeAndWaitOrRuntimeException(Runnable runnable)
Call invokeAndWait and wrap exceptions in a RuntimeException. |
void |
invokeLater(Runnable runable)
|
static void |
oleInitialize()
|
static void |
oleUninitialize()
|
void |
run()
|
void |
safeInvokeAndWait(Runnable runnable)
Call simpleInvokeAndWait, but wrap any Error thrown in a RuntimeException so that the error will propagate back to the caller. |
void |
simpleInvokeAndWait(Runnable runnable)
Deprecated. Use safeInvokeAndWait instead. |
void |
startAndInit()
|
void |
stopAndDeinit()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OleThread(String name)
Method Detail |
---|
public void finalize()
finalize
in class Object
public Thread getJavaThread()
public static OleThread getCurrentOleThread()
public static void oleInitialize()
public static void oleUninitialize()
public void startAndInit()
public void attachCurrent()
public void stopAndDeinit()
public void run()
run
in interface Runnable
public void invokeLater(Runnable runable)
public void invokeAndWait(Runnable runable) throws InterruptedException, InvocationTargetException
InterruptedException
InvocationTargetException
public void invokeAndWaitOrRuntimeException(Runnable runnable)
runnable
- public void simpleInvokeAndWait(Runnable runnable)
runnable
- public void safeInvokeAndWait(Runnable runnable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |