Class HK2Main

All Implemented Interfaces:
EventListener, org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener

public class HK2Main extends Main implements org.osgi.framework.BundleActivator, org.osgi.framework.SynchronousBundleListener
BundleActivator that launches a Habitat. A habitat is a collection of inhabitants, which are configured in a certain way. So, there is a one-to-one mapping between habitat and configuration file used to configure the inhabitants.
Author:
Sanjeeb.Sahoo@Sun.COM
  • Field Details

  • Constructor Details

    • HK2Main

      public HK2Main()
  • Method Details

    • createServiceLocator

      public org.glassfish.hk2.api.ServiceLocator createServiceLocator(ModulesRegistry mr, StartupContext context, List<org.glassfish.hk2.api.PopulatorPostProcessor> postProcessors, org.glassfish.hk2.api.DescriptorFileFinder descriptorFileFinder) throws BootException
      Overrides:
      createServiceLocator in class Main
      Throws:
      BootException
    • start

      public void start(org.osgi.framework.BundleContext context) throws Exception
      Specified by:
      start in interface org.osgi.framework.BundleActivator
      Throws:
      Exception
    • createModulesRegistry

      protected ModulesRegistry createModulesRegistry() throws Exception
      Throws:
      Exception
    • defineParentClassLoader

      protected void defineParentClassLoader() throws BootException
      Overrides:
      defineParentClassLoader in class Main
      Throws:
      BootException
    • stop

      public void stop(org.osgi.framework.BundleContext context) throws Exception
      Specified by:
      stop in interface org.osgi.framework.BundleActivator
      Throws:
      Exception
    • bundleChanged

      public void bundleChanged(org.osgi.framework.BundleEvent event)
      Specified by:
      bundleChanged in interface org.osgi.framework.BundleListener