code: 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;
      }
docs: Creates a list of factory model from the factory exposed. These factories are retrieved from the bundle context.
  
  @param context the context
  @return the list of factory model