org.jvnet.hk2.osgiadapter
Class OSGiInhabitantsParser

java.lang.Object
  extended by org.glassfish.hk2.inhabitants.InhabitantsParser
      extended by org.jvnet.hk2.osgiadapter.OSGiInhabitantsParser
All Implemented Interfaces:
InhabitantStore

public class OSGiInhabitantsParser
extends InhabitantsParser

Parses /META-INF/inhabitants and populate Habitat. and registers services in OSGi Service Registry.

Author:
Sanjeeb.Sahoo@Sun.COM

Field Summary
static String SERVICE_NAME
          When an HK2 service is defined with a name (using the name attribute of Service annotation, then the corresponding OSGi service is registered with the following property name.
 
Fields inherited from class org.glassfish.hk2.inhabitants.InhabitantsParser
serviceLocator
 
Constructor Summary
OSGiInhabitantsParser(ServiceLocator serviceLocator, org.osgi.framework.BundleContext ctx)
           
 
Method Summary
protected  void add(Inhabitant i, InhabitantParser parser)
          This method registers an equivalent service in OSGi's Service Registry.
 
Methods inherited from class org.glassfish.hk2.inhabitants.InhabitantsParser
add, addIndex, drop, drop, isFilteredInhabitant, isFilteredInhabitant, parse, parseIndex, remove, removeIndex, removeIndex, replace, replace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_NAME

public static final String SERVICE_NAME
When an HK2 service is defined with a name (using the name attribute of Service annotation, then the corresponding OSGi service is registered with the following property name. See ServiceRegistration.setProperties(java.util.Dictionary)

See Also:
Constant Field Values
Constructor Detail

OSGiInhabitantsParser

public OSGiInhabitantsParser(ServiceLocator serviceLocator,
                             org.osgi.framework.BundleContext ctx)
Method Detail

add

protected void add(Inhabitant i,
                   InhabitantParser parser)
This method registers an equivalent service in OSGi's Service Registry. The registered service would be registered with HK2 Service class name in addition to all the contractNames.

Overrides:
add in class InhabitantsParser
Parameters:
i - Inhabitant which is being exposed as service object
parser - the inhabitant metadata information


Copyright © 2013 Oracle Corporation. All Rights Reserved.