Dictionary bundleHeaders = factory.getBundleContext().getBundle().getHeaders();
String ipojoHeader = ( String ) bundleHeaders.get( ADSConstants.IPOJO_HEADER );
if ( ipojoHeader == null )
{
throw new ParseException( "Null ipojo header returned for factory: " + factory.getName() );
}
ManifestMetadataParser parser = new ManifestMetadataParser();
parser.parseHeader( ipojoHeader );
Element[] componentMetas = parser.getComponentsMetadata();
for ( Element componentMeta : componentMetas )
{
String compName = componentMeta.getAttribute( "name" );
if ( compName.equals( factory.getName() ) )
{
Element[] adsElements = componentMeta.getElements(
ADSConstants.ADS_COMPONENT_HANDLER_NAME,
ADSConstants.ADS_COMPONENT_HANDLER_NS );
if ( adsElements == null || adsElements.length == 0 )
{
throw new ParseException( "ADSComponent element couldn't be found for factory: "
+ factory.getName() );
}
return adsElements[0].getAttribute( "componentType" );
}