class ServiceClientImpl implements ServiceClient {

    private final SofaRuntimeContext      sofaRuntimeContext;

    private final BindingConverterFactory bindingConverterFactory;

    private final BindingAdapterFactory   bindingAdapterFactory;

    public ServiceClientImpl(SofaRuntimeContext sofaRuntimeContext,
                             BindingConverterFactory bindingConverterFactory,
                             BindingAdapterFactory bindingAdapterFactory) {
        this.sofaRuntimeContext = sofaRuntimeContext;
        this.bindingConverterFactory = bindingConverterFactory;
        this.bindingAdapterFactory = bindingAdapterFactory;
    }

    @SuppressWarnings("unchecked")
    @Override
    public void service(ServiceParam serviceParam) {
        Implementation implementation = new DefaultImplementation();
        implementation.setTarget(serviceParam.getInstance());

        if (serviceParam.getInterfaceType() == null) {
            throw new ServiceRuntimeException(ErrorCode.convert("01-00201"));
        }
        Service service = new ServiceImpl(serviceParam.getUniqueId(),
            serviceParam.getInterfaceType(), InterfaceMode.api, serviceParam.getInstance(), null);

        for (BindingParam bindingParam : serviceParam.getBindingParams()) {
            BindingConverter bindingConverter = bindingConverterFactory
                .getBindingConverter(bindingParam.getBindingType());

            if (bindingConverter == null) {
                throw new ServiceRuntimeException(ErrorCode.convert("01-00200",
                    bindingParam.getBindingType()));
            }
            BindingConverterContext bindingConverterContext = new BindingConverterContext();
            bindingConverterContext.setInBinding(false);
            bindingConverterContext.setAppName(sofaRuntimeContext.getAppName());
            bindingConverterContext.setAppClassLoader(sofaRuntimeContext.getAppClassLoader());
            Binding binding = bindingConverter.convert(bindingParam, bindingConverterContext);
            service.addBinding(binding);
        }

        boolean hasJvmBinding = false;
        for (Binding binding : service.getBindings()) {
            if (binding.getBindingType().equals(JvmBinding.JVM_BINDING_TYPE)) {
                hasJvmBinding = true;
                break;
            }
        }

        if (!hasJvmBinding) {
            service.addBinding(new JvmBinding());
        }

        ComponentInfo componentInfo = new ServiceComponent(implementation, service,
            bindingAdapterFactory, sofaRuntimeContext);
        sofaRuntimeContext.getComponentManager().register(componentInfo);
    }

    @Override
    public void removeService(Class<?> interfaceClass, int millisecondsToDelay) {
        removeService(interfaceClass, "", millisecondsToDelay);
    }

    @Override
    public void removeService(Class<?> interfaceClass, String uniqueId, int millisecondsToDelay) {<FILL_FUNCTION_BODY>}
}

        if (millisecondsToDelay < 0) {
            throw new IllegalArgumentException(ErrorCode.convert("01-00202"));
        }

        Collection<ComponentInfo> serviceComponents = sofaRuntimeContext.getComponentManager()
            .getComponentInfosByType(ServiceComponent.SERVICE_COMPONENT_TYPE);

        for (ComponentInfo componentInfo : serviceComponents) {
            if (!(componentInfo instanceof ServiceComponent serviceComponent)) {
                continue;
            }

            if (serviceComponent.getService().getInterfaceType() == interfaceClass
                && serviceComponent.getService().getUniqueId().equals(uniqueId)) {
                Map<String, Property> properties = serviceComponent.getProperties();
                Property property = new Property();
                property.setValue(millisecondsToDelay);
                properties.put(ServiceComponent.UNREGISTER_DELAY_MILLISECONDS, property);

                sofaRuntimeContext.getComponentManager().unregister(serviceComponent);
            }
        }
    
<no_super_class>