Disabled Local Renewal While Using Auto-Refresh Functionality
Declare Variables/Constants
String FEATURE_NAME = "Addition";
String CONTACT_SERVER = "localhost";
Attribute attrAppContext = null;
ApplicationContext appContext = null;
LoginSession Session = null;
API Calls
To disable local renewal, execute the APIs in the specified sequential order only:
>attrAppContext = new Attribute();
>attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_CONTACT_SERVER,CONTACT_SERVER);
NOTE If instead the LSFORCEHOST or LSHOST environment variables are set, then the above mentioned steps are not required.
>attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_AUTO_REFRESH,LicensingConstants.SNTL_ATTR_YES);
> attrAppContext.set(LicensingConstants.SNTL_ATTR_APPCONTEXT_ENABLE_LOCAL_RENEWAL,LicensingConstants.SNTL_ATTR_NO);
>appContext = new ApplicationContext(attrAppContext);
>Session = new LoginSession();
>Session.login(appContext, FEATURE_NAME);
While using the auto-refresh (with local renewal enabled) functionality, there is a possibility that the refresh call reaches the License Manager post the license/key expiry. In such cases, the licensed application may experience failure due to inability of the License Manager to refresh the logged in session because of insufficient tokens.
Therefore, it is recommended to always disable local renewal while using the auto-refresh functionality.