Commit 9e7fedb
refactor(rmi): convert Helper.narrow() to MethodHandle with caching
Convert Method.invoke() to MethodHandle.invoke() for IDL Helper narrow()
calls in PortableRemoteObjectImpl with ClassValue-based caching.
Changes:
- Added HELPER_NARROW_CACHE using ClassValue<MethodHandle>, mapping from
helper class to its "narrow" method
- Updated narrowIDL() to use cached MethodHandle instead of Method.invoke()
- Simplified exception handling with consistent pattern
- Updated MultiAddressUrlTest to remove InvocationTargetException from expected causal chains, as MethodHandle.invoke() does not add this wrapper layer (unlike the old Method.invoke() approach)
- Fixed exception handling in StubWriteReplaceMethodHolder to properly unwrap PrivilegedActionException
- Lines added: 29, lines removed: 13
Performance: ClassValue provides thread-safe per-class caching without locks
Co-authored-by: Joe Chacko <chackoj@uk.ibm.com>
Co-authored-by-AI: IBM Bob 1.0.41 parent e10948a commit 9e7fedb
2 files changed
Lines changed: 31 additions & 15 deletions
File tree
- yoko-rmi-impl/src/main/java/org/apache/yoko/rmi/impl
- yoko-verify/src/test/java-testify/org/apache/yoko
Lines changed: 27 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
| |||
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 144 | | |
| 145 | + | |
| 146 | + | |
133 | 147 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
| |||
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
242 | | - | |
| 258 | + | |
243 | 259 | | |
244 | 260 | | |
245 | 261 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
0 commit comments