mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-09-05 08:17:31 +00:00
* #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>
This commit is contained in:
co-authored by
Sashir Estela
Ilkka Seppälä
parent
4b704c807f
commit
f65bb820d8
@@ -0,0 +1,63 @@
|
||||
@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
|
||||
Reference in New Issue
Block a user