plugin_services.md: add flowgraph

This commit is contained in:
Yann Cébron 2021-08-31 17:25:24 +02:00
parent 2ecb61eca0
commit 5d5ac1796d
3 changed files with 209 additions and 0 deletions

View File

@ -0,0 +1,53 @@
@startuml
:getService;
note right
In any thread.
Get on demand only.
Do not cache result.
Do not request in constructor unless needed.
end note
if (Is Light Service) then (yes)
else (no)
if (Is Service Declaration Found) then (yes)
else (no)
:Return ""null"";
detach
endif
endif
if (Is Created and Initialized?) then (yes)
else (no)
if (Is Container Active?) then (active)
partition "synchronized on service class" {
if (Is Created and Initialized?) then (yes)
else (no)
if (Is Initializing?) then (yes)
:Throw ""PluginException""
Cyclic Service Initialization;
detach
else (no)
partition "non cancelable" {
:Create Instance]
note right
Avoid getting other services to reduce initialization tree.
As less dependencies, as more faster and reliable.
end note
:Register to be Disposed on Container Dispose
if Implements ""Disposable""]
:Load Persistent State
if Implements ""PersistentStateComponent""]
}
endif
endif
}
else (disposed or dispose in progress)
:Throw ""ProcessCanceledException"";
detach
endif
endif
:Return Instance;
@enduml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -99,6 +99,12 @@ val projectService = project.service<MyProjectService>()
</tabs> </tabs>
<procedure title="Getting Service Flow" initial-collapse-state="collapsed">
![Getting Service](getting_service.svg)
</procedure>
## Project Service Sample ## Project Service Sample
This minimal sample shows [Light Service](#light-services) `ProjectService` interacting with another project level service `AnotherService` (not shown here). This minimal sample shows [Light Service](#light-services) `ProjectService` interacting with another project level service `AnotherService` (not shown here).