I am looking for a way to re-start the Equinox framework
after it has been started and stopped successfully.
In an initial attempt, I use the ServiceLoader to get the
EquinoxFactory and produce an Equinox instance. First start
While this is all available from the standard spec, what
makes my question specific to Equinox is the fact that I
configure an AdapterHook in the launch properties.
Now, when I stop the instance and re-create it using the
factory, the Equinox Framework throws a ClassCastException
during initialization of the AdapterHooks as my private hook
comes from a different class loader.
During debugging I found that Equinox switched the class
loader on the second attempt, because the static
FrameworkProperties class has already created the properties
and therefore switched the class loader.
How it this supposed to work? How can you use the OSGi
launch spec and restart Equinox programmatically?