com.esri.arcgis.addinframework
Interface IThreadPool

All Superinterfaces:
Serializable
All Known Implementing Classes:
IThreadPoolProxy

public interface IThreadPool
extends Serializable


Method Summary
 IRequest beginExecute(int data)
          Asynchronously executes a user defined worker on any available thread.
 void cancelAll()
          Cancels all pending requests.
 void compact()
          Frees unutilized threads in the pool.
 IWorkerThread createThread()
          Allocates a worker thread for dedicated use outside of the pool.
 void destroy()
          Destroys the thread pool.
 IRequest execute(int data, int timeout)
          Synchronously executes a user defined worker on any available thread.
 void executeForEach(int data, int timeout)
          Executes a request on all workers in the pool, then waits for all to complete.
 void getSize(int[] size)
          Returns the current size of the pool (thread count).
 void waitAll(int timeout)
          Waits for all pending requests to complete (or cancel).
 

Method Detail

execute

IRequest execute(int data,
                 int timeout)
                 throws IOException,
                        AutomationException
Synchronously executes a user defined worker on any available thread. Returns S_FALSE if request times out.

Parameters:
data - The data (A COM typedef) (in)
timeout - The timeout (in)
Returns:
A reference to a com.esri.arcgis.addinframework.IRequest
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

executeForEach

void executeForEach(int data,
                    int timeout)
                    throws IOException,
                           AutomationException
Executes a request on all workers in the pool, then waits for all to complete. Returns S_FALSE if request timesout.

Parameters:
data - The data (A COM typedef) (in)
timeout - The timeout (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

beginExecute

IRequest beginExecute(int data)
                      throws IOException,
                             AutomationException
Asynchronously executes a user defined worker on any available thread.

Parameters:
data - The data (A COM typedef) (in)
Returns:
A reference to a com.esri.arcgis.addinframework.IRequest
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createThread

IWorkerThread createThread()
                           throws IOException,
                                  AutomationException
Allocates a worker thread for dedicated use outside of the pool.

Returns:
A reference to a com.esri.arcgis.addinframework.IWorkerThread
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

waitAll

void waitAll(int timeout)
             throws IOException,
                    AutomationException
Waits for all pending requests to complete (or cancel).

Parameters:
timeout - The timeout (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

cancelAll

void cancelAll()
               throws IOException,
                      AutomationException
Cancels all pending requests.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSize

void getSize(int[] size)
             throws IOException,
                    AutomationException
Returns the current size of the pool (thread count).

Parameters:
size - The size (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

compact

void compact()
             throws IOException,
                    AutomationException
Frees unutilized threads in the pool.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

destroy

void destroy()
             throws IOException,
                    AutomationException
Destroys the thread pool.

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.