{"id":26186959,"url":"https://github.com/ivarref/hookd","last_synced_at":"2026-04-18T10:05:29.130Z","repository":{"id":62435442,"uuid":"537068686","full_name":"ivarref/hookd","owner":"ivarref","description":"Consume return values of arbitrary Java methods in Clojure","archived":false,"fork":false,"pushed_at":"2024-04-26T12:14:08.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T22:32:19.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivarref.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}},"created_at":"2022-09-15T14:37:13.000Z","updated_at":"2024-04-26T12:14:12.000Z","dependencies_parsed_at":"2024-04-23T12:12:41.437Z","dependency_job_id":"7b4b4fbe-8c56-446b-80f5-1d1f79d8fa88","html_url":"https://github.com/ivarref/hookd","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/ivarref/hookd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fhookd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fhookd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fhookd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fhookd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivarref","download_url":"https://codeload.github.com/ivarref/hookd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fhookd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31964551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":"2025-03-11T23:35:50.823Z","updated_at":"2026-04-18T10:05:29.087Z","avatar_url":"https://github.com/ivarref.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hookd\n\nConsume return values from arbitrary Java methods in Clojure.\n\n## Installation\n\n[![Clojars Project](https://img.shields.io/clojars/v/com.github.ivarref/hookd.svg)](https://clojars.org/com.github.ivarref/hookd)\n\n## Example usage\n\nMake sure your JVM is started with `-Djdk.attach.allowAttachSelf=true`.\n\n```clojure\n(require '[com.github.ivarref.hookd :as hookd])\n\n; I want to get a copy of the Apache Tomcat JDBC pool:\n(defonce conn-pool (atom nil))\n\n(hookd/install-return-consumer!\n  \"org.apache.tomcat.jdbc.pool.ConnectionPool\"\n  \"::Constructor\" ; Special method name to hook into the constructor(s)\n  (partial reset! conn-pool))\n\n; I want to peek at connections returned from the connection pool:\n(hookd/install-return-consumer!\n  \"org.apache.tomcat.jdbc.pool.ConnectionPool\"\n  \"getConnection\"\n  (fn [conn] ...))\n```\n\n## How it works\n\n`hookd` uses [java agents](https://www.baeldung.com/java-instrumentation)\nto modify the bytecode of class files. It attaches itself to the running\nJVM. Repeated calls for the same class and method combination\nwill not modify the bytecode, only replace the consumer function.\n\n## License\n\nCopyright © 2022 Ivar Refsdal\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivarref%2Fhookd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivarref%2Fhookd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivarref%2Fhookd/lists"}