Launcher: add generalised executable class loading support
authorEddie <dev@fun2be.me>
Sat, 6 Jun 2015 07:15:14 +0000 (08:15 +0100)
committerEddie <dev@fun2be.me>
Sat, 6 Jun 2015 07:15:14 +0000 (08:15 +0100)
commitc2e45d36b852a79785d3d9e787e68c7885a46837
tree358f165025bd0808b90a33780b91a6da010fe37a
parente25865bd76d3ddde5908e73e282ca7dc1d838ad1
Launcher: add generalised executable class loading support

The launcher was intended as a single point of launch for all the
executable applications in the project: servers and clients.

The improvements here generalise the code to support loading of any
(executable) class using its own classloader and instantiating it.

The result is that a single Java Virtual Machine (JVM) will execute
all the project applications rather than the usual case where there
is a single executable application per JVM.

Experimentation with this single-JVM approach reveals that it is only
suitable for daemon services or console (terminal) applications but not
for any GUI application that is based on Java Abstract Window Toolkit
(AWT) and/or Java Swing.

The reason is that the AWT is written to only have a single Event
Disptacher thread per JVM, unless some extremely invasive modifcations
using custom classloaders is implemented.

For examples of the code required for that review the circa 2002 project
Echidna which unfortunately had its web-site disappear from the web in 2005.
The Internet Archive has the last snapshot of it from 2005-12-17:

https://web.archive.org/web/20051217194617/http://www.javagroup.org/echidna/

The source code is still available from its SourceForge project
pages:

http://echidna.cvs.sourceforge.net/viewvc/echidna/echidna/
src/uk/ac/ntu/n0521366/wsyd/Launcher.java