|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas com.esri.arcgis.interop.Ocx com.esri.arcgis.controls.LicenseControl
public class LicenseControl
ESRI LicenseControl
Use the LicenseControl to initialize each application with a suitable license(s) in order for it to run successfully on any machine it is deployed on to. The LicenseControl will configure the licenses at application start time when the form or dialog containing the LicenseControl is loaded.
All applications need to be configured with a license except when the application is not a stand-alone executable i.e. if it's a dll that will be incorporated into an application that will itself perform the license configuration.
There are two types of license to consider when initializing an application, product licenses and extension licenses if an application uses any of the ArcGIS extensions. These licenses can be Engine Single Use, Desktop Single Use or Desktop Concurrent licenses.
Once an application has been initialized with a license it cannot be re-initialized (with a new license); an application is initialized with a license for the duration of its life. When initializing an application with a license the following must be considered:
Use the LicenseControl to automatically perform license initialization within simple graphical user interface applications using the ArcGIS MapControl, PageLayoutControl, TOCControl, ToolbarControl, SymbologyControl, SceneControl or GlobeControl. If greater control is required over license initialization, particularly when checking out and in extension licenses (the LicenseControl will check out extension licenses for the duration of an application's life) use the AoInitialize object to programmatically perform license initialization.
Using the LicenseControl in an application that programmatically initializes a product license is not recommended, because the LicenseControl may initialize a product license before the initialization code executes. However, the LicenseControl can be used to initialize an application with a product license, and any required extension licenses can be checked out and in programmatically.
Use the License Property Page to select the product licenses the application can be initialized with, select the extension licenses required by the application and to set whether the application is shutdown automatically if license initialization fails.
Products
Select at least one product license the application can be initialized with. By default the LicenseControl will try to initialize the application with the ArcGIS Engine product license.
If the product you require is not licensed you may optionally initialize the application with a higher product license. For example, if you select the ArcGIS Engine license and the ArcView license, the LicenseControl will initially try to initialize the application with an ArcGIS Engine license (the lower license). If that license is not available the LicenseControl will try to initialize the application with an ArcView license (the next higher level license selected). If no product licenses are available then the application will fail to initialize. Note, that once an application is initialized with a product license it is not possible to re-initialize the application for the duration of the applications life.
Extensions
Select the extension licenses required by the application. Not every extension license is available with every product license, as such the list of available extension licenses will change as different product licenses become selected. If the ArcGIS Engine product license is selected and an ArcGIS Desktop product is selected, only the ArcGIS Engine extension licenses will display.
The availability of each extension license is checked in conjunction with the product license that the application will ultimately be initialized with. If any of the selected extensions are not available the application will fail to initialize. The LicenseControl will check out extensions directly after the application is initialized and will check in extensions when the application is shutdown.
If a SceneControl or GlobeControl (requiring the 3D Analyst extension) is embedded within the same container as the LicenseControl, the 3D Analyst extension will automatically be checked.
Shutdown
Set whether the LicenseControl will automatically shut down the application if license initialization fails. If the LicenseControl handles license initialization failure a 'License Failure' dialog box will be displayed to the user before the application is shutdown. If the developer handles license initialization failure the ILicenseControl interface members can be used to obtain information on the nature of the failure before the application is programmatically shut down.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class com.esri.arcgis.interop.Ocx |
---|
rootParentContainers, rootWindows |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
LicenseControl()
Constructs a LicenseControl using ArcGIS Engine. |
|
LicenseControl(Object o)
Constructs a LicenseControl. |
Method Summary | |
---|---|
void |
aboutBox()
Displays a dialog of information about the LicenseControl. |
void |
addNotify()
|
boolean |
equals(Object o)
Compare this object with another |
void |
getClassID(GUID[] pClassID)
getClassID |
static String |
getClsid()
getClsid. |
String |
getLicenseAvailability(int option)
A Description of the availability of the licenses either all licenses or just those specified in the LicenseControls property page. |
void |
getSizeMax(_ULARGE_INTEGER[] pCbSize)
getSizeMax |
int |
getStatus()
The status of the LicenseControl initialization. |
String |
getSummary()
A summary of the status of the LicenseControl initialization. |
void |
initNew()
initNew |
void |
interfaceSupportsErrorInfo(GUID riid)
interfaceSupportsErrorInfo |
void |
isDirty()
isDirty |
void |
load(IStream pStm)
load |
void |
save(IStream pStm,
int fClearDirty)
save |
void |
showStatusDialog(int hWndParent,
int option,
Object windowTitle,
Object heading)
Shows a dialog displaying the LicenseControl status and the current license availability. |
Methods inherited from class com.esri.arcgis.interop.Ocx |
---|
checkIfVisible, getCanvasWindowHandle, getControlWindowHandle, getMinimumSize, getObjRef, getPreferredSize, paint, removeNotify, setBounds, setBounds, setSize, setSize, zz_doQueuedSets, zz_get, zz_get, zz_get, zz_get, zz_get, zz_get, zz_get, zz_get, zz_queueSet, zz_queueSet, zz_queueSet, zz_queueSet, zz_queueSet, zz_queueSet, zz_queueSet, zz_queueSet |
Methods inherited from class java.awt.Canvas |
---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public LicenseControl()
public LicenseControl(Object o)
Method Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public void addNotify()
addNotify
in class com.esri.arcgis.interop.Ocx
public void aboutBox() throws IOException, AutomationException
The AboutBox method causes a modal dialog box to display on top of the LicenseControl, containing information about the version and creation date of the LicenseControl as well as listing relevant legal and copyright information from ESRI.
aboutBox
in interface ILicenseControl
aboutBox
in interface ILicenseControlDefault
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getStatus() throws IOException, AutomationException
Returns the Status of the LicenseControl when it initially tried to initilaize the application. If license initailization was successful the Status will return esriLicenseCheckedOut.
If no product licenses were checked in the LicenseControl property pages, the Status returns esriLicenseFailure.
getStatus
in interface ILicenseControl
getStatus
in interface ILicenseControlDefault
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getSummary() throws IOException, AutomationException
Returns a summary of the license status after the LicenseControl has tried to initialize the application with a license. Use the Summary property when license initialization fails, to give information to the user on the nature of the failure, before programmatically shutting down the application.
The possible descriptions returned from the Summary property are as follows:
- "Successful license initialization."
- "No licenses were requested."
- "Failed to initialize license, required products are not available."
- "Failed to initialize license, required extensions are not available."
- "Failed to initialize product license."
- "Failed to checkout extension license."
The default behaviour of the LicenseControl is to allow the developer to programmatically check for and shutdown an application when license initialization fails. To override this behaviour so the LicenseControl automatically shuts down an application when license initialization fails, check the "Shutdown this application if the selected licenses are not available" check box in the property pages of the LicenseControl.
getSummary
in interface ILicenseControl
getSummary
in interface ILicenseControlDefault
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getLicenseAvailability(int option) throws IOException, AutomationException
getLicenseAvailability
in interface ILicenseControl
getLicenseAvailability
in interface ILicenseControlDefault
option
- A com.esri.arcgis.controls.esriLicenseStatusOptions constant (in, optional, pass 1 if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void showStatusDialog(int hWndParent, int option, Object windowTitle, Object heading) throws IOException, AutomationException
Opens a modal dialog specifying the current availability of the specified product and extension licenses. Use the ShowStatusDialog method when license initialization fails, to give information to the user on the nature of the failure, before programmatically shutting down the application. Alternatively, use the Status, Summary and LicenseAvailability members to create your own dialog.
esriLicenseStatusRequested returns the availability of those product and extension licenses checked in the LicenseControl property pages. Use this option when license initialization fails, to give information to the user on the nature of the failure, before programmatically shutting down the application.
esriLicenseStatusAll returns the availability of all product and extension licenses. Use this option when debugging.
By default the modal dialog will have a window title of "License Status" and a heading of "Requested License Status".
The default behaviour of the LicenseControl is to allow the developer to programmatically check for and shutdown an application when license initialization fails. To override this behaviour so the LicenseControl automatically shuts down an application when license initialization fails, check the "Shutdown this application if the selected licenses are not available" check box in the property pages of the LicenseControl.
showStatusDialog
in interface ILicenseControl
showStatusDialog
in interface ILicenseControlDefault
hWndParent
- The hWndParent (in, optional, pass 0 if not required)option
- A com.esri.arcgis.controls.esriLicenseStatusOptions constant (in, optional, pass 1 if not required)windowTitle
- A Variant (in, optional, pass null if not required)heading
- A Variant (in, optional, pass null if not required)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void isDirty() throws IOException, AutomationException
isDirty
in interface IPersistStreamInit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void load(IStream pStm) throws IOException, AutomationException
load
in interface IPersistStreamInit
pStm
- A reference to a com.esri.arcgis.system.IStream (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void save(IStream pStm, int fClearDirty) throws IOException, AutomationException
save
in interface IPersistStreamInit
pStm
- A reference to a com.esri.arcgis.system.IStream (in)fClearDirty
- The fClearDirty (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getSizeMax(_ULARGE_INTEGER[] pCbSize) throws IOException, AutomationException
getSizeMax
in interface IPersistStreamInit
pCbSize
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void initNew() throws IOException, AutomationException
initNew
in interface IPersistStreamInit
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getClassID(GUID[] pClassID) throws IOException, AutomationException
IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.
getClassID
in interface IPersist
pClassID
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |