|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.system.ExtensionManager
public class 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.
IExtension
,
IExtensionManager
,
IExtensionConfig
,
IExtensionManagerAdmin
,
Serialized FormConstructor Summary | |
---|---|
ExtensionManager()
Constructs a ExtensionManager using ArcGIS Engine. |
|
ExtensionManager(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. ExtensionManager theExtensionManager = (ExtensionManager) obj; |
Method Summary | |
---|---|
void |
addExtension(IUID extensionCLSID,
Object initializationData)
Creates a single extension given the CLSID, then passes initializationData to IExtension::Startup. |
boolean |
equals(Object o)
Compare this object with another |
IExtension |
findExtension(Object nameOrID)
Finds the extension by CLSID (IUID) or name (String). |
static String |
getClsid()
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)
interfaceSupportsErrorInfo |
boolean |
isExtensionEnabled(IUID pExtCLSID)
Indicates whether the extension is currently checked on. |
boolean |
isLoaded(IUID pID)
Indicates 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,
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 |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public ExtensionManager() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic ExtensionManager(Object obj) throws IOException
ExtensionManager theExtensionManager = (ExtensionManager) obj;
obj
to ExtensionManager
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int getExtensionCount() throws IOException, AutomationException
Returns the number of extensions currently loaded in the application.
getExtensionCount
in interface IExtensionManager
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IExtension getExtension(int index) throws IOException, AutomationException
getExtension
in interface IExtensionManager
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IUID getExtensionCLSID(int index) throws IOException, AutomationException
getExtensionCLSID
in interface IExtensionManager
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IExtension findExtension(Object nameOrID) throws IOException, AutomationException
The 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 IExtensionManager
nameOrID
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void startupExtensions(IUID componentCategory, IUID jitCategory, Object initializationData) throws IOException, AutomationException
The 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 IExtensionManagerAdmin
componentCategory
- 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)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void shutdownExtensions() throws IOException, AutomationException
The 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 IExtensionManagerAdmin
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addExtension(IUID extensionCLSID, Object initializationData) throws IOException, AutomationException
The 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 IExtensionManagerAdmin
extensionCLSID
- A reference to a com.esri.arcgis.system.IUID (in)initializationData
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void interfaceSupportsErrorInfo(GUID riid) throws IOException, AutomationException
Indicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo
in interface ISupportErrorInfo
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getJITExtensionCount() throws IOException, AutomationException
Returns the number of JIT extensions currently in the application. This does not include any ordinary extensions.
getJITExtensionCount
in interface IJITExtensionManager
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IUID getJITExtensionCLSID(int index) throws IOException, AutomationException
getJITExtensionCLSID
in interface IJITExtensionManager
index
- The index (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isLoaded(IUID pID) throws IOException, AutomationException
Indicates whether the specified JIT extension is loaded. A JIT extension will be loaded the first time that IApplication::FindExtensionByCLSID is called for that extension. Use the JITExtensionCLSID property to get the UID of the extension.
isLoaded
in interface IJITExtensionManager
pID
- A reference to a com.esri.arcgis.system.IUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void removeExtension(IExtension pExtension) throws IOException, AutomationException
Removed the specified JIT extension from the ExtensionManager.
removeExtension
in interface IJITExtensionManager
pExtension
- A reference to a com.esri.arcgis.system.IExtension (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void insertExtension(IUID pExtCLSID, IExtension pExtension) throws IOException, AutomationException
Adds 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 IJITExtensionManager
pExtCLSID
- A reference to a com.esri.arcgis.system.IUID (in)pExtension
- A reference to a com.esri.arcgis.system.IExtension (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isExtensionEnabled(IUID pExtCLSID) throws IOException, AutomationException
Indicates whether the specified JIT extension is enabled. Use the JITExtensionCLSID property to get the UID of the extension.
isExtensionEnabled
in interface IJITExtensionManager
pExtCLSID
- A reference to a com.esri.arcgis.system.IUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |