Giter VIP home page Giter VIP logo

hotsecondsextension's Introduction

HotSecondsServer 插件扩展通用包

这个工程主要是用于扩展HotSeconds热部署逻辑,兼容更多的第三方开源框架,热部署第三方框架说简单也简单,说复杂也复杂,简单的点是,只要懂框架原理就能按照加载的原理重新增量加载/注册即可(先清理缓存),复杂的点是,需要考虑每个版本每个框架在不同的场景下的兼容性,需要花费一定的时间和精力。大家可直接Fork项目提交代码,后续再合并一下,众人拾柴火焰高,本插件的理念是:一切皆可热部署。

扩展包更新范围

版本 更新范围 mvn发布时间
1.0.1 SpringMVC json缓存清除 2024-1-1
1.0.0 MyBatis和MyBatis Plus支持新增mapper接口和xml配置文件 2023-09-23

扩展包使用

  1. 首先在maven 的pom.xml引用本工程的包

    <dependency>
       <groupId>io.github.liubsyy</groupId>
       <artifactId>HotSecondsExtension</artifactId>
       <version>1.0.1</version>
    </dependency>
    
  2. 然后在hot-seconds-remote.xml中配置 com.liubs.hotseconds.extension.AutoChoose,会自动智能选择需要的扩展组件,然后启动项目即可

     <dev-ext>
         <classname>com.liubs.hotseconds.extension.AutoChoose</classname>
     </dev-ext>
    

插件内核已支持

开源组件 范围
Java 修改代码,新增字段,新增方法,新增类,修改动态代理类
Spring 包括Spring,SpringMVC,SpringBoot生态
MyBatis 支持mapper修改xml文件(扩展包已支持新增mapper和xml)
MyBatis Plus 同MyBatis
Freemarker
Thymeleaf
Velocity-Spring
刷新缓存

本扩展包已支持

组件 Class 范围
Velocity com.liubs.hotseconds.extension.cache.VelocityHtmlCacheClear 刷新html缓存
MyBatis com.liubs.hotseconds.extension.container.MyBatisBeanRefresh 新增mapper类,新增xml热部署
MyBatisPlus 同MyBatis 同MyBatis
SpringMVC json com.liubs.hotseconds.extension.cache.SpringMVCJacksonCacheClear SpringMVC json缓存清除

扩展包开发流程

开发步骤

1.写一个类,实现 IHotExtHandler接口

2.在适当的时机注册这个类到 AllExtensionsManager

      (1)可以在某个特殊类初始化的时候注册,demo: VelocityRegistry

      (2)也可以直接在AllExtensionsManager写死

扩展包开发例子

刷新velocity缓存

动态增强类(加载类时)

获取某个类的对象实例

无需代码维护具体的对象,也无需再构造函数插入字节码获取对象,可使用FindInstancesOfClass这个工具,直接根据类获取对象实例

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.