com.esri.arcgis.system
Class ComponentCategoryManager

java.lang.Object
  extended by com.esri.arcgis.system.ComponentCategoryManager
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IComponentCategoryManager, Serializable

public class ComponentCategoryManager
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IComponentCategoryManager

Component Category Manager Object.

Description

The ComponentCategoryManager object provides a mechanism to programmatically add or remove new components to or from a particular category and create new component categories.

See the Component Categories topic for more details on the ComponentCatgeoryManager.

Remarks

Component categories are used by client applications to efficiently find all components of a particular type that are installed on the system. For example, ArcMap only supports commands that implement the ICommand interface. A component category, ESRI Mx Commands, is used to find all the command components that can be used inside ArcMap.

If component categories were not used, the application would have to instantiate each COM component and interrogate it to see if it supported the required functionality, which is not a practical approach. Component categories support the extensibility of COM by allowing the developer of the client application to create and work with classes that belong to a particular category. If, at a later date, a new class is added to the category, the client application need not be changed to take advantage of the new class; it will automatically pick up the new class the next time the category is read.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
ComponentCategoryManager()
          Constructs a ComponentCategoryManager using ArcGIS Engine.
ComponentCategoryManager(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
ComponentCategoryManager theComponentCategoryManager = (ComponentCategoryManager) obj;
 
Method Summary
 void create(String name, IUID category)
          Creates a component category.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 int hashCode()
          the hashcode for this object
 void setup(String pathname, IUID objectType, IUID category, boolean install)
          Installs or uninstalls the objects that match the object type into the given category.
 void setupObject(String pathname, IUID obj, IUID category, boolean install)
          Installs or uninstalls the given object into the given category.
 
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

ComponentCategoryManager

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

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

ComponentCategoryManager

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

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

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

create

public void create(String name,
                   IUID category)
            throws IOException,
                   AutomationException
Creates a component category.

Description

Name is a string representing the name of the new category you are creating.

Category is an IUID object representing a new unique identifier for the category you are creating.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
create in interface IComponentCategoryManager
Parameters:
name - The name (in)
category - A reference to a com.esri.arcgis.system.IUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setup

public void setup(String pathname,
                  IUID objectType,
                  IUID category,
                  boolean install)
           throws IOException,
                  AutomationException
Installs or uninstalls the objects that match the object type into the given category.

Description

PathName is a string representing the full path and filename of the DLL containing the objects you want to register/unregister in a category.

ObjectType is an IUID object representing the unique identifier of the type of object you want to register/unregister in a category. This UID would be the ID of an interface.

Category is an IUID object representing the unique identifier of the category in which you are registering/unregistering the objects.

install specifies whether you are registering (True) or unregistering (False) the objects.

Remarks

The Setup method provides a means of registering more than one object stored in a DLL. Setup will QueryInterface (QI) each object in the DLL for the interface specified by ObjectType. If the QI succeeds, it will add that object to the component category specified by Category.

For example, you can have a single DLL that contains many commands (objects that implement ICommand). To register all the commands in this DLL with the commands category for ArcMap, you can set ObjectType to be the UID of the ICommand interface and set Category to be the UID of the ESRI Mx Commands category. You don't need to know the UID for each command. By calling Setup once, all the command objects in the DLL will be registered in this category.

If you use the SetupObject method instead, you would have to call SetupObject many times; once for each command in the DLL.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setup in interface IComponentCategoryManager
Parameters:
pathname - The pathname (in)
objectType - A reference to a com.esri.arcgis.system.IUID (in)
category - A reference to a com.esri.arcgis.system.IUID (in)
install - The install (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setupObject

public void setupObject(String pathname,
                        IUID obj,
                        IUID category,
                        boolean install)
                 throws IOException,
                        AutomationException
Installs or uninstalls the given object into the given category.

Description

PathName is a string representing the full path and filename of the DLL containing the objects you want to register/unregister in a category.

obj is an IUID object representing the unique identifier of the object you want to register/unregister in a category. This UID would be the ID of a class.

Category is an IUID object representing the unique identifier of the category in which you are registering/unregistering the objects.

install specifies whether you are registering (True) or unregistering (False) the objects.

Remarks

The SetupObject method provides a means of registering a specific object stored in a DLL.

For example, you can have a single DLL that contains many commands (objects that implement ICommand). If you want to register only one of the commands in this DLL with the commands category for ArcMap, you can set obj to be the UID of your command and set Category to be the UID of the ESRI Mx Commands category. By calling SetObject with these settings, only that specific command will be registered. If you want to register all the commands in the DLL you can either call SetupObject a number of times (once for each command) or use the Setup method instead. Setup allows you to register many objects at the same time with a single call.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setupObject in interface IComponentCategoryManager
Parameters:
pathname - The pathname (in)
obj - A reference to a com.esri.arcgis.system.IUID (in)
category - A reference to a com.esri.arcgis.system.IUID (in)
install - The install (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.