Skip to content

Extract plugin runtime lifecycle coordination - #301

Merged
BenCodez merged 7 commits into
masterfrom
refactor/plugin-lifecycle
Aug 25, 2026
Merged

BenCodez merged 7 commits into
masterfrom
refactor/plugin-lifecycle

Conversation

@BenCodez

Copy link
Copy Markdown
Owner

Summary

Move AdvancedCore runtime executor ownership and shutdown sequencing out of the large AdvancedCorePlugin class while keeping its existing public getters as the compatibility facade.

Runtime bootstrap

  • add AdvancedCoreLifecycle.createRuntimeExecutors(...) for the Bukkit scheduler plus the existing general, login, and inventory scheduled executors
  • keep the executors separate exactly as before
  • have onEnable() assign the returned runtime objects to the existing plugin fields/getters

Shutdown

  • move the shutdown sequence into AdvancedCoreLifecycle
  • make individual cleanup stages best-effort so one integration failure does not prevent later resources from being released
  • make executor/time-checker cleanup null-safe for partial startup failures
  • preserve graceful shutdown() + bounded awaitTermination(...) before shutdownNow()
  • restore the thread interruption flag if shutdown waiting is interrupted
  • explicitly stop FullInventoryHandler before its final persistence snapshot
  • retain MySQL, reward, skull cache, hologram, permission, dialog, unload-hook, and JavaScript shutdown behavior
  • keep javaPlugin = null in AdvancedCorePlugin.onDisable() after coordinated cleanup

Tests

  • verifies runtime executor ownership remains separated
  • verifies coordinated executor shutdown/await behavior
  • verifies reward and full-inventory cleanup/persistence and the plugin unload hook run through the lifecycle coordinator

No plugin configuration keys or public lifecycle getters are removed or renamed.

@BenCodez
BenCodez marked this pull request as ready for review August 24, 2026 23:17
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@BenCodez
BenCodez merged commit 22c732f into master Aug 25, 2026
4 checks passed
@BenCodez
BenCodez deleted the refactor/plugin-lifecycle branch August 25, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant