public static Map < String , ChannelAspectInformation > scanAspectInformations ( final BundleContext context ) { Collection < ServiceReference < ChannelAspectFactory >> refs ; try { refs = context . getServiceReferences ( ChannelAspectFactory . class , null ) ; } catch ( final InvalidSyntaxException e ) { // this should never happen since we don't specific a filter return Collections . emptyMap ( ) ; } if ( refs == null ) { return Collections . emptyMap ( ) ; } final Map < String , ChannelAspectInformation > result = new HashMap <> ( refs . size ( ) ) ; for ( final ServiceReference < ChannelAspectFactory > ref : refs ) { final ChannelAspectInformation info = makeInformation ( ref ) ; result . put ( info . getFactoryId ( ) , info ) ; } return result ; }
This actively scans for available aspects and returns their information objects