This activator is used when glassfish.jar is installed and started
in an existing OSGi runtime. It expects install root and instance root
to be set via framework context properties called com.sun.aas.installRoot and com.sun.aas.instanceRoot
respectively. The former one refers to the directory where glassfish is installed.
(e.g., /tmp/glassfish4/glassfish)
The latter one refers to the domain directory - this is a directory containing
configuration information and deployed applications, etc.
If instance root is not set, it defaults to $installRoot/domains/domain1/.
Depending on the two context, it either builds a new GlassFishRuntime from scratch (i.e., by installing
necessary GlassFish bundles) or it just makes a new GlassFishRuntime and registers it in service registry.
Former is the case when user installs and starts just this bundle, where as latter is the case when this
bundle is invoked as part of GlassFish launching code as found in
OSGiGlassFishRuntimeBuilder
.
The reason for registering a GlassFishRuntime service is that the service has dependency on things like HK2
which are not available via parent loader, so unless we register here, we will have ClassCastException.