com.esri.arcgis.datasourcesraster
Class ThreadedProcessor

java.lang.Object
  extended by com.esri.arcgis.datasourcesraster.ThreadedProcessor
All Implemented Interfaces:
IThreadedProcessor, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class ThreadedProcessor
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IThreadedProcessor

A threaded processor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
ThreadedProcessor()
          Constructs a ThreadedProcessor using ArcGIS Engine.
ThreadedProcessor(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ThreadedProcessor theThreadedProcessor = (ThreadedProcessor) obj;
 
Method Summary
 void cancel()
          Cancels current executing jobs.
 boolean equals(Object o)
          Compare this object with another
 void execute(IEnumThreadedJobs pJobs, int numThreads, ITrackCancel pTrackCancel)
          Executes a given number of jobs in specified number of threads.
static String getClsid()
          getClsid.
 IErrorInfo getErrorInfo()
          Get errors from failed execution.
 int getFailedThreadCount()
          Get number of threads failed.
 IThreadedJobResultHandler getResultHandler()
          The result handler which, if specified, receives job results from each thread as they become available.
 int getTotalWork()
          The total amount of work to be done by the processor.
 int getWaitInterval()
          The duration (in milliseconds) that the main thread waits before continuing to poll busy worker threads for status.
 int getWorkDone()
          The amount of work done by the processor.
 int hashCode()
          the hashcode for this object
 boolean isStopOnFirstError()
          Indicates whether execution should stop as soon as an error is encountered.
 void setResultHandlerByRef(IThreadedJobResultHandler ppThreadedJobResultHandler)
          The result handler which, if specified, receives job results from each thread as they become available.
 void setStopOnFirstError(boolean pbStopOnFirstError)
          Indicates whether execution should stop as soon as an error is encountered.
 void setTotalWork(int pTotalWork)
          The total amount of work to be done by the processor.
 void setWaitInterval(int pWaitInterval)
          The duration (in milliseconds) that the main thread waits before continuing to poll busy worker threads for status.
 void setWorkDone(int pWorkDone)
          The amount of work done by the processor.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

ThreadedProcessor

public ThreadedProcessor()
                  throws IOException,
                         UnknownHostException
Constructs a ThreadedProcessor using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

ThreadedProcessor

public ThreadedProcessor(Object obj)
                  throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ThreadedProcessor theThreadedProcessor = (ThreadedProcessor) obj;

Construct a ThreadedProcessor using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to ThreadedProcessor.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

execute

public void execute(IEnumThreadedJobs pJobs,
                    int numThreads,
                    ITrackCancel pTrackCancel)
             throws IOException,
                    AutomationException
Executes a given number of jobs in specified number of threads.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
execute in interface IThreadedProcessor
Parameters:
pJobs - A reference to a com.esri.arcgis.datasourcesraster.IEnumThreadedJobs (in)
numThreads - The numThreads (in)
pTrackCancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setResultHandlerByRef

public void setResultHandlerByRef(IThreadedJobResultHandler ppThreadedJobResultHandler)
                           throws IOException,
                                  AutomationException
The result handler which, if specified, receives job results from each thread as they become available.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setResultHandlerByRef in interface IThreadedProcessor
Parameters:
ppThreadedJobResultHandler - A reference to a com.esri.arcgis.datasourcesraster.IThreadedJobResultHandler (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getResultHandler

public IThreadedJobResultHandler getResultHandler()
                                           throws IOException,
                                                  AutomationException
The result handler which, if specified, receives job results from each thread as they become available.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getResultHandler in interface IThreadedProcessor
Returns:
A reference to a com.esri.arcgis.datasourcesraster.IThreadedJobResultHandler
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

cancel

public void cancel()
            throws IOException,
                   AutomationException
Cancels current executing jobs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

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

setTotalWork

public void setTotalWork(int pTotalWork)
                  throws IOException,
                         AutomationException
The total amount of work to be done by the processor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

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

getTotalWork

public int getTotalWork()
                 throws IOException,
                        AutomationException
The total amount of work to be done by the processor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getTotalWork in interface IThreadedProcessor
Returns:
The pTotalWork
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWorkDone

public int getWorkDone()
                throws IOException,
                       AutomationException
The amount of work done by the processor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getWorkDone in interface IThreadedProcessor
Returns:
The pWorkDone
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setWorkDone

public void setWorkDone(int pWorkDone)
                 throws IOException,
                        AutomationException
The amount of work done by the processor.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

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

getErrorInfo

public IErrorInfo getErrorInfo()
                        throws IOException,
                               AutomationException
Get errors from failed execution.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getErrorInfo in interface IThreadedProcessor
Returns:
A reference to a com.esri.arcgis.system.IErrorInfo
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFailedThreadCount

public int getFailedThreadCount()
                         throws IOException,
                                AutomationException
Get number of threads failed.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getFailedThreadCount in interface IThreadedProcessor
Returns:
The pThreadFailedCount
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setStopOnFirstError

public void setStopOnFirstError(boolean pbStopOnFirstError)
                         throws IOException,
                                AutomationException
Indicates whether execution should stop as soon as an error is encountered.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

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

isStopOnFirstError

public boolean isStopOnFirstError()
                           throws IOException,
                                  AutomationException
Indicates whether execution should stop as soon as an error is encountered.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isStopOnFirstError in interface IThreadedProcessor
Returns:
The pbStopOnFirstError
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setWaitInterval

public void setWaitInterval(int pWaitInterval)
                     throws IOException,
                            AutomationException
The duration (in milliseconds) that the main thread waits before continuing to poll busy worker threads for status.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

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

getWaitInterval

public int getWaitInterval()
                    throws IOException,
                           AutomationException
The duration (in milliseconds) that the main thread waits before continuing to poll busy worker threads for status.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getWaitInterval in interface IThreadedProcessor
Returns:
The pWaitInterval
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.