{"id":16378079,"url":"https://github.com/kezz/jmodules","last_synced_at":"2025-09-01T03:38:04.236Z","repository":{"id":57736632,"uuid":"11735673","full_name":"kezz/JModules","owner":"kezz","description":"A simple module framework for Java","archived":false,"fork":false,"pushed_at":"2020-10-13T07:41:19.000Z","size":23,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-26T21:30:35.372Z","etag":null,"topics":[],"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/kezz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-29T09:14:14.000Z","updated_at":"2019-11-12T18:52:26.000Z","dependencies_parsed_at":"2022-08-24T03:01:10.523Z","dependency_job_id":null,"html_url":"https://github.com/kezz/JModules","commit_stats":null,"previous_names":["kezz101/jmodules"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kezz/JModules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezz%2FJModules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezz%2FJModules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezz%2FJModules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezz%2FJModules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kezz","download_url":"https://codeload.github.com/kezz/JModules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kezz%2FJModules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273070041,"owners_count":25040191,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-11T03:44:33.721Z","updated_at":"2025-09-01T03:38:04.217Z","avatar_url":"https://github.com/kezz.png","language":"Java","readme":"# JModules\n\n[![Current Version](https://img.shields.io/github/release/Kezz101/JModules.svg)](https://github.com/Kezz101/JModules/releases)\n[![Maven Central](https://img.shields.io/maven-central/v/me.kieranwallbanks/jmodules.svg)](https://mvnrepository.com/artifact/me.kieranwallbanks/jmodules)\n[![Build Status](https://img.shields.io/travis/Kezz101/JModules/master.svg)](https://travis-ci.org/Kezz101/JModules)\n[![Total Downloads](https://img.shields.io/github/downloads/Kezz101/JModules/total.svg)](https://github.com/Kezz101/JModules/releases)\n[![Issues](https://img.shields.io/github/issues/Kezz101/JModules.svg)](https://github.com/Kezz101/JModules/issues)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)\n\n\nA simple module framework for Java\n\n## Introduction\nJModules is a simple Java framework that makes creating additional modules easy. All you have to do is implement a class\nand let JModules do the rest.\n\n## How to use JModules\nUsing JModules in your project is as easy as 1, 2, 3.\n\n1. Implement the `Module` class\n2. Create a `ModuleManager`\n3. Add some packages\n\nThen you can access, enable or disable modules to your hearts content!\n\n### Implementing the `Module` class\nEach module is represented by a simple interface, meaning implementing it is super simple. \n\n````java\npublic class MyModule implements Module {\n    \n    @Override\n    public void onEnable() {\n        // do some enabling\n    }\n    \n    @Override\n    public void onDisable() {\n        // do some disabling\n    }\n}\n````\n\nYou can also define a custom name for a module and define other modules that this module depends on.\n\n````java\npublic class MyAdvancedModule implements Module {\n    \n    @Override\n    public void onEnable() {\n        // do some enabling\n    }\n    \n    @Override\n    public void onDisable() {\n        // do some disabling\n    }\n    \n    @Override\n    public String getName() {\n        return \"CustomName\";\n    }\n       \n    @Override\n    public String[] getDependencies() {\n        return new String[]{\"MyModule\"};\n    }\n}\n````\n\n### Creating a `ModuleManager`\nThe `ModuleManager` class is the main class used in JModules. Firstly, you need to create your own instance of the `ModuleManager` like so:\n\n````java\nModuleManager myManager = new ModuleManager();\n````\n\nYou can also add any amount of runnables to be executed whenever a module is added. This can be used to store each module\nor register them in some other external system.\n\nEach `ModuleInterfaceRunnable` is added to the `ModuleManager` during instantiation.\n\n````java\nModuleManager myManager = new ModuleManager(new ModuleInterfaceRunnable(MyInterface.class) {\n    \n    @Override\n    public void run(Module module) {\n        // do some more things with the module\n    }\n});\n````\n\n### Adding the modules\nJModules works by searching a package and adding any `Module`s found to the `ModuleManager`. This is done by supplying\nthe `ModuleManager` with a package to search, a `ClassLoader` to search through. You can also ask the `ModuleManager` to\nignore a set of classes if you like.\n\n````java\nmyManager.addModulesFromPackage(\"com.mypackage\", System.classLoader(), IgnoreMe.class);\n````\n\nYou can also add modules by yourself using the `addModule` method.\n\n### Finishing up\nOnce you are done you can enable and disable modules using the methods supplied in the `ModuleManager`.\n\n## Final bits\nThanks for using JModules! I originally created this because I am lazy and couldn't be bothered to implement something\nlike this for each project I would use it in, but I decided to upload it to the world in the hopes someone else would\nfind it useful!\n\nIf you need any help or have any issues or suggestions, please let me know!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkezz%2Fjmodules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkezz%2Fjmodules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkezz%2Fjmodules/lists"}