- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-->
<svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"contentStyleType="text/css"height="4174.3px"preserveAspectRatio="none"style="width:1504px;height:4174px;background:#FFFFFF;"version="1.1"viewBox="0 0 1504 4174"width="1504.8px"zoomAndPan="magnify"><defs/><g><rectfill="none"height="55.229"id="_title"style="stroke:none;stroke-width:1.8999999999999997;"width="309.7"x="589.95"y="19"/><textfill="#000000"font-family="sans-serif"font-size="26.6"font-weight="bold"lengthAdjust="spacing"textLength="290.7"x="599.45"y="56.9353">Lifecycle of an activity</text><rectfill="#FFFFFF"height="245.3243"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="263.15"y="1202.7971"/><rectfill="#FFFFFF"height="904.8677"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="263.15"y="1666.8457"/><rectfill="#FFFFFF"height="343.5657"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="263.15"y="2718.7962"/><rectfill="#FFFFFF"height="528.09"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="263.15"y="3303.3276"/><rectfill="#FFFFFF"height="64.729"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="749.55"y="2122.7357"/><rectfill="#FFFFFF"height="548.5605"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="926.25"y="1983.2528"/><rectfill="#FFFFFF"height="26.6"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="926.25"y="3533.4519"/><rectfill="#FFFFFF"height="26.6"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="926.25"y="3671.0348"/><rectfill="#FFFFFF"height="26.6"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="1260.65"y="1323.28"/><rectfill="#FFFFFF"height="26.6"style="stroke:#181818;stroke-width:1.8999999999999997;"width="19"x="1260.65"y="2948.9205"/><rectfill="none"height="646.2434"style="stroke:#000000;stroke-width:2.8499999999999996;"width="1325.25"x="147.25"y="1900.77"/><rectfill="none"height="124.2829"style="stroke:#000000;stroke-width:2.8499999999999996;"width="913.9"x="147.25"y="3588.5519"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="49.4"x2="49.4"y1="255.1162"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="272.65"x2="272.65"y1="437.9721"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="609.9"x2="609.9"y1="590.2302"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="759.05"x2="759.05"y1="778.7173"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="935.75"x2="935.75"y1="1024.8583"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="1129.55"x2="1129.55"y1="255.1162"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="1270.15"x2="1270.15"y1="255.1162"y2="4004.542"/><linestyle="stroke:#181818;stroke-width:0.9499999999999998;stroke-dasharray:5.0,5.0;"x1="1395.55"x2="1395.55"y1="2119.5588"y2="4004.542"/><textfill="#000000"font-family="sans-serif"font-size="26.6"lengthAdjust="spacing"textLength="70.3"x="9.5"y="247.3224">caller</text><ellipsecx="50.35"cy="188.4871"fill="#E2E2F0"rx="22.8"ry="22.8"style="stroke:#181818;stroke-width:0.9499999999999998;"/><polygonfill="#181818"points="42.75,165.6871,54.15,156.1871,50.35,165.6871,54.15,175.1871,42.75,165.6871"style="stroke:#181818;stroke-width:1.8999999999999997;"/><textfill="#000000"font-family="sans-serif"font-size="26.6"lengthAdjust="spacing"textLength="70.3"x="9.5"y="4031.0772">caller</text><ellipsecx="50.35"cy="4069.271"fill="#E2E2F0"rx="22.8"ry="22.8"style="stroke:#181818;stroke-width:0.9499999999999998;"/><polygonfill="#181818"points="42.75,4046.471,54.15,4036.971,50.35,4046.471,54.15,4055.971,42.75,4046.471"
@startuml
'https://plantuml.com/sequence-diagram
title: Lifecycle of an activity
control caller as caller
control ActivityExecutor as ae
control "Activity\nException\nHandler" as aeh
control "Activity\nThread\nFactory" as atf
control ExecutorService as aes
control Annotator as ann
control Activity as activity
== startup sequence ==
caller -> ae**: create
ae -> aeh**: create
ae -> atf**: create(\w Exception Handler)
aeh -> atf: <injected\nviactor>
ae -> aes**: create(\w Thread Factory)
atf -> aes: <injected\nviactor>
caller -> ae: startActivity()
activate ae
ae -> ann: Annotate Activity Start
ae -> activity: initActivity()
activate activity
ae <-activity
deactivate activity
note over ae,aes: align threadcount as explained below
caller <-ae
deactivate ae
== dynamic threadcount update ==
note over ae, aes: threads can be changed dynamically
caller -> ae: apply params
activate ae
ae->ae: align motor count
ae->aes: stop extra motors
ae->aes: <startmissingmotors>
group for each new thread/motor
ae -> aes: execute(<motor>)
activate aes
aes -> atf: get()
atf -> thread**: create
activate atf
aes <-atf:<thread>
deactivate atf
aes - -> thread: run()
note over ann, thread: At this point, the\nmotor thread starts running\nthe defined activity's action\nover cycles