{"id":30294435,"url":"https://github.com/linkedin/cytodynamics","last_synced_at":"2025-08-17T01:34:55.591Z","repository":{"id":49766539,"uuid":"169665962","full_name":"linkedin/Cytodynamics","owner":"linkedin","description":"Classloader isolation library.","archived":false,"fork":false,"pushed_at":"2023-02-28T11:42:59.000Z","size":264,"stargazers_count":55,"open_issues_count":3,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-06T23:49:23.432Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkedin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-02-08T00:43:43.000Z","updated_at":"2025-02-16T13:42:26.000Z","dependencies_parsed_at":"2022-08-30T11:12:25.176Z","dependency_job_id":"a533394c-f9c5-4da0-beb0-37d009e57c21","html_url":"https://github.com/linkedin/Cytodynamics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linkedin/Cytodynamics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2FCytodynamics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2FCytodynamics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2FCytodynamics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2FCytodynamics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkedin","download_url":"https://codeload.github.com/linkedin/Cytodynamics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkedin%2FCytodynamics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270796217,"owners_count":24647319,"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-08-16T02:00:11.002Z","response_time":91,"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-08-17T01:34:54.720Z","updated_at":"2025-08-17T01:34:55.566Z","avatar_url":"https://github.com/linkedin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cytodynamics\n============\n\nCytodynamics is a library that makes dynamic JAR loading and classloader isolation on the JVM easy and painless.\n\nWhy Cytodynamics instead of pf4j/OSGi/JPF/JBoss modules?\n--------------------------------------------------------\n\nSimplicity. Cytodynamics is a zero-dependency library that allows one to dynamically load classes in a few lines of\ncode.\n\n```java\nClassLoader loader = LoaderBuilder\n    .anIsolatingLoader()\n    .withClasspath(new File(\"myjar.jar\").getUri())\n    .withParentRelationship(DelegateRelationshipBuilder.builder()\n        .withIsolationLevel(IsolationLevel.FULL)\n        .build())\n    .build();\n \nMyApi myApiImpl = (MyApi) loader.loadClass(\"com.myapi.MyApiImpl\").newInstance();\n\nmyApiImpl.doIt();\n```\n\nIn contrast with other dynamic classloading systems, Cytodynamics also allows for isolating the child classloader from\nparent dependencies. This avoids issues where loaded code depends on classes that are present in the parent classloader,\nwhich can break whenever these classes are updated.\n\nFor example, if the parent application uses Guava version x and the loaded code depends on those classes being present,\nwhen the parent application updates to a later version, this can break if the new version is not binary compatible. In\nCytodynamics, if the classloaders are isolated, this forces the loaded code to ship with its appropriate version of\nGuava, leading to more stable code in the long term.\n\nAs Cytodynamics focuses on simplicity, there is no versioning system, dependency system, or other complexity; more\ncomplex systems can be built on top of Cytodynamics. Since Cytodynamics does not have a versioning system, multiple\nversions of the same code can be loaded concurrently, allowing for runtime swap of code implementations.\n\nClassloader isolation\n---------------------\n\nAs mentioned earlier, Cytodynamics supports classloader isolation. The parent classloader is always isolated from the\nclasses contained in the child classloader (other than classes explicitly loaded through the Cytodynamics loader), but\nthe child classloader can also be isolated from the classes in the parent classloader.\n\nClasses can be annotated so that they are visible in the child classloader, as follows:\n\n```java\n@Api(name = \"my-interface\")\npublic interface MyInterface {\n  void doSomething();\n}\n``` \n\nWhen loading classes, classes annotated with the `@Api` annotation are always visible to the child classloader.\n\nCytodynamics supports three isolation modes: `NONE`, `TRANSITIONAL`, and `FULL`.\n\nIn `FULL` isolation mode, no classes from the parent classloader are visible, except for classes annotated with `@Api`\nand classes that have been whitelisted. In the `NONE` isolation mode, all classes from the parent classloader are\nvisible to the child classloader (this is the default behavior when creating a classloader in Java). `TRANSITIONAL` mode\nbehaves like the `NONE` mode, but logs accesses to classes that would not be visible in the `FULL` mode, as to make\ntransitions between classloader isolation levels smoother.\n\nClasses can also be whitelisted or blacklisted using glob-style patterns, making it easy to allow access to libraries in\nthe loaded code:\n\n```java\nClassLoader loader = LoaderBuilder\n    .anIsolatingLoader()\n    .withClasspath(new File(\"myjar.jar\").getUri())\n    .withParentRelationship(DelegateRelationshipBuilder.builder()\n        .withIsolationLevel(IsolationLevel.FULL)\n        .addWhitelistedClassPredicate(new GlobMatcher(\"com.example.*\"))\n        .build())\n    .build();\n```\n\nBuilding\n--------\n\nThis project uses Maven, so a simple `mvn install` will do.\n\nLicense\n-------\nBSD 2-CLAUSE LICENSE\n\nCopyright 2018 LinkedIn Corporation.\nAll Rights Reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n   notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n   notice, this list of conditions and the following disclaimer in the\n   documentation and/or other materials provided with the\n   distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fcytodynamics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkedin%2Fcytodynamics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkedin%2Fcytodynamics/lists"}