ServiceConfigBuilder toServiceConfigBuilder(Route route, String contextPath, HttpService service) {
        final ServiceConfigBuilder serviceConfigBuilder =
                new ServiceConfigBuilder(route, contextPath, service);

        final AnnotatedService annotatedService;
        if (defaultServiceNaming == null || defaultLogName == null) {
            annotatedService = service.as(AnnotatedService.class);
        } else {
            annotatedService = null;
        }

        if (defaultServiceName != null) {
            serviceConfigBuilder.defaultServiceName(defaultServiceName);
        } else if (defaultServiceNaming != null) {
            serviceConfigBuilder.defaultServiceNaming(defaultServiceNaming);
        } else {
            // Set the default service name only when the service name is set using @ServiceName.
            // If it's not, the global defaultServiceNaming is used.
            if (annotatedService != null) {
                final String serviceName = annotatedService.name();
                if (serviceName != null) {
                    serviceConfigBuilder.defaultServiceName(serviceName);
                }
            }
        }

        if (defaultLogName != null) {
            serviceConfigBuilder.defaultLogName(defaultLogName);
        } else {
            if (annotatedService != null) {
                serviceConfigBuilder.defaultLogName(annotatedService.methodName());
            }
        }

        if (requestTimeoutMillis != null) {
            serviceConfigBuilder.requestTimeoutMillis(requestTimeoutMillis);
        }
        if (maxRequestLength != null) {
            serviceConfigBuilder.maxRequestLength(maxRequestLength);
        }
        if (verboseResponses != null) {
            serviceConfigBuilder.verboseResponses(verboseResponses);
        }
        if (accessLogWriter != null) {
            serviceConfigBuilder.accessLogWriter(accessLogWriter, false);
            // Set the accessLogWriter as false because it's shut down in ShutdownSupport.
        }
        if (blockingTaskExecutor != null) {
            serviceConfigBuilder.blockingTaskExecutor(blockingTaskExecutor, false);
            // Set the blockingTaskExecutor as false because it's shut down in ShutdownSupport.
        }
        if (successFunction != null) {
            serviceConfigBuilder.successFunction(successFunction);
        }
        if (requestAutoAbortDelayMillis != null) {
            serviceConfigBuilder.requestAutoAbortDelayMillis(requestAutoAbortDelayMillis);
        }
        if (multipartUploadsLocation != null) {
            serviceConfigBuilder.multipartUploadsLocation(multipartUploadsLocation);
        }
        if (multipartRemovalStrategy != null) {
            serviceConfigBuilder.multipartRemovalStrategy(multipartRemovalStrategy);
        }
        if (serviceWorkerGroup != null) {
            serviceConfigBuilder.serviceWorkerGroup(serviceWorkerGroup, false);
            // Set the serviceWorkerGroup as false because it's shut down in ShutdownSupport.
        }
        if (requestIdGenerator != null) {
            serviceConfigBuilder.requestIdGenerator(requestIdGenerator);
        }
        serviceConfigBuilder.shutdownSupports(shutdownSupports);
        if (!defaultHeaders.isEmpty()) {
            serviceConfigBuilder.defaultHeaders(defaultHeaders.build());
        }
        if (serviceErrorHandler != null) {
            serviceConfigBuilder.errorHandler(serviceErrorHandler);
        }
        serviceConfigBuilder.contextHook(contextHook);
        return serviceConfigBuilder;
    }
Note: {@link ServiceConfigBuilder} built by this method is not decorated with the decorator function
which can be configured using {@link DefaultServiceConfigSetters#decorator()} because
{@link AnnotatedServiceBindingBuilder} needs exception handling decorators to be the last to handle
any exceptions thrown by the service and other decorators.
core/src/main/java/com/linecorp/armeria/server/DefaultServiceConfigSetters.java