This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- FlexNet Publisher
- :
- FlexNet Publisher Forum
- :
- Java API Issue
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
02:25 PM
Java API Issue
I'm attempting to write a short java program that, when ran, will list to the user which features are currently being served by the active license manager. However, I haven't found a way of doing this other than the following way:
[CODE] String licEnvVar = System.getenv("VENDOR_LICENSE_FILE");
fs = new FeatureSpecifier("f1", "1.0");
lic = new License(fs, licEnvVar, new vendor(), null);
lic.checkout(1);
LicenseSource ls = lic.getLicenseSource();
String[] feat = ls.getFeatureList();
for (int i=0; i System.out.println("" + feat);
}
lic.checkin();[/CODE]
Is there a way, using either the Java API or the flex C libraries, that I can write a program to list out all the supported features with the program itself being ignorant of the features themselves (not having to create a FeatureSpecifier)?
[CODE] String licEnvVar = System.getenv("VENDOR_LICENSE_FILE");
fs = new FeatureSpecifier("f1", "1.0");
lic = new License(fs, licEnvVar, new vendor(), null);
lic.checkout(1);
LicenseSource ls = lic.getLicenseSource();
String[] feat = ls.getFeatureList();
for (int i=0; i
}
lic.checkin();[/CODE]
Is there a way, using either the Java API or the flex C libraries, that I can write a program to list out all the supported features with the program itself being ignorant of the features themselves (not having to create a FeatureSpecifier)?
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
03:05 PM
For a single license source, you can use LicenseSource.createLicenseSource instead of using a feature specifier; something like this, perhaps:[code]try
{
ls = LicenseSource.createLicenseSource("@localhost", viDemoInfo, null);
String[] featureList = ls.getFeatureList("demo");
if (featureList != null)
{
for (int i = 0; i < featureList.length; i++)
{
System.out.println("Server knows about: " + featureList);
}
}
} catch (FlexlmException darn)
{
System.out.println(darn.getMessage( ));
}[/code]
{
ls = LicenseSource.createLicenseSource("@localhost", viDemoInfo, null);
String[] featureList = ls.getFeatureList("demo");
if (featureList != null)
{
for (int i = 0; i < featureList.length; i++)
{
System.out.println("Server knows about: " + featureList);
}
}
} catch (FlexlmException darn)
{
System.out.println(darn.getMessage( ));
}[/code]
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 21, 2008
03:52 PM
That worked! Thank you very much.
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)