Giter Site home page Giter Site logo

reloader's Introduction

Reloader

A java package to reload a running Java applications.

Features

  • Based on run time information, intelligently recreate the application's command line.
  • Exit the application, invoking the recreated command line as new process.
  • Execute shutdown code prior to exit.
  • If the application was packaged as a single jar, it can determine if there is a newer version of the jar and use that instead, i.e. handle an update.
  • Can be registered as a signal handler.

Why?

It is designed for restarting and updating running applications.

Example Use

The artifacts are on JCenter.

Download

Suppose you want your application to restart from the latest version when the process receives a USR2 signal. In your Java main simply:

Reloader.onSignal("USR2");

That is it. Do you need shutdown code, but to run the same version?

 Reloader.onSignal("USR2", () -> { /* shutdiown code */ }, false);

Perhaps you don't want to base invocation on a signal, but to call reloader in an event handler:

Reloader.restartApplication(() -> {/* shutdiown code */}, true);

Credits

The origin of Reloader is Leo Lewis' article entitled Programmatically Restart a Java Application.

See Also

reloader's People

Contributors

nwillc avatar

Stargazers

Sławek Mikuła avatar Thomas Deutsch avatar Jim Procter avatar

Watchers

James Cloos avatar  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.