Eclipse
Passage Floating License Server
is itself a product
licensed with Passage.
Let's examine which steps it took
to get protected with
license.
FLS architects defined three features for this product, meaning these three functions are designed to be matched with licensing coverage:
It was also agreed (usually defined by marketing department), that the first two features is allowed to be used in an absence of a license, but with warnings that remind user of insufficient license coverage.
The last feature can be used only when licensed properly.
After evolution, all three features achieve some mature state which was coined as 2.0.0 version.
Thus, developer declares licensing requirements for these three features.
Licensing requirements for the core product feature org.eclipse.passage.lbc.fls.product is declared in FLS Seal plug-in as it represents the product on the bundles level:
Provide-Capability: licensing.feature;licensing.feature="org.eclipse.passage.lbc.fls.product";name="Eclipse Passage Floating License Server";version="2.0.0";provider="Eclispe Passage";level="warn"
The requirement is declared with warn restriction level, which precisely means if there is no license, expose warning to a user. This work is to be done by the development as well.
Development guarantees, that the core feature identifier is precisely equal to the product identifier, which is our case can be found in FLS product declaration.
Licensing requirements for the base feature org.eclipse.passage.lbc.acquire.concurrent is declared in LBC Base bundle: there is no API exposed by LBC component, thus licensing requirement for a feature must reside close to its implementation as a part of the feature contract.
Location of the requirements described here is recommended as a part of approved methodology, but not required. Passage Access Cycle will find your licensing requirement in any runtime available bundle.
Licensing requirements for the premium feature org.eclipse.passage.lbc.acquire.concurrent.full declared next to its basic version.
But unlike it, this one is exposed under error restriction level as it's not supposed to be used if not licensed.
Access Cycle is the part of Passage that runs together with your product and empowers licensing protection at your product runtime.
Three things should be done in you product's code base to utilize Access Cycle:
As FLS is itself for Passage and on Passage product, it gains the vital dependency with the rest of Passage parts necessary for functioning.
Access Cycle configuration and product public key reside in a dedicated bundle, methodologically called seal.
To configure Access Cycle a developer must supply instance of Passage Framework interface by means of the current infrastructure DI. For Eclipse ecosystem we use OSGi implementation.
Have a look at FlsFramework:
The public key file is placed in OSGI-INF folder of the same bundle, which supplies Framework instance to the Passage runtime. The file is included in the bundle binary build.
A product developer appeals to Access Cycle by means of Passage Lic API to cover each of the features implementation with licensing protection.
FLS checks license coverage when each of the features, declared to licensing protection, is going to be executed.
The first feature, org.eclipse.passage.lbc.fls.product, as it denotes the product core feature, is checked for license coverage each time the server starts up.
Have a closer loot at LicenseProtection class that implements the check.
It has two pairing methods:
check,
which gets a licensing grant for the feature
and report failed check if none is
granted, and
release, which
returns the grant, it it has indeed been acquired.
Correspondingly,
check is called by start
server command and
release is
triggered on server stop.
The basic org.eclipse.passage.lbc.acquire.concurrent feature is checked when the corresponding functionality is invoked: when FLS a client tries to acquire a grant for a product feature under FLS responsibility.
And the premium org.eclipse.passage.lbc.acquire.concurrent.full feature is checked when the basic functionality is not enough.
Look how ProtectedGrantCapacity, which checks if the premium grant acquisition is properly licensed, is exploited by AcquiredGrantsStorage, which, in turn, is responsible for the grant acquisition in general.