title: How can I make a "modular" Java program that updates while running?
body: <p>I've been playing around with the idea of creating a program that can perform multiple different tasks while being monitored by a central thread.  The idea is to create a core program that will look for and load separate modules when it runs/while running.  These modules will perform their own tasks before passing the finished object(s) off to another module which will handle something such as uploading the finished product to a web server or organizing the resulting data into a pre-determined file/folder structure (see image for basic concept).
  <img src="https://i.stack.imgur.com/MS5ig.jpg" alt="enter image description here">
  I've never really worked with the modular design in Java before; all my past programs have been fully self contained, so I have <em>almost</em> no clue where to even start.</p>
  
  <p>My goal is to store external libraries in the core program (for example, AWS SDK for Java, which can shoot the .jar up to about 18MB itself) so that the separate modules can be distributed almost instantly when an update is made, rather than having to re-distribute the entire, 18MB+ self-contained program just to fix a 1-line bug.  Additionally, I'd like to be able to update individual modules, when necessary, without having to restart the entire program, allowing other modules to continue working while one is being updated, reducing overall downtime so that the only time the program is required to shut down entirely is when an update to the core is made.</p>
  
  <p><strong>What I want to know is, is this possible</strong> (I'm assuming so)<strong>, and if so; what should I look into/how would I go about setting it up? (Am I trying to reinvent the wheel? If so, where can I find said wheel?)</strong></p>
  
  <p>I looked into using a <code>ServiceLoader</code> and played around with the example <a href="https://stackoverflow.com/questions/16102010/dynamically-loading-plugin-jars-using-serviceloader">here</a>, but I'm not sure how I could go about pointing one module to another with it or if it can retrieve the library classes from the core, nor if it can do the "active updating" mentioned.  All I've seen, so far, is that (in my example) the core could access the module, but I am not sure if/how the module might access the core.</p>
  
  <p>Not sure if it's relevant to the post, but I do all my work inside of Eclipse (figured worth mentioning in case there is an IDE-specific tool available).</p>