Class LicenseMgr
public final class LicenseMgr implements IUnknown,ILicenseMgr
{
// Methods
public native IUnknown createFromPackage(int index,
IUnknown punkOuter, int ctxFlags);
public native IUnknown createInstance(String clsid,
IUnknown punkOuter, int ctxFlags);
public native IUnknown createWithLic(String lic, String clsid,
IUnknown punkOuter, int ctxFlags);
public native void setPackage(String url);
}
This class works with the ILicenseMgr interface to enable you to use licensed Component Object Model (COM) components or controls in your Java application.
In the LicenseMgr class, methods are not called directly. Instead, you create an instance of LicenseMgr and use the ILicenseMgr interface to manipulate the instance, as in the following example:
ILicenseMgr licmgr = (ILicenseMgr)new LicenseMgr();
// use licmgr interface
For more information on how to use licensed COM components, see the ILicenseMgr interface.
public native IUnknown createFromPackage(int index, IUnknown punkOuter, int
ctxFlags);
Creates a package. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.
Return Value:
Returns the newly created package.
Parameter | Description |
index
| The index of the package.
|
punkOuter
| The aggregating object if the object is created as part of an aggregate; otherwise, the value is null.
|
ctxFlags
| The ComContext value that represents the context that the new object should be created in.
|
public native IUnknown createInstance(String clsid, IUnknown punkOuter, int
ctxFlags);
Creates an instance of a specific COM class. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.
Warning In general, this method should not be called. The best way to create an instance of a COM class is to use the new operator on the Java wrapper generated by the jactivex tool.
Return Value:
Returns an instance of the specified COM class.
Parameter | Description |
clsid
| The class identifier (CLSID) of the instantiated COM class.
|
punkOuter
| The aggregating object if the object is being created as part of an aggregate; otherwise, the value is null.
|
ctxFlags
| The ComContext value that represents the context that the new object is created in.
|
Exceptions:
com.ms.com.ComFailException
if an error occurs while instantiating the class.
public native IUnknown createWithLic(String lic, String clsid,
IUnknown punkOuter, int ctxFlags);
Creates an instance of a licensed control. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.
Return Value:
Returns a new instance of the specified licensed COM class.
Parameter | Description |
lic
| The license for the instantiated COM class.
|
clsid
| The class identifier (CLSID) of the instantiated COM class.
|
punkOuter
| The aggregating object if the object is being created as part of an aggregate; otherwise, the value is null.
|
ctxFlags
| The ComContext value that represents the context that the new object is created in.
|
Exceptions:
com.ms.com.ComFailException
if an error occurs while instantiating the class.
public native void setPackage(String url);
Sets the package for a specific URL. This method cannot be invoked directly. You must first cast the LicenseMgr object to the ILicenseMgr interface and invoke the method through the interface.
Return Value:
No return value.
Parameter | Description |
url
| The Uniform Resource Locator (URL) of the package.
|