Runtime states

The classes shown in Figure 20 are used to build a licensed product. At run time, when invoked by a user, the licensed product executes the member functions and is subject to the conditions shown in the state transition diagram in Figure 21.


When a licensed product is invoked by a user, it calls the TLicenseUse:Check framework function. The Licensing framework implementation chosen as the selected provider communicates with its associated licensing server, and sends a message containing a challenge and a request for licensing units. The licensing server typically reads and validates activation key data, responds to this challenge, and returns a message containing the licensing units.

If the key data is satisfactory, the Licensing framework implementation allows the licensed product to be started and used. If the framework cannot locate an acceptable key, it communicates that information to the licensed product via an exception, allowing the licensed product to determine an appropriate action.

When licensed product use ends, the TLicenseUse destructor releases any unused licensing units back to the licensing server.

The states and transitions shown in Figure 21 are described in more detail as follows:

    Initialized The first action that the licensed product must perform is to instantiate the product's class derived from TLicenseUse. Instantiating this object does not cause any licensing activity. To issue the license request, the object's Check() member function is called by the licensed product. Calling Check() transfers control from the licensed product to the Licensing framework.
    Unbound Because there might be multiple providers available at run time, the licensed product must choose among them. The choice is made in response to the Licensing framework calling the licensed product's override of the SelectProvider() member function.
    Bound The Licensing framework now has a provider selected by the licensed product. The framework calls that provider to allocate the requested licensing units. If the request fails, the framework returns to the Unbound state.
    Licensed If the request for licensing units succeeds, the product is licensed. The units are held by the product while it executes its licensed code. When the product is finished executing the licensed code, it destroys the TLicenseUse object.
    Released Deletion of the object causes the Licensing framework to return any unused licensed units to the license server.
    Exception At the end-user site, if no license providers that can allocate the requested licensing units, the licensed product's override of the ReportException() member function is called. The licensed product must inform the user that the license cannot be acquired, and then decide upon appropriate action, ranging from refusing to execute to simply pressing on.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker