org.jvnet.hk2.osgiadapter
Class OSGiInhabitantsParser

java.lang.Object
  extended by com.sun.hk2.component.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 java.lang.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 com.sun.hk2.component.InhabitantsParser
habitat
 
Constructor Summary
OSGiInhabitantsParser(Habitat habitat, 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 com.sun.hk2.component.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 java.lang.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(Habitat habitat,
                             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 © 2012 Oracle Corporation. All Rights Reserved.