public static List < FactoryModel > factories ( BundleContext context ) { List < FactoryModel > factories = new ArrayList < FactoryModel > ( ) ; try { for ( ServiceReference ref : context . getServiceReferences ( Factory . class , null ) ) { factories . add ( new FactoryModel ( ( Factory ) context . getService ( ref ) ) ) ; } for ( ServiceReference ref : context . getServiceReferences ( HandlerFactory . class , null ) ) { factories . add ( new FactoryModel ( ( Factory ) context . getService ( ref ) ) ) ; } } catch ( InvalidSyntaxException e ) { //NOSONAR // Ignore it. } return factories ; }
Creates a list of factory model from the factory exposed . These factories are retrieved from the bundle context .