|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.esri.arcgis.system.ExtensionManager
Extension Manager - a singleton.
The ExtensionManager is designed to allow you to enable licensed extensions, such as ArcGIS 3D Analyst, within your standalone application.
Being a singleton object, ExtensionManager is the one and only instance of its class. An application can have only one ExtensionManager object. You could cocreate and use ExtensionManager from within ArcMap, but there is no real need as the IExtensionManager interface is also available on the Application object.
See the About Extensions topics for more details.
If you are building an application that makes use of licensed extension functionality like ArcGIS Spatial Analyst, ArcGIS 3D Analyst, or ArcPress for ArcGIS, you need to take responsibility for enabling the extension you're using.
The ExtensionManager was designed for this purpose. The model is that you create the ExtensionManager and hold onto it for the life of your application. Before you use a licensed extension, you need to load it and enable it. You load the extension using IExtensionManagerAdmin::AddExtension and passing in the CLSID of the extension. Then before you use the extension, you need to enable it.
To enable the extension, find the extension using IExtensionManager::FindExtension , QI for IExtensionConfig on the extension, and then set the State property to esriESEnabled. Keep in mind that setting this property may fail, so be prepared to handle that in your application. If enabling the extension succeeds, that means that the license was checked out. If not, then the license could not be acquired.
If during the life of your application, you want to give the license back, simply set the state to esriESDisabled. If that succeeds the license was checked back in. If it failed that means there are outstanding objects (from the extension) that are still using the license.
IExtensionManager,
IExtensionManagerAdmin,
IExtension,
IExtensionConfig,
Serialized Form| Constructor Summary | |
ExtensionManager()
Constructs a ExtensionManager using ArcGIS Engine. |
|
ExtensionManager(java.lang.Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. |
|
| Method Summary | |
void |
addExtension(IUID extensionCLSID,
java.lang.Object initializationData)
Creates a single extension given the CLSID, then passes initializationData to IExtension::Startup. |
boolean |
equals(java.lang.Object o)
Compare this object with another |
IExtension |
findExtension(java.lang.Object nameOrID)
Finds the extension by CLSID (IUID) or name (String). |
IExtensionManager |
getAsIExtensionManager()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed. |
IExtensionManagerAdmin |
getAsIExtensionManagerAdmin()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed. |
IJITExtensionManager |
getAsIJITExtensionManager()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed. |
ISupportErrorInfo |
getAsISupportErrorInfo()
Deprecated. No replacement. The object reference can be directly used where the implemented interface is needed. |
static java.lang.String |
getClsid()
|
IExtension |
getExtension(int index)
The extension at the specified index. |
IUID |
getExtensionCLSID(int index)
The CLSID of the extension at the specified index. |
int |
getExtensionCount()
The number of extensions loaded in the application. |
IUID |
getJITExtensionCLSID(int index)
Retrieves the CLSID of the JIT Extension at index. |
int |
getJITExtensionCount()
The number of just in time extensions registered with the application. |
int |
hashCode()
the hashcode for this object |
void |
insertExtension(IUID pExtCLSID,
IExtension pExtension)
Adds an extension to the manager without initialization. |
void |
interfaceSupportsErrorInfo(GUID riid)
Supported Platforms |
boolean |
isExtensionEnabled(IUID pExtCLSID)
Returns whether the extension is currently checked on. |
boolean |
isLoaded(IUID pID)
Returns whether the extension is currently loaded. |
void |
removeExtension(IExtension pExtension)
Removes a just in time extension from the manager. |
void |
shutdownExtensions()
Shuts down and releases the extensions that are loaded and calls IExtension::Shutdown. |
void |
startupExtensions(IUID componentCategory,
IUID jitCategory,
java.lang.Object initializationData)
Creates and starts the extensions for the given component category, passing initializationData to each in IExtension::Startup. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ExtensionManager()
throws java.io.IOException,
java.net.UnknownHostException
java.io.IOException - if there are interop problems
java.net.UnknownHostException - if there are interop problems
public ExtensionManager(java.lang.Object obj)
throws java.io.IOException
obj to ExtensionManager. ExtensionManager theExtensionManager = (ExtensionManager) obj;
obj - an object returned from ArcGIS Engine or Server
java.io.IOException - if there are interop problems| Method Detail |
public static java.lang.String getClsid()
public IExtensionManager getAsIExtensionManager()
public IExtensionManagerAdmin getAsIExtensionManagerAdmin()
public ISupportErrorInfo getAsISupportErrorInfo()
public IJITExtensionManager getAsIJITExtensionManager()
public boolean equals(java.lang.Object o)
public int hashCode()
public int getExtensionCount()
throws java.io.IOException,
AutomationException
IExtensionManagerReturns the number of extensions currently loaded in the application.
getExtensionCount in interface IExtensionManagerjava.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IExtension getExtension(int index)
throws java.io.IOException,
AutomationException
IExtensionManagerReturns the extension at the specified index from the extensions currently loaded in the application. The first extension has an index of 0 and the last extension has in index of ExtensionCount - 1.
This is not the only way to get a reference to an extension; the IApplication interface has FindExtensionByCLSID and FindExtensionByName methods.
getExtension in interface IExtensionManagerindex - The index (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IUID getExtensionCLSID(int index)
throws java.io.IOException,
AutomationException
IExtensionManagerReturns the unique identifer (UID) of the extension at the specified index from the extensions currently loaded in the application. The first extension has an index of 0 and the last extension has in index of ExtensionCount - 1.
getExtensionCLSID in interface IExtensionManagerindex - The index (in)
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public IExtension findExtension(java.lang.Object nameOrID)
throws java.io.IOException,
AutomationException
IExtensionManagerThe FindExtension method will get an extension by either its name string or by its CLSID. Using IExtensionManager is not the only way to get a reference to an extension; the IApplication interface has FindExtensionByCLSID and FindExtensionByName methods.
nameOrID is a variant representing the identifier of the extension. This can either be the UID of the extension or the name string.
COM coclasses are identified by a globally unique identifier (GUID). There two formats for the GUID for a coclass: a class ID (CLSID) and a ProgID. The ProgID is a text alias for a CLSID. The UID coclass can be used to represent the GUID of an extension object. You can set the IUID.Value property to either the CLSID or the ProgID.
To find the Name, CLSID, and ProgID of an ESRI extension, refer to the following technical document:
ArcObjects Developer Help > Technical Documents > Names and IDs > Extensions
findExtension in interface IExtensionManagernameOrID - A Variant (in)
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public void startupExtensions(IUID componentCategory,
IUID jitCategory,
java.lang.Object initializationData)
throws java.io.IOException,
AutomationException
IExtensionManagerAdminThe StartupExtensions method is similar to AddExtension, except that it operates on all the extensions in the specified component category (for example, ESRI Mx Extensions).
It is okay to add extensions to your Application using the AddExtension method after extensions were added with the StartupExtensions method.
You cannot add extensions to your Application using the StartupExtensions method after extensions were added with the AddExtension method. It evokes the "Automation error Catastrophic failure" (-2147418113).
The StartupExtensions method needs to be called before the AddExtensions method or used solely.
startupExtensions in interface IExtensionManagerAdmincomponentCategory - A reference to a com.esri.arcgis.system.IUID (in)jitCategory - A reference to a com.esri.arcgis.system.IUID (in)initializationData - A Variant (in)
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public void shutdownExtensions()
throws java.io.IOException,
AutomationException
IExtensionManagerAdminThe ShutdownExtensions method unloads all the extensions from your application and releases the licenses.
There is no way to add extensions to your application using the same method, with which extensions were added to it, after the ShutdownExtensions method has been called in the same application lifetime.
Example 1:
Extensions were added with the AddExtension method.
The ShutdownExtensions has been called.
You cannot add extensions using the AddExtension method.
You can add extensions using the StartupExtensions method.
Example 2:
Extensions were added with the StartupExtensions method.
The ShutdownExtensions has been called.
You cannot add extensions using the StartupExtensions method.
You can add extensions using the AddExtension method.
shutdownExtensions in interface IExtensionManagerAdminAutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public void addExtension(IUID extensionCLSID,
java.lang.Object initializationData)
throws java.io.IOException,
AutomationException
IExtensionManagerAdminThe AddExtension method loads the extension specified by the CLSID. Before using a licensed extension, it needs to be loaded and enabled.
extensionCLSID specifies the unique identifier (UID) of an extension.
To enable the extension, find the extension using the IExtensionManager::FindExtension method, obtain IExtensionConfig on the extension, and then set the State property to esriESEnabled.
To load all the extension within a specified component category (for example, ESRI Mx Extensions) use the StartipExtensions method.
COM coclasses are identified by a globally unique identifier (GUID). There two formats for the GUID for a coclass: a class ID (CLSID) and a ProgID. The ProgID is a text alias for a CLSID. The UID coclass can be used to represent the GUID of an extension object. You can set the IUID.Value property to either the CLSID or the ProgID.
To find the CLSID and ProgID of an ESRI extension, refer to the following technical document:
ArcObjects Developer Help > Technical Documents > ESRI Extensions: Names and IDs
For your custom extensions, the ProgID is a string composed of the name of your project used to make the extension and the class name of the extension.
addExtension in interface IExtensionManagerAdminextensionCLSID - A reference to a com.esri.arcgis.system.IUID (in)initializationData - A Variant (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void interfaceSupportsErrorInfo(GUID riid)
throws java.io.IOException,
AutomationException
ISupportErrorInfoIndicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo in interface ISupportErrorInforiid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public int getJITExtensionCount()
throws java.io.IOException,
AutomationException
IJITExtensionManagerReturns the number of JIT extensions currently in the application. This does not include any ordinary extensions.
getJITExtensionCount in interface IJITExtensionManagerAutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
public IUID getJITExtensionCLSID(int index)
throws java.io.IOException,
AutomationException
IJITExtensionManagerReturns the UID of the JIT extension at the specifed index. The first JIT extension in the collection will have an index of 0 and the last JIT extension in the collection will have an index of JITExtentionCount - 1.
getJITExtensionCLSID in interface IJITExtensionManagerindex - The index (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isLoaded(IUID pID)
throws java.io.IOException,
AutomationException
IJITExtensionManager
isLoaded in interface IJITExtensionManagerpID - A reference to a com.esri.arcgis.system.IUID (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void removeExtension(IExtension pExtension)
throws java.io.IOException,
AutomationException
IJITExtensionManagerRemoved the specified JIT extension from the ExtensionManager.
removeExtension in interface IJITExtensionManagerpExtension - A reference to a com.esri.arcgis.system.IExtension (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public void insertExtension(IUID pExtCLSID,
IExtension pExtension)
throws java.io.IOException,
AutomationException
IJITExtensionManagerAdds the specified JIT extension to the ExtensionManager. Note that a JIT extension will be loaded the first time that IApplication::FindExtensionByCLSID is called for that extension.
insertExtension in interface IJITExtensionManagerpExtCLSID - A reference to a com.esri.arcgis.system.IUID (in)pExtension - A reference to a com.esri.arcgis.system.IExtension (in)
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isExtensionEnabled(IUID pExtCLSID)
throws java.io.IOException,
AutomationException
IJITExtensionManager
isExtensionEnabled in interface IJITExtensionManagerpExtCLSID - A reference to a com.esri.arcgis.system.IUID (in)
AutomationException - If the ArcObject component throws an exception.
java.io.IOException - If there are interop problems.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||