You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: eu.dariolucia.reatmetric.driver.example/Documentation.adoc
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,14 @@ This part of the documentation provides a step-by-step guide on how to create, i
2
2
driver from scratch. This guide will assume adequate knowledge of Java and Maven.
3
3
4
4
The example driver presented here is very simple:
5
+
5
6
- it implements a connector, that can be started and stopped.
6
-
- When the connector is started, the driver publishes a single parameter value every second to the ReatMetric processing model,
7
-
increasing its value by one;
7
+
- When the connector is started, the driver publishes a single parameter value every second to the ReatMetric processing model, increasing its value by one;
8
8
- it raises one event when the counter is a multiple of 10;
9
9
- it handles an activity that resets the counter to 0.
10
10
11
-
==== Step 1: create a new Maven project
11
+
==== Step 1: Create a new Maven project
12
+
12
13
Create an empty folder and put inside this folder the pom file and the necessary Maven folders. As a minimum, the folder
13
14
src/main/java needs to exist. The pom file must contain as a minimum the dependencies to the API and Core modules.
14
15
@@ -80,7 +81,7 @@ By running:
80
81
81
82
the project should build with errors.
82
83
83
-
==== Step 2: create the driver module file and the class entrypoint
84
+
==== Step 2: Create the driver module file and the class entrypoint
84
85
85
86
Create the file module-info.java with the information about the module dependencies. As a minimum, the following dependencies
86
87
shall be listed.
@@ -128,7 +129,7 @@ open module eu.dariolucia.reatmetric.driver.example {
128
129
}
129
130
----
130
131
131
-
==== Step 3: initialise the driver from the configuration
132
+
==== Step 3: Initialise the driver from the configuration
132
133
133
134
The driver needs to know which are the IDs of the related parameter and event objects in the processing model, as well
134
135
as to know the ID of the supported activity. The approach used for this example is very simple: the configuration string
@@ -172,7 +173,7 @@ public class ExampleDriver extends AbstractDriver {
172
173
}
173
174
----
174
175
175
-
==== Step 4: add a connector, implement data injection in the processing model
176
+
==== Step 4: Add a connector, implement data injection in the processing model
176
177
177
178
Create a class in the package eu.dariolucia.reatmetric.driver.example, named ExampleConnector and extending from the
178
179
AbstractConnector class, as shown below. This class is used to control the start and stop of the parameter publication.
@@ -252,6 +253,7 @@ public class ExampleConnector extends AbstractTransportConnector {
252
253
----
253
254
254
255
The ExampleDriver class must now be extended to:
256
+
255
257
- Create the connector in the starting phase;
256
258
- Return the connector as supported connector;
257
259
- Implement the newValue(long) method.
@@ -314,7 +316,7 @@ public class ExampleDriver extends AbstractDriver {
314
316
}
315
317
----
316
318
317
-
==== Step 5: add an activity handler
319
+
==== Step 5: Add an activity handler
318
320
319
321
Create a class in the package eu.dariolucia.reatmetric.driver.example, named ExampleHandler and implementing the
320
322
IActivityHandler interface, as shown below. This class is used to manage the requests of activity executions.
@@ -384,6 +386,7 @@ public class ExampleHandler implements IActivityHandler {
384
386
----
385
387
386
388
The ExampleDriver class must now be extended to:
389
+
387
390
- Create the activity handler in the starting phase;
388
391
- Return the activity handler as supported connector;
389
392
- Implement the necessary methods to implement the activity occurrence lifecycle.
@@ -586,7 +589,7 @@ public class ExampleConnector extends AbstractTransportConnector {
586
589
}
587
590
----
588
591
589
-
==== Step 6: prepare the processing model definition
592
+
==== Step 6: Prepare the processing model definition
0 commit comments