Commit 1922932
committed
fix: Address Issue #23 - Resource management for singleton ParentPomResolver
Added JVM shutdown hook to automatically clean up ParentPomResolver resources:
- Shutdown hook calls close() on the singleton instance when JVM exits
- This ensures repositorySystem.shutdown() is called exactly once
- No need for individual MuleApplication instances to close the shared resolver
Updated AGENTS.md to document the singleton resource management:
- Documented that singleton is automatically cleaned up via shutdown hook
- Clarified that application code should NOT call close() on the singleton
- Explained when to use new ParentPomResolver() for custom lifecycle
Fixed Groovy syntax for shutdown hook (closure syntax works, Java Thread syntax failed):
- Changed from 'new Thread({...} as Runnable)' to simple closure 'Runtime.addShutdownHook {...}'
All 224 tests pass.1 parent 54f6528 commit 1922932
2 files changed
Lines changed: 26 additions & 4 deletions
File tree
- mule-linter-spi/src/main/groovy/com/avioconsulting/mule/linter/resolver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
| 180 | + | |
180 | 181 | | |
181 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
182 | 190 | | |
183 | 191 | | |
184 | 192 | | |
| |||
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
193 | | - | |
194 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
195 | 209 | | |
196 | 210 | | |
197 | 211 | | |
| |||
0 commit comments