class SwaggerServiceImpl implements SwaggerService {
    private final ComponentManager componentManager;
    private volatile OpenAPI       openapi;
    private Set<String>            restfulServices;

    public SwaggerServiceImpl(ComponentManager componentManager) {
        this.componentManager = componentManager;
    }

    @Override
    public String openapi() {
        if (openapi == null) {
            synchronized (this) {
                if (openapi == null) {
                    openapi = buildOpenApi();
                }
            }
        } else {
            if (!getAllRestfulService().equals(restfulServices)) {
                synchronized (this) {
                    if (!getAllRestfulService().equals(restfulServices)) {
                        openapi = updateOpenApi();
                    }
                }
            }
        }

        return Json.pretty(openapi);

    }

    private OpenAPI updateOpenApi() {
        OpenApiContext openApiContext = OpenApiContextLocator.getInstance().getOpenApiContext(
            OpenApiContext.OPENAPI_CONTEXT_ID_DEFAULT);
        if (openApiContext instanceof GenericOpenApiContext) {
            restfulServices = getAllRestfulService();
            SwaggerConfiguration oasConfig = new SwaggerConfiguration()
                .resourceClasses(restfulServices);
            ((GenericOpenApiContext) openApiContext).getOpenApiScanner()
                .setConfiguration(oasConfig);
            try {
                ((GenericOpenApiContext) openApiContext).setCacheTTL(0);
                return openApiContext.read();
            } finally {
                ((GenericOpenApiContext) openApiContext).setCacheTTL(-1);
            }
        } else {
            return null;
        }
    }

    private OpenAPI buildOpenApi() {
        try {
            restfulServices = getAllRestfulService();
            SwaggerConfiguration oasConfig = new SwaggerConfiguration()
                .resourceClasses(restfulServices);

            OpenApiContext oac = new JaxrsOpenApiContextBuilder().openApiConfiguration(oasConfig)
                .buildContext(true);
            return oac.read();
        } catch (OpenApiConfigurationException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }

    private Set<String> getAllRestfulService() {<FILL_FUNCTION_BODY>}
}

        return componentManager.getComponentInfosByType(ServiceComponent.SERVICE_COMPONENT_TYPE).stream()
                .filter(ci -> {
                    ServiceComponent sc = (ServiceComponent) ci;
                    return sc.getService().getBinding(RpcBindingType.REST_BINDING_TYPE) != null;
                })
                .map(sc -> ((ServiceComponent) sc).getService().getInterfaceType())
                .map(Class::getName).collect(Collectors.toSet());
    
<no_super_class>