{"id":20752535,"url":"https://github.com/ghost-chu/simplereloadlib","last_synced_at":"2026-03-15T05:14:35.434Z","repository":{"id":41955723,"uuid":"454122902","full_name":"Ghost-chu/SimpleReloadLib","owner":"Ghost-chu","description":"Simple but useful generic reload library for Java projects.","archived":false,"fork":false,"pushed_at":"2023-06-16T11:00:17.000Z","size":107,"stargazers_count":12,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T14:21:46.430Z","etag":null,"topics":["java","libraries","reload","simple"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ghost-chu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-31T18:29:08.000Z","updated_at":"2025-03-31T12:54:05.000Z","dependencies_parsed_at":"2024-11-17T23:15:28.180Z","dependency_job_id":null,"html_url":"https://github.com/Ghost-chu/SimpleReloadLib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghost-chu%2FSimpleReloadLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghost-chu%2FSimpleReloadLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghost-chu%2FSimpleReloadLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghost-chu%2FSimpleReloadLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghost-chu","download_url":"https://codeload.github.com/Ghost-chu/SimpleReloadLib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251326952,"owners_count":21571659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","libraries","reload","simple"],"created_at":"2024-11-17T08:41:57.736Z","updated_at":"2026-03-15T05:14:35.403Z","avatar_url":"https://github.com/Ghost-chu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleReloadLib\nSimple Java generic reload library.\n\n## Introduce\nSimpleReloadLib isvused to be a part of QuickShop-Reremake. But it is really easy to use and powerful, so I made it to a standalone lib.   \nYou can insert this to any Java project including Bukkit, Paper, BungeeCord, Forge, Fabric etc.  \nThis lib  is already used in QuickShop-Reremake over 1 year and no errors were found.\n\n## Features\n* Reloading mechanism based on registration order, no need to worry about reload order。\n* Simple and easy to use, just need to register with eyes closed.\n* Lightweight, powered by 5 java classes. You can package it into any project.\n* WeakReference to save your memory and prevent memory leaking.\n* Support both object and static method.\n\n## How to use\n\n1. Create a Reload Manager\n```java\nReloadManager reloadManager = new ReloadManager();\n```\n\n2. Implement Reloadable and register it into ReloadManager (or static method if register for static util)\n\n```java\npublic class Example implements Reloadable {\n    public Example(){\n        Instance.getReloadManager().register(this);\n    }\n    \n    @Override\n    public ReloadResult reloadModule() throws Exception {\n        try{\n            // Reload code here\n             return ReloadResult.builder().status(ReloadStatus.SUCCESS).build();\n        } catch (IllegalStateException scheduleException) {\n              return ReloadResult.builder().status(ReloadStatus.SCHEDULED).reason(\"Resource in use\").build();\n        } catch (RuntimeException requireRestartException) {\n              return ReloadResult.builder().status(ReloadStatus.REQUIRE_RESTART).reason(\"Restart required\").build();\n        } catch (Exception otherException){\n              return ReloadResult.builder().status(ReloadStatus.EXCEPTION).exception(otherException).reason(\"Unkown error raised\").build();\n        }\n        // If there have any Exception not be catched, Manager will catch it and report with ReloadStatus.EXCEPTION\n    }\n}\n```\n\n3. Reload it!\n\n```java\nMap\u003cReloadableContainer, ReloadResult\u003e results = reloadManager.reload();\nMap\u003cReloadableContainer, ReloadResult\u003e results = reloadManager.reload(Example.class);\n```\n\n## Registerable reloadables\n\n* Any classes that implement Reloadable\n* Any no args and returns ReloadResult static Method\n\n## Get summary\n\nSimpleReloadLib offers a Map contains ReloadContainer and ReloadResults：\n\n* SUCCESS - Successfully to reloading.\n* OUTDATED - WeakReferenced object already invalid and will be removed in next reload.\n* REQUIRE_RESTART - Reload is impossible, restart required.\n* SCHEDULED - Cannot reload in this time but already scheduled reloading if possible.\n* EXCEPTION - Something just exploded\n\n## Maven\n\nWe're in central.\n\n```xml\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.ghostchu\u003c/groupId\u003e\n            \u003cartifactId\u003esimplereloadlib\u003c/artifactId\u003e\n            \u003cversion\u003e1.1.2\u003c/version\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghost-chu%2Fsimplereloadlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghost-chu%2Fsimplereloadlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghost-chu%2Fsimplereloadlib/lists"}