Package com.sun.jna.platform.win32.COM.util

# Class ComThread

java.lang.Object
com.sun.jna.platform.win32.COM.util.ComThread

public class ComThread extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`(package private) ExecutorService`
`executor`
`(package private) Runnable`
`firstTask`
`(package private) boolean`
`requiresInitialisation`
`(package private) long`
`timeoutMilliseconds`
`(package private) Thread.UncaughtExceptionHandler`
`uncaughtExceptionHandler`

## Constructor Summary

Constructors
Constructor
Description
`ComThread(String threadName, long timeoutMilliseconds, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)`
`ComThread(String threadName, long timeoutMilliseconds, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, int coinitialiseExFlag)`

## Method Summary

Modifier and Type
Method
Description
`<T> T`
`execute(Callable<T> task)`
`protected void`
`finalize()`
`(package private) static void`
`setComThread(boolean value)`
`void`
`terminate(long timeoutMilliseconds)`
Stop the COM Thread.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### executor

ExecutorService executor

### firstTask

Runnable firstTask

### requiresInitialisation

boolean requiresInitialisation

### timeoutMilliseconds

long timeoutMilliseconds

### uncaughtExceptionHandler

Thread.UncaughtExceptionHandler uncaughtExceptionHandler

## Constructor Details

### ComThread

public ComThread(String threadName, long timeoutMilliseconds, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)

### ComThread

public ComThread(String threadName, long timeoutMilliseconds, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, int coinitialiseExFlag)

## Method Details

### terminate

public void terminate(long timeoutMilliseconds)
Stop the COM Thread.

Parameters:
  `timeoutMilliseconds` - number of milliseconds to wait for a clean shutdown before a forced shutdown is attempted

### finalize

protected void finalize() throws Throwable

Overrides:
  `finalize` in class `Object`
Throws:
  `Throwable`

### setComThread

static void setComThread(boolean value)

### execute

public <T> T execute(Callable<T> task) throws TimeoutException, InterruptedException, ExecutionException

Throws:
  `TimeoutException`
  `InterruptedException`
  `ExecutionException`