Giter Site home page Giter Site logo

Comments (5)

mordechaim avatar mordechaim commented on June 14, 2024 1

I feel a bit uncomfortable adding such code to the core library.

With your setup, I think you could call System.exit() in the business application and have the launcher check the exit code. Does this make sense to you?

from update4j.

mordechaim avatar mordechaim commented on June 14, 2024

You could use the injection mechanism, pass a lambda to the business app which can be executed on completion. Something like this:

Bootstrap

@InjectSource
private Consumer<Integer> onExit = ...

Business

@InjectTarget
private Consumer<Integer> onExit;

Update4j will do the reference mapping automatically when launching.

from update4j.

hinca avatar hinca commented on June 14, 2024

Thanks for the response, @mordechaim. I can see how this would work between my updater and the business app, however, can this also be used through the Bootstrap? I mean, the launcher executes a separate java -jar update4j.jar etc... but the org.update4j.Bootstrap.main() doesn't return the business application's code.

Our setup is that launcher uses the default bootstrap to update the updater, and then updater has custom means of updating the business app. The missing link is between the updater and the launcher through update4j.jar.

from update4j.

hinca avatar hinca commented on June 14, 2024

If I can trickle down the launcher's exit code all the way through update4j and return it at the end of org.update4j.Bootstrap.main() using System.exit(), would you be interested in reviewing such a pull request?

from update4j.

hinca avatar hinca commented on June 14, 2024

I considered that somewhat dangerous and prone to side effects to exit rather than return cleanly from the business app, but I suppose you're right. Besides, update4j (or other frameworks) can set up shutdown hooks to clean up if necessary.

Tested a solution that works, and will keep it based on exit codes.

from update4j.

Related Issues (20)

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.