Git Product home page Git Product logo

hot-deployment-plugin-framework's Introduction

Hot_Deployment_Plugin_Framework

This is a simple hot deployment plugin framework in java , which can dynamically load and unload jar files. It contains 2 jar files as plugin examples,the plugin project is here

When the program is started , it will load configuration , and load jar files , and then start a thread to listen the changes in the plugin folder , if a jar file is created in the plugin folder, the program will see if it is a configured jar file , if the answer is yes ,then the program will load the jar file.

Once started ,the program will listen to the deletion event in the plugin folder ,if a jar file deleteion event presents ,the program will see if it has been loaded ,if the answer is yes ,the program will unload the jar file.

In this way , this framework is able to dynamically load and unload jar file, so we can add ,update or remove services in production environment without interruption.

Usage

How to start

  • Make sure the configuration is correct,which is in /config/plugin.json

  • Implement the PluginInterface.java interface, or extends the DefaultPlugin.java class, examples are here, make sure to add module dependency to the plugin implemention project.

  • Build artifact in Intellij idea , or export lib in Eclipse

  • Put the jar file to /plugin/ folder

How to stop

  • Just remove the jar file in /plugin/ folder

Test Case

The test case shows how the plugin process data in json, in order to understand the test case, you should read the codes.

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.