Skip to content
Permalink
Browse files

[Wiki,TS] Add documentation for new arbitration strategy FixedPartici…

…pantId
  • Loading branch information
Abdu Almamou guidoostkampdebertrandtcom
Abdu Almamou authored and guidoostkampdebertrandtcom committed Mar 17, 2020
1 parent 77ef754 commit 9e2efc55292430241a12d7e1c18c5457b11c674a
Showing with 26 additions and 8 deletions.
  1. +5 −0 wiki/ReleaseNotes.md
  2. +21 −8 wiki/javascript.md
@@ -17,6 +17,11 @@ None.
* **[All, Generator]** The generator can now be optionally be called via command line
parameter or plugin configuration to restrict code generation to only proxy or provider
side. The default is to generate code for both sides. Details can be found [here](generator.md).
* **[TS]** Introduced ArbitrationStrategy `FixedParticipant`, for details, see
[JavaScript documentation](javascript.md#the-discovery-quality-of-service).
* **[TS]** Introduced ArbitrationConstants to be used for arbitration strategies `Keyword` and
`FixedParticipant`, for more details see
[JavaScript documentation](javascript.md#the-discovery-quality-of-service).

## Configuration property changes
None.
@@ -92,7 +92,7 @@ against it and it's now recommended to use the types directly.
* Importing from on top of joynr makes mocking more difficult.
* Importing from on top of joynr creates unnecessary dependencies to the rest of the joynr code.

Any other objects created by the runtime should be taken from the runtime and not imported directly.
Any other objects created by the runtime should be taken from the runtime and not imported directly.

```typescript
import joynr = require("joynr");
@@ -200,23 +200,30 @@ the result of `myFunction.bind(myParam)` has to be used as arbitration strategy.
* **ArbitrationStrategyCollection.Nothing** use DefaultArbitrator which picks the first discovered
entry with compatible version
* **ArbitrationStrategyCollection.HighestPriority** Highest priority provider will be selected
* **ArbitrationStrategyCollection.FixedParticipant** select provider which matches the
participantId provided as a custom parameter in DiscoveryQos (see below), if existing
* **ArbitrationStrategyCollection.Keyword** Only a Provider that has keyword set will be selected
**Default arbitration strategy:** ```ArbitrationStrategyCollection.LastSeen```
The priority used by the arbitration strategy *HighestPriority* is set by the provider in its
providerQos settings.
**Predefined arbitration constants**
defines keys for the key-value pair for the custom Parameters of discoveryScope:
* ** KEYWORD_PARAMETER**: required custom parameter for ArbitrationStrategy.Keyword
* ** FIXED_PARTICIPANT_PARAMETER**: required custom parameter for
ArbitrationStrategy.FixedParticipant
Example for setting up a ```DiscoveryQos``` object:
```typescript
// additionalParameters unclear
// there is currently no ArbitrationConstants in Javascript like in Java
// { "keyword" : "someKeyword" }
// { "fixedParticipantId" : "someParticipantId" }
// { }
import DiscoveryQos from 'joynr/joynr/proxy/DiscoveryQos';
import {LastSeen} from 'joynr/joynr/types/ArbitrationStrategyCollection';
import {LOCAL_THEN_GLOBAL} from 'joynr/joynr/types/DiscoveryScope';
import {KEYWORD_PARAMETER} from "joynr/joynr/types/ArbitrationConstants";
import {FIXED_PARTICIPANT_PARAMETER} from "joynr/joynr/types/ArbitrationConstants";
const discoveryQos = new DiscoveryQos({
discoveryTimeoutMs : 30000,
@@ -225,11 +232,17 @@ const discoveryQos = new DiscoveryQos({
cacheMaxAgeMs : 0,
discoveryScope : LOCAL_THEN_GLOBAL,
providerMustSupportOnChange : false,
// additional parameters are used for arbitration strategy Keyword (key: "keyword")
// additional parameters are used for predefined arbitration strategies:
// Keyword and FixedParticipant
// or can be used for custom arbitration strategies
additionalParameters : {
// required parameter for arbitration strategy FixedParticipant:
[FIXED_PARTICIPANT_PARAMETER]: "expectedParticipantId",
// required parameter for arbitration strategy Keyword:
[KEYWORD_PARAMETER]: "expectedKeyword",
// additional parameters for custom arbitration strategy:
"key1": "value1",
// ...
// ...
"keyN": "valueN"
}
});

0 comments on commit 9e2efc5

Please sign in to comment.
You can’t perform that action at this time.