com.esri.arcgis.geoprocessing
Class GpDispatch

java.lang.Object
  extended by com.esri.arcgis.geoprocessing.GpDispatch
All Implemented Interfaces:
IGPComHelper, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class GpDispatch
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IGPComHelper

Utility object used to execute geoprocessing tools.

Description

The GpDispatch object is a coarse grained ArcObject that permits geoprocessing tools and environments to be used in a scripting language. This object supports the COM IDispatch object. For more information about this object, refer to the ArcGIS Desktop Help. With ArcGIS 9.2, you are now recommended to use the new Geoprocessor class.

Product Availability

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

Supported Platforms

Windows

See Also:
Serialized Form

Constructor Summary
GpDispatch()
          Constructs a GpDispatch using ArcGIS Engine.
GpDispatch(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
GpDispatch theGpDispatch = (GpDispatch) obj;
 
Method Summary
 void addToolbox(String toolbox)
          Adds a reference to the specified toolbox to the GeoProcessor.
 boolean equals(Object o)
          Compare this object with another
 IGPMessages execute(String toolName, IPropertySet params, ITrackCancel trackcancel)
          Executes the specified tool.
static String getClsid()
          getClsid.
 IGPEnvironmentManager getEnvironmentManager()
          The environment manager object associated with the helper.
 String getParameterName(String toolName, int index)
          Get the parameter name for a given tool and index.
 int hashCode()
          the hashcode for this object
 void removeToolbox(String toolbox)
          Removes the reference to the specified toolbox from the GeoProcessor.
 
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

GpDispatch

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

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

GpDispatch

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

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

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 IGPMessages execute(String toolName,
                           IPropertySet params,
                           ITrackCancel trackcancel)
                    throws IOException,
                           AutomationException
Executes the specified tool.

Product Availability

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

Specified by:
execute in interface IGPComHelper
Parameters:
toolName - The toolName (in)
params - A reference to a com.esri.arcgis.system.IPropertySet (in)
trackcancel - A reference to a com.esri.arcgis.system.ITrackCancel (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IGPMessages
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParameterName

public String getParameterName(String toolName,
                               int index)
                        throws IOException,
                               AutomationException
Get the parameter name for a given tool and index.

Product Availability

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

Specified by:
getParameterName in interface IGPComHelper
Parameters:
toolName - The toolName (in)
index - The index (in)
Returns:
The paramName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addToolbox

public void addToolbox(String toolbox)
                throws IOException,
                       AutomationException
Adds a reference to the specified toolbox to the GeoProcessor.

Product Availability

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

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

removeToolbox

public void removeToolbox(String toolbox)
                   throws IOException,
                          AutomationException
Removes the reference to the specified toolbox from the GeoProcessor.

Product Availability

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

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

getEnvironmentManager

public IGPEnvironmentManager getEnvironmentManager()
                                            throws IOException,
                                                   AutomationException
The environment manager object associated with the helper.

Product Availability

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

Specified by:
getEnvironmentManager in interface IGPComHelper
Returns:
A reference to a com.esri.arcgis.geoprocessing.IGPEnvironmentManager
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.