Giter Club home page Giter Club logo

hotswap's Introduction

hotswap

hotswap是一个可用于JVM中 class 字节码热更新工具,支持线上和本地开发环境的热部署

开发状态

hotswap目前已经在线上部署使用,但并未进行非常全面的测试,如需要线上部署可自行进行充分测试。

目前支持线上部署和本地开发环境部署,采用java 1.5+ 提供的 java.lang.instrument.Instrumentation 类的 redefineClasses 方法实现,本身功能不能超出此类的限制,具体说明可以参照 java doc 文档。

使用示例

公共参数,公共参数都通过系统参数的方式传递,也可以通过后缀(如:period)添加到 agent参数后面

ilivoo.hotSwap.period			热交换后台线程运行周期
ilivoo.hotSwap.reloadDirs		热更新指定的路径
ilivoo.hotSwap.develop			是否是开发模式
  • 本地开发环境

    -javaagent:target/hotswap-1.0.jar=develop=true,period=10000,reloadDirs=target/classes
    
  • 线上环境

    -javaagent:target/hotswap-1.0.jar=reloadDirs=hotdir
    
  • 线上动态attach到ava进程

    java -jar hotswap-1.0.jar pid reloadDirs=hotdir
    
  • 测试工具,用来简单测试hotswap工具的测试类

    com.ilivoo.hotswap.TestTool
    

开发计划

计划在后期版本中加入功能和优化

  • hotswap 动态attach到某个java进程, 执行用户指定的jar包

hotswap's People

Contributors

ilivoo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.