docs: update dynamic proxy

This commit is contained in:
Ilkka Seppälä
2024-05-25 16:24:36 +03:00
parent 30cb525c04
commit e3c3b055f5
6 changed files with 193 additions and 163 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

@@ -1,35 +0,0 @@
@startuml
class A as "App" {
}
interface I as "MyInterface" {
someMethod(args)
otherMethods(args)
}
class P as "Proxy" <<Built-In>> {
{static} DynamicProxy newProxyInstance(\n classLoader,\n interfaces,\n invocationHandler\n)
}
class D as "DynamicProxy" {
someMethod(args)
otherMethods(args)
}
class H as "InvocationHandler" {
invoke(proxy, method, args)
}
class X as "AuxiliarProcessor" {
process(method, args)
}
A -r-> D
I <|.. D : implements
D -r-> H : delegate
H -r-> X : (optional)
@enduml
Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

@@ -1,63 +0,0 @@
@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
Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB