cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enabling Native HostID support with Java Based FNP applications.

Enabling Native HostID support with Java Based FNP applications.

Native hostids are provided transparently via Java Native Interface (JNI) hostid integration, and can be enabled with a single method invocation. By shipping platform-dependent native code, it is simple to use the non-Java FlexNet Publisher Licensing Toolkit code to provide hostid capability to FlexEnabled Java products.

The following sections outline how to implement native hostid support.

Task To implement native hostid support on Windows platforms:


1. Build the FlexNet Publisher Licensing Toolkit. Refer to the Development Environment Guide for details on building the kit.
2. Build lmgr11.dll in the FlexNet Publisher Licensing Toolkit. To do so, enter the following from the <sdk_platform> directory in your toolkit installation:

nmake -f makefile DLL=1 to build lmgr11.dll without dongle support
or
nmake -f makefile DLL=1 DONGLE=1 to build lmgr11.dll with dongle support


This client DLL contains the hostid-object code that you must ship with your product.


3. In the Java virtual machine’s $PATH environment variable, include the path to the folder containing lmgr11.dll. This is how the Java Virtual Machine locates code invoked through JNI.


4. In the Java source code, invoke the useNativeHostIds method on any VendorInfo subclass instances that are created by the application code.

 

Task To implement native hostid support on UNIX platforms:


1. Build the FlexNet Publisher Licensing Toolkit. Refer to the Development Environment Guide for details on building the kit.
2. Build liblmgr11.so in the FlexNet Publisher Licensing Toolkit. To do so, enter the following from the <sdk_platform> directory in your toolkit installation:


make shared_object


This shared object contains the C functions required to support Java native hostids.


3. Set the LD_LIBRARY_PATH system environment variable to include the path to liblmgr11.so.
4. In the Java source code, invoke the useNativeHostIds method on any VendorInfo subclass instances that are created by the application code. See the online API documentation for details on the VendorInfo.useNativeHostids method.

=====================================================================================================

Talking exclusively in the terms of BasicExample.Java file:

To enable the java client to checkout the feature having a valid hostid

   > Add the below line in BasicExample.java,after the line "fs = new FeatureSpecifier(argv[0], version);"

      vInfo.useNativeHostIds(true, null);
   > From the platform folder,build lmgr11.dll(Windows) or lmgr11.so(Unix).Using the below command

       nmake lmgr11.dll

   > Copy lmgr11.dll into examples <folder> of flexjava kit

   > Compile BasicExample.java

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Nov 09, 2020 01:02 PM
Updated by:
Contributors