-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfls-licensed-by-passage.html
413 lines (402 loc) · 16.5 KB
/
fls-licensed-by-passage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<link rel="icon" href="i/common/glyph.png">
<title>Example: Floating License Server</title>
<script type="text/javascript" src="js/sh_main.min.js"
language="JavaScript"></script>
<script type="text/javascript" src="js/lang/sh_java.min.js"
language="JavaScript"></script>
<script type="text/javascript" src="js/lang/sh_xml.min.js"
language="JavaScript"></script>
<script type="text/javascript" src="js/lang/sh_properties.min.js"
language="JavaScript"></script>
<link href="css/sh_whitengrey.min.css" rel="stylesheet" type="text/css"
media="all" />
<link
href="https://fonts.googleapis.com/css2?family=Montserrat&family=Quicksand&display=swap"
rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/bl.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/dev.css" rel="stylesheet" type="text/css" media="all" />
<link href="css/examples.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body onload="sh_highlightDocument();" class="dev-doc">
<div class="navigation container-fluid">
<div class="row header">
<div class="col-sm nav-ref home">
<a class="anchor" href="index.html">Home</a>
</div>
<div class="col-sm nav-ref features">
<a class="anchor" href="index.html#features">Features</a>
</div>
<div class="col-sm nav-ref products">
<a class="anchor" href="index.html#products">Products</a>
</div>
<div class="col-sm nav-ref components">
<a class="anchor" href="index.html#components">Components</a>
</div>
<div class="col-sm nav-ref examples">
<a class="anchor" href="index.html#examples">Examples</a>
</div>
<div class="col-sm nav-ref documentation">
<a class="anchor" href="index.html#docs">Documentation</a>
</div>
<div class="col-sm nav-ref support">
<a class="anchor" href="index.html#support">Support</a>
</div>
<div class="col-sm nav-ref services">
<a class="anchor" href="index.html#services">Services</a>
</div>
<div class="col-sm nav-ref contact">
<a class="anchor" href="index.html#contact">Contact</a>
</div>
<div class="col-sm nav-ref contribute">
<a class="anchor" href="index.html#contribute">Contribute</a>
</div>
</div>
</div>
<div class="titling container-fluid">
<div class="row">
<div class="col-sm-2"></div>
<div class="col-sm">
<img src="i/common/glyph.png" width="256">
</div>
<div class="col-sm">
<div class="titling-brief">
<p>
<a
href="https://download.eclipse.org/passage/downloads/release/2.1.0/fls/">Eclipse
Passage Floating License Server</a><br />is itself a product <a
href="dev-guide.html"><br />licensed with Passage</a>.
</p>
<p>
Let's examine which steps it took<br />to get protected with
license.
</p>
</div>
</div>
<div class="col-sm-2"></div>
</div>
</div>
<div class="separable examples info-section container">
<div class="row">
<div class="step-name col-sm">
<div class="section-header">
Step 1: declare <span class="term">licensing requirements</span>
</div>
</div>
</div>
<div class="row">
<div class="step-explanation col-sm-12">
<p>
FLS <span class="role">architects</span> defined three <span
class="term">feature</span>s for this product, meaning these three
functions are designed to be matched with licensing coverage:
</p>
<ul>
<li><span class="sample">org.eclipse.passage.lbc.fls.product</span>
- feature of the product as a whole and thus must be identified
with the <span class="sample">product id</span>;</li>
<li><span class="sample">org.eclipse.passage.lbc.acquire.concurrent</span>
- base, limited edition of one particular internal function;</li>
<li><span class="sample">org.eclipse.passage.lbc.acquire.concurrent.full</span>
- unlimited edition of the same functionality.</li>
</ul>
<p>
It was also agreed (usually defined by <span class="role">marketing</span>
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.
</p>
<p>The last feature can be used only when licensed properly.</p>
<p>
After evolution, all three features achieve some mature state which
was coined as <span class="sample">2.0.0 version</span>.
</p>
</div>
</div>
<div class="row">
<div class="col-sm-3"></div>
<div class="step-actions col-sm-6">
<p>
Thus, <span class="role">developer</span> declares <span
class="term">licensing requirements</span> for these three <span
class="term">feature</span>s.
</p>
</div>
<div class="col-sm-3"></div>
</div>
<div class="row">
<div class="step-impl col-sm-12">
<div class="step-impl-phase">
<p>
<span class="term">Licensing requirements</span> for the core
product feature <span class="sample">org.eclipse.passage.lbc.fls.product</span>
is declared in <a
href="https://github.com/eclipse-passage/passage/tree/master/bundles/org.eclipse.passage.lbc.fls.seal/META-INF/MANIFEST.MF"
target="_blank">FLS Seal</a> plug-in as it represents the product
on the bundles level:
<pre class="code sh_properties">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"</pre>
</p>
<p>
The requirement is declared with <span class="sample">warn</span>
<span class="term">restriction level</span>, which precisely means
<span class="sample">if there is no license, expose warning
to a user</span>. This work is to be done by the development as well.
</p>
<p>
Development guarantees, that the core <span class="term">feature</span>
identifier is precisely equal to the <span class="sample">product
identifier</span>, which is our case can be found in <a
href="https://github.com/eclipse-passage/passage/blob/master/products/org.eclipse.passage.lbc.fls.product/org.eclipse.passage.lbc.fls.product"
target="_blank">FLS product declaration</a>.
</p>
</div>
<div class="step-impl-phase">
<p>
<span class="term">Licensing requirements</span> for the base
feature <span class="sample">org.eclipse.passage.lbc.acquire.concurrent</span>
is declared in <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.base/META-INF/MANIFEST.MF"
target="_blank">LBC Base</a> bundle: there is no API exposed by
LBC component, thus <span class="term">licensing
requirement</span> for a feature must reside close to its implementation
as a part of the <span class="term">feature</span> contract.
</p>
<p class="note">
Location of the requirements described here is recommended as a
part of approved methodology, but not required. <span class="term">Passage
Access Cycle</span> will find your <span class="term">licensing
requirement</span> in any runtime available bundle.
</p>
</div>
<div class="step-impl-phase">
<p>
<span class="term">Licensing requirements</span> for the premium
feature <span class="sample">org.eclipse.passage.lbc.acquire.concurrent.full</span>
declared next to its basic version.
</p>
<p>
But unlike it, this one is exposed under <span class="sample">error</span>
<span class="term">restriction level</span> as it's not supposed
to be used if not licensed.
</p>
</div>
</div>
</div>
</div>
<div class="separable examples info-section container">
<div class="row ">
<div class="step-name section-header col-sm-12">
Step 2: employ <span class="term">Passage Access Cycle</span>
</div>
</div>
<div class="row ">
<div class="step-explanation col-sm-12">
<p>
<span class="term">Access Cycle</span> is the part of Passage that
runs together with your product and empowers licensing protection
at your product runtime.
</p>
<p>
Three things should be done in you product's code base to utilize <span
class="term">Access Cycle</span>:
</p>
<ul>
<li>add dependency to <a
href="https://github.com/eclipse-passage/passage/tree/master/features/org.eclipse.passage.lic.execute.feature">org.eclipse.passage.lic.execute.feature</a>,
</li>
<li>configure <span class="term">Access Cycle</span>,
</li>
<li>get a <span class="term">product public key</span> from
the <span class="role">management</span> (which generated it with
Passage Operator when next product version is defined and signed
for release) and include it in this version product distribution.
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-sm-3"></div>
<div class="step-actions col-sm-6">
<p>
As FLS is itself <span class="sample">for Passage and on
Passage</span> product, it gains the vital dependency with the rest of
Passage parts necessary for functioning.
</p>
<p>
<span class="term">Access Cycle</span> configuration and <span
class="term">product public key</span> reside in a dedicated
bundle, methodologically called <span class="term">seal</span>.
</p>
</div>
<div class="col-sm-3"></div>
</div>
<div class="row">
<div class="step-impl col-sm-12">
<p>
To configure <span class="term">Access Cycle</span> a <span
class="role">developer</span> must supply instance of <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/Framework.java"
target="_blank">Passage Framework</a> interface by means of the
current infrastructure DI. For Eclipse ecosystem we use <a
href="https://www.osgi.org/" target="_blank">OSGi</a>
implementation.
</p>
<p>
Have a look at <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.fls.seal/src/org/eclipse/passage/lbc/internal/fls/seal/FlsFramework.java">
FlsFramework</a>:
</p>
<ul>
<li>it provides an instance of <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lic.api/src/org/eclipse/passage/lic/api/AccessCycleConfiguration.java"
target="_blank">AccessCycleConfiguration</a>, packed with all
necessary services, to Passage runtime
</li>
<li>and its <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.fls.seal/src/org/eclipse/passage/lbc/internal/fls/seal/FlsFrameworkSupplier.java"
target="_blank">Supplier</a> is declared as <span class="sample">OSGi
Component</span> to be injected into DI container and thus accessible at
Passage runtime.
</li>
</ul>
<p>
The <span class="term">public key</span> file is placed in <a
href="https://github.com/eclipse-passage/passage/tree/master/bundles/org.eclipse.passage.lbc.fls.seal/OSGI-INF">OSGI-INF</a>
folder of the same bundle, which supplies <span class="term">Framework</span>
instance to the Passage runtime. The file <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.fls.seal/build.properties"
target="_blank">is included</a> in the bundle binary build.
</p>
</div>
</div>
</div>
<div class="separable examples info-section container">
<div class="row">
<div class="step-name section-header col-sm-12">Step 3: implant
license checks</div>
</div>
<div class="row">
<div class="step-explanation col-sm-12">
<p>
A product <span class="role">developer</span> appeals to <span
class="term">Access Cycle</span> by means of <span class="term">Passage
Lic API</span> to cover each of the <span class="term">feature</span>s
implementation with licensing protection.
</p>
</div>
</div>
<div class="row ">
<div class="col-sm-3"></div>
<div class="step-actions col-sm-6">
<p>
FLS checks license coverage when each of the <span class="term">feature</span>s,
declared to licensing protection, is going to be executed.
</p>
</div>
<div class="col-sm-3"></div>
</div>
<div class="row">
<div class="step-impl col-sm-12">
<div class="step-impl-phase">
<p>
The first feature, <span class="sample">org.eclipse.passage.lbc.fls.product</span>,
as it denotes the product core <span class="term">feature</span>,
is checked for license coverage each time the server starts up.
</p>
<p>
Have a closer loot at <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lic.jetty/src/org/eclipse/passage/lic/internal/jetty/interaction/LicenseProtection.java"
target="_blank">LicenseProtection</a> class that implements the
check.
</p>
<p>
It has two pairing methods: <br /> <span class="sample">check</span>,
which gets a licensing grant for the <span class="term">feature</span>
and report <span class="samepl">failed check</span> if none is
granted, and<br /> <span class="sample">release</span>, which
returns the grant, it it has indeed been acquired.
</p>
<p>
Correspondingly, <br /> <span class="sample">check</span> <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lic.jetty/src/org/eclipse/passage/lic/internal/jetty/interaction/ServerHandles.java"
target="_blank">is called</a> by <span class="sample">start
server</span> command and <br /> <span class="sample">release</span> is
triggered on <span class="sample">server stop</span>.
</p>
</div>
<div class="step-impl-phase">
<p>
The basic <span class="sample">org.eclipse.passage.lbc.acquire.concurrent</span>
<span class="term">feature</span> is checked when the
corresponding functionality is invoked: when FLS a client tries to
<a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/acquire/AcquiredGrantsStorage.java"
target="_blank">acquire</a> a grant for a product feature under
FLS responsibility.
</p>
</div>
<div class="step-impl-phase">
<p>
And the premium <span class="sample">org.eclipse.passage.lbc.acquire.concurrent.full</span>
<span class="term">feature</span> is checked when the basic
functionality is not enough.
</p>
<p>
Look how <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/acquire/ProtectedGrantCapacity.java"
target="_blank">ProtectedGrantCapacity</a>, which checks if the
premium grant acquisition is properly licensed, is exploited by <a
href="https://github.com/eclipse-passage/passage/blob/master/bundles/org.eclipse.passage.lbc.base/src/org/eclipse/passage/lbc/internal/base/acquire/AcquiredGrantsStorage.java"
target="_blank"> AcquiredGrantsStorage</a>, which, in turn, is
responsible for the grant acquisition in general.
</p>
</div>
</div>
</div>
</div>
<div class="footer legal container-fluid">
<div class="row">
<div class="col-sm-8">
<div>© Copyright 2018 - 2021 ArSysOp</div>
</div>
<div class="col-sm">
<a href="https://projects.eclipse.org/projects/technology.passage"
target="_blank">About</a>
</div>
<div class="col-sm">
<a href="https://spdx.org/licenses/EPL-2.0.html" target="_blank">Terms
of use</a>
</div>
</div>
</div>
<div class="footer refs container-fluid">
<div class="row">
<div class="col-sm-6"></div>
<div class="col-sm">
Site is constructed with <a
href="https://github.com/twbs/bootstrap/">Bootstrap</a>.
</div>
<div class="col-sm">
<a
href="https://fonts.google.com/specimen/Quicksand?query=Quicksand"
target="_blank">Quicksand</a> and <a
href="https://fonts.google.com/specimen/Open+Sans?query=Montserrat"
target="_blank">Montserrat</a> fonts are used.
</div>
<div class="col-sm">
<a href="http://shjs.sourceforge.net/" target="_blank">SHJS</a> is
used to highlight syntaxes.
</div>
</div>
</div>
</body>
</html>