org.jvnet.hk2.osgiadapter
Class HK2Main

java.lang.Object
  extended by com.sun.enterprise.module.bootstrap.Main
      extended by org.jvnet.hk2.osgiadapter.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 Summary
 String DEFAULT_NAME
           
 
Constructor Summary
HK2Main()
           
 
Method Summary
 void bundleChanged(org.osgi.framework.BundleEvent event)
           
protected  ModulesRegistry createModulesRegistry()
           
 ServiceLocator createServiceLocator(ModulesRegistry mr, StartupContext context, List<? extends PopulatorPostProcessor> postProcessors, DescriptorFileFinder descriptorFileFinder)
           
protected  void defineParentClassLoader()
           
 void start(org.osgi.framework.BundleContext context)
           
 void stop(org.osgi.framework.BundleContext context)
           
 
Methods inherited from class com.sun.enterprise.module.bootstrap.Main
findStartupService, getBootstrapFile, getParentClassLoader, getServiceLocator, launch, launch, main, run, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public final String DEFAULT_NAME
See Also:
Constant Field Values
Constructor Detail

HK2Main

public HK2Main()
Method Detail

createServiceLocator

public ServiceLocator createServiceLocator(ModulesRegistry mr,
                                           StartupContext context,
                                           List<? extends PopulatorPostProcessor> postProcessors,
                                           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


Copyright © 2013 Oracle Corporation. All Rights Reserved.