com.esri.arcgis.addinframework
Class IThreadPoolProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.addinframework.IThreadPoolProxy
All Implemented Interfaces:
IThreadPool, Externalizable, Serializable

public class IThreadPoolProxy
extends com.esri.arcgis.interop.Dispatch
implements IThreadPool, Serializable

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IThreadPoolProxy()
           
  IThreadPoolProxy(Object obj)
           
protected IThreadPoolProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 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 removeListener(String iidStr, Object theListener)
           
 void waitAll(int timeout)
          Waits for all pending requests to complete (or cancel).
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IThreadPoolProxy

public IThreadPoolProxy()

IThreadPoolProxy

public IThreadPoolProxy(Object obj)
                 throws IOException
Throws:
IOException

IThreadPoolProxy

protected IThreadPoolProxy(Object obj,
                           String iid)
                    throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

execute

public 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.

Specified by:
execute in interface IThreadPool
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

public 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.

Specified by:
executeForEach in interface IThreadPool
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

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

Specified by:
beginExecute in interface IThreadPool
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

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

Specified by:
createThread in interface IThreadPool
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

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

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

cancelAll

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

Specified by:
cancelAll in interface IThreadPool
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSize

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

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

compact

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

Specified by:
compact in interface IThreadPool
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

destroy

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

Specified by:
destroy in interface IThreadPool
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.