Class ThreadPoolManager
java.lang.Object
com.sun.star.lib.uno.environments.remote.ThreadPoolManager
Manages the UNO thread pool factory.
The thread pool factory is a process-wide resource. It is important that all UNO environments within a process share the same thread pool mechanisms: if a synchronous UNO call is bridged out from one local UNO environment over one remote bridge, and recursively calls back into another local UNO environment over another remote bridge, the code in the second environment should be executed in the thread that did the original call from the first environment.
There are both a Java and a native thread pool factory. A pure Java
process will always use the Java thread pool factory. A mixed process uses
the system property org.openoffice.native
(to be set by the
native code that starts the JVM) to determine which implementation
to use.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IThreadPool
create()
Creates a thread pool instance.static boolean
Leads to using the native thread pool factory, unless a Java thread pool has already been created.
-
Method Details
-
create
Creates a thread pool instance.- Returns:
- a new thread pool instance; will never be
null
.
-
useNative
public static boolean useNative()Leads to using the native thread pool factory, unless a Java thread pool has already been created.- Returns:
false
if a Java thread pool has already been created.
-