()
| 32 | } |
| 33 | |
| 34 | static synchronized void runShutdownActions() { |
| 35 | // Execute shutdown actions in reverse add order. |
| 36 | for (int i = shutdownActions.size() - 1; i >= 0; --i) { |
| 37 | Runnable action = shutdownActions.get(i); |
| 38 | |
| 39 | try { |
| 40 | action.run(); |
| 41 | } catch (Throwable error) { |
| 42 | error.printStackTrace(); |
| 43 | logger.error("failed run shutdown action", error); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | shutdownActions.clear(); |
| 48 | } |
| 49 | } |