public static List < ServiceModel > services ( BundleContext context ) { List < ServiceModel > services = new ArrayList <> ( ) ; try { ServiceReference [ ] references = context . getAllServiceReferences ( null , null ) ; if ( references != null ) { for ( ServiceReference ref : references ) { services . add ( new ServiceModel ( ref ) ) ; } } } catch ( InvalidSyntaxException e ) { //NOSONAR // Ignore it. } return services ; }
Creates the list of service models from the list of the currently available services .