{"id":37027000,"url":"https://github.com/tvrzna/wireable","last_synced_at":"2026-01-14T03:11:32.098Z","repository":{"id":57730151,"uuid":"246240372","full_name":"tvrzna/wireable","owner":"tvrzna","description":"Simple Java singleton dependency injection via Reflections.","archived":false,"fork":false,"pushed_at":"2023-06-27T06:24:47.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T18:21:32.031Z","etag":null,"topics":["application-context","dependency-injection","java","reflection"],"latest_commit_sha":null,"homepage":null,"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/tvrzna.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}},"created_at":"2020-03-10T07:57:48.000Z","updated_at":"2022-08-25T06:44:17.000Z","dependencies_parsed_at":"2022-09-07T20:31:15.123Z","dependency_job_id":null,"html_url":"https://github.com/tvrzna/wireable","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tvrzna/wireable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvrzna%2Fwireable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvrzna%2Fwireable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvrzna%2Fwireable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvrzna%2Fwireable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tvrzna","download_url":"https://codeload.github.com/tvrzna/wireable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tvrzna%2Fwireable/sbom","scorecard":{"id":903442,"data":{"date":"2025-08-11","repo":{"name":"github.com/tvrzna/wireable","commit":"7ae70d5a278becdea8ea050b504dae202a48aca0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/tvrzna/wireable/maven.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/tvrzna/wireable/maven.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.3.4 not signed: https://api.github.com/repos/tvrzna/wireable/releases/108769633","Warn: release artifact 0.3.3 not signed: https://api.github.com/repos/tvrzna/wireable/releases/76357758","Warn: release artifact 0.3.2 not signed: https://api.github.com/repos/tvrzna/wireable/releases/75762196","Warn: release artifact 0.3.1 not signed: https://api.github.com/repos/tvrzna/wireable/releases/75437609","Warn: release artifact 0.3.0 not signed: https://api.github.com/repos/tvrzna/wireable/releases/38246543","Warn: release artifact 0.3.4 does not have provenance: https://api.github.com/repos/tvrzna/wireable/releases/108769633","Warn: release artifact 0.3.3 does not have provenance: https://api.github.com/repos/tvrzna/wireable/releases/76357758","Warn: release artifact 0.3.2 does not have provenance: https://api.github.com/repos/tvrzna/wireable/releases/75762196","Warn: release artifact 0.3.1 does not have provenance: https://api.github.com/repos/tvrzna/wireable/releases/75437609","Warn: release artifact 0.3.0 does not have provenance: https://api.github.com/repos/tvrzna/wireable/releases/38246543"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T16:30:19.913Z","repository_id":57730151,"created_at":"2025-08-24T16:30:19.914Z","updated_at":"2025-08-24T16:30:19.914Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["application-context","dependency-injection","java","reflection"],"created_at":"2026-01-14T03:11:31.475Z","updated_at":"2026-01-14T03:11:32.093Z","avatar_url":"https://github.com/tvrzna.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wireable\n[![Release](https://img.shields.io/github/release/tvrzna/wireable.svg)](https://github.com/tvrzna/wireable/releases/latest)\n[![javadoc](https://javadoc.io/badge2/cz.tvrzna/wireable/0.3.4/javadoc.svg)](https://javadoc.io/doc/cz.tvrzna/wireable/0.3.4)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/tvrzna/wireable/.github/workflows/maven.yml?branch=master\u0026style=flat-square)](https://github.com/tvrzna/wireable/actions?query=workflow:Build)\n[![GitHub](https://img.shields.io/github/license/tvrzna/wireable)](https://github.com/tvrzna/wireable)\n\nSimple Java singleton dependency injection via Reflections.\n\n## What is wireable good for?\nAlmost everyone, who is used to dependency injections, likes the idea of injecting of services via an annotation in a class. For some microprojects or microservices could be Deltaspike, Spring, etc. incredible large with many function, that will not be used.\n\n## How does it works?\nWireable allows to create very simple application context, that scans defined package (and its subpackages). All classes with annotation `@Wireable` are added into the mentioned application context as an instance. These classes will have injected all members with annotation `@Wired` with reflections and then all methods (without arguments) with annotations `@OnCreate` and `@OnStartup` are executed.\n\n## Interfaces as @Wired\nSince `0.3.0` interfaces are supported as @Wired classes. If multiple classes points to similar interface, it it better to specify in your `@Wireable` annotation the `priorityFor` value by interface class.\n\n## But why?\nWireable is dependency-free with minimal size in units of kilobytes.\n\n## Installation\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecz.tvrzna\u003c/groupId\u003e\n    \u003cartifactId\u003ewireable\u003c/artifactId\u003e\n    \u003cversion\u003e0.3.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example\nTry to image a simple HTTP server, that serves data from database.\n\n__Main.java__\n```java\npackage test.project;\n\nimport cz.tvrzna.wireable.WireableContext;\nimport cz.tvrzna.wireable.exceptions.WireableException;\n\npublic class Main\n{\n\tpublic static void main(String[] args)\n\t{\n\t\ttry\n\t\t{\n\t\t\tWireableContext.init(\"test.project\");\n\t\t}\n\t\tcatch (WireableException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}\n```\n\n__DatabaseService.java__\n```java\npackage test.project;\n\nimport cz.tvrzna.wireable.annotations.OnCreate;\nimport cz.tvrzna.wireable.annotations.Wireable;\nimport cz.tvrzna.wireable.enums.PriorityLevel;\n\n@Wireable\npublic class DatabaseService\n{\n\tprivate String[] data;\n\n\t@OnCreate\n\tprivate void init()\n\t{\n\t\tdata = new String[]\t{ \"First\", \"Second\", \"Third\" };\n\t}\n\n\t@OnCreate(priority = PriorityLevel.LOW)\n\tprivate void reinit()\n\t{\n\t\tdata = new String[] { \"First\", \"Second\", \"Third\", \"Fourth\"};\n\t}\n\n\tpublic String[] getData()\n\t{\n\t\treturn data;\n\t}\n\n\tpublic void removeUserSession(Long id)\n\t{\n\t\t// Remove token\n\t}\n}\n\n```\n\n__WebserverService.java__\n```java\npackage test.project;\n\nimport cz.tvrzna.wireable.WireableContext;\nimport cz.tvrzna.wireable.annotations.OnEvent;\nimport cz.tvrzna.wireable.annotations.OnStartup;\nimport cz.tvrzna.wireable.annotations.Wireable;\nimport cz.tvrzna.wireable.annotations.Wired;\nimport cz.tvrzna.wireable.exceptions.WireableException;\n\n@Wireable\npublic class WebserverService\n{\n\t@Wired\n\tprivate DatabaseService databaseService;\n\n\t@OnStartup\n\tprivate void start()\n\t{\n\t\t// Create endpoint, that points on URL and method handleRequest\n\t\t// Start server\n\t}\n\n\tpublic Response handleRequest(HttpRequest request) throws WireableException\n\t{\n\t\tWireableContext.fireEvent(\"doLogout\", 1200l);\n\t\treturn Response.ok(databaseService.getData()).build();\n\t}\n}\n```\n\n__WatcherService.java__\n```java\npackage test.project;\n\nimport cz.tvrzna.wireable.WireableContext;\nimport cz.tvrzna.wireable.annotations.OnEvent;\nimport cz.tvrzna.wireable.annotations.OnStartup;\nimport cz.tvrzna.wireable.annotations.Unwireable;\nimport cz.tvrzna.wireable.exceptions.WireableException;\n\n@Unwireable\npublic class WatcherService\n{\n\t@OnStartup\n\tprivate void onStartup()\n\t{\n\t\t// Watch some data changes\n\t}\n\n\t@OnEvent(\"doLogout\")\n\tpublic void logout(Long id) throws WireableException\n\t{\n\t\tLateClass watcher = new LateClass();\n\t\tWireableContext.wireObjects(watcher);\n\t\twatcher.handleId(id);\n\t}\n}\n```\n\n__LateClass.java__\n```java\npackage test.project;\n\nimport cz.tvrzna.wireable.annotations.Wired;\n\npublic class LateClass\n{\n\t@Wired\n\tprivate DatabaseService databaseService;\n\n\tpublic void handleId(Long id)\n\t{\n\t\tdatabaseService.removeUserSession(id);\n\t}\n}\n\n```\n\n### Explanation of example\n 1. `WireableContext.init(\"test.project\");` starts initialization of the WireableContext on the start of Main class and scans package `test.project`, which contains these classes.\n 2. `DatabaseService` and `WebserverService` are initialized as instance, since they have `@Wireable` or `@Unwireable` annotation, and are put into `HashMap` in WireableContext. These classes needs to have the **constructor without arguments**.\n 3. `DatabaseService` and `WebserverService` are listed for `@Wired` annotation members. `WebserverService` has one, so it adds reference of `DatabaseService` from WireableContext on member named `databaseService`. `@Unwireable` clases could not by `@Wired`.\n 4. Both service classes are scanned for methods without arguments with annotation `@OnCreate`, it is aware of OnCreate priority level. `DatabaseService` has private method init(), so this method is invoked and variable `data` is set.\n 5. As it was in step before, classes are scanned again, but for methods without arguments with `@OnStartup` annotation. `WebserverService` has private method start(), so this method is invoked and server is started.\n 6. If handleRequest method is called, it calls event `doLogout`. That invokes method annotated as `@OnEvent(\"doLogout\")` with all passed arguments.\n 7. When logout method of `WatcherService` is called, it creates new instance of `LateClass`. This method is out of context, but all `@Wired` annotated members, becames accessable. This kind of classes could have any constructor, but `@OnCreate`, `@OrStartup` nor `@OnEvent` methods are not invoked.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvrzna%2Fwireable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftvrzna%2Fwireable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftvrzna%2Fwireable/lists"}