System.exit
, while
still allowing the hosting program to do so.
The way that it distinguishes between methods in the hosting program
and hosted methods is that it expects the hosting program to invoke
the hosted program using a class called
Invoker
.
I also have a simple example that uses these classes. It consists of
an application that installs the security
manager and then uses the Invoker
class to invoke
a class that just calls
System.exit