mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 12:58:37 +00:00
f65bb820d8
* #2542 First commit * #2542 Fixing comments * #2542 Refactoring code * #2542 Update Readme * #2542 Add mockito dependencies * #2542 Add unit test * #2542 Fixes for testing * #2542 Fixing typos * #2542 Fixing SonarLint issues * #2542 Fixing code review --------- Co-authored-by: Sashir Estela <sashirestela@yahoo.com> Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
64 lines
939 B
Plaintext
64 lines
939 B
Plaintext
@startuml
|
|
|
|
participant App as A
|
|
participant Proxy as P <<Built-In>>
|
|
participant DynamicProxy as D <<MyInterface>>
|
|
participant InvocationHandler as H
|
|
participant AuxiliarProcessor as R
|
|
|
|
== Create Dynamic Proxy ==
|
|
|
|
create H
|
|
A -> H : new(args)
|
|
activate H
|
|
|
|
create R
|
|
H -> R : new(args)
|
|
activate R
|
|
|
|
R --> H : processor
|
|
deactivate R
|
|
|
|
H --> A : invocationHandler
|
|
deactivate H
|
|
|
|
|||
|
|
|
|
A -> P : newProxyInstance(\n classLoader,\n new Class<?>[]{MyInterface.class},\n invocationHandler\n)
|
|
activate P
|
|
|
|
create D
|
|
P -> D : new
|
|
activate D
|
|
|
|
D --> P : dynamicProxy
|
|
deactivate D
|
|
|
|
P --> A : dynamicProxy
|
|
deactivate P
|
|
|
|
== Call Interface's Method ==
|
|
|
|
A -> D : someMethod(args)
|
|
activate D
|
|
|
|
D -> H : invoke(proxy, method, args)
|
|
activate H
|
|
|
|
H -> R : process(method, args)
|
|
activate R
|
|
|
|
R -> R : parse method's\nmetadata
|
|
R -> R : execute some\nprocessing
|
|
|
|
R --> H : response
|
|
deactivate R
|
|
|
|
H --> D : response
|
|
deactivate H
|
|
|
|
D --> A : response
|
|
deactivate D
|
|
|
|
@enduml
|