TProviderOperation

TProviderOperation is the abstract base class that represents an operation the license provider can execute. The most typical operations are those used to challenge the authenticity of the license provider. This can be done by defining an operation that only the license provider knows how to answer, or by asking the license provider something about the activation keys that it is serving.

      class TProviderOperation : public MCollectible {
      //    Copyright (C) 1995 Taligent, Inc. All rights reserved.
      public:
          //.................................................................
          //  destructor
          virtual             ~TProviderOperation();
          
          //.................................................................
          //  MCollectible overrides.
          TStream&            operator>>=(TStream& toWhere) const;
          TStream&            operator<<= (TStream& fromWhere);
          
          //.................................................................
          //  TProviderOperation specific operations.
          virtual void        GetOperationType(TText& textBuffer)const = 0;
              
          //.................................................................
          //  Getter and setter for exceptions.
          const TLicenseException *
                              GetException() const;
          virtual void        SetException(const TLicenseException& except;
              
      protected:
      };

Instantiation

The
TProviderOperation class is an abstract base class and cannot be instantiated.

Member functions

GetOperationType is a pure virtual function used to identify which provider operation the object represents. Frequently a license provider can execute multiple operations and needs to query the object for its type before trying to execute the operation.

SetException allows a provider to associate a license exception with a provider operation. Typically, the provider streams the set of provider operations to its licensing server. If the licensing server catches an exception while processing an element of that set, it can use SetException to store a provider-specific exception object with the failed operation object. The TLicenseException derived class must map any exception thrown during the processing of the provider operation object into the licensing domain. In some cases, it might be appropriate for the provider's TLicenseException derived class to act simply as an "envelope" for the originally thrown exception.

After the provider operation set is streamed back to the provider's framework implementation from its licensing server, the implementation can use GetException to examine the exception and decide whether it warrants causing the composite licensing request to fail. If the provider's framework implementation leaves the exception stored with the provider operation, the licensed product can inspect the exception in its AcceptOperationsResults function (or at the call site of ExecuteOperations).

GetException is used to inspect an exception stored with a provider operation object. The return value is an alias for the private storage belonging to the provider operation object; therefore, the lifetime of the returned value is no longer than the lifetime of the provider operation, and is even shorter if SetException is called.

Deriving classes

The TLicenseChallenge abstract base class is derived for each provider operation.

Concurrency

TLicenseChallenge is not designed for concurrent access.

Resource use

No special requirements.


[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