當前位置: 首頁>>代碼示例>>Java>>正文


Java RequestMappingHandlerAdapter.getReturnValueHandlers方法代碼示例

本文整理匯總了Java中org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.getReturnValueHandlers方法的典型用法代碼示例。如果您正苦於以下問題:Java RequestMappingHandlerAdapter.getReturnValueHandlers方法的具體用法?Java RequestMappingHandlerAdapter.getReturnValueHandlers怎麽用?Java RequestMappingHandlerAdapter.getReturnValueHandlers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter的用法示例。


在下文中一共展示了RequestMappingHandlerAdapter.getReturnValueHandlers方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fluxRequestMappingHandlerAdapterProcessor

import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; //導入方法依賴的package包/類
@Bean
public SmartInitializingSingleton fluxRequestMappingHandlerAdapterProcessor(
		RequestMappingHandlerAdapter adapter,
		FluxHandlerMethodArgumentResolver resolver) {
	return new SmartInitializingSingleton() {

		@Override
		public void afterSingletonsInstantiated() {
			List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(
					adapter.getArgumentResolvers());
			resolvers.add(0, resolver);
			adapter.setArgumentResolvers(resolvers);
			if (!ClassUtils.isPresent("org.springframework.core.ReactiveAdapter",
					null)) {
				List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(
						adapter.getReturnValueHandlers());
				handlers.add(0, context.getBean(FluxReturnValueHandler.class));
				adapter.setReturnValueHandlers(handlers);
			}
		}

	};
}
 
開發者ID:spring-cloud,項目名稱:spring-cloud-function,代碼行數:24,代碼來源:ReactorAutoConfiguration.java

示例2: install

import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; //導入方法依賴的package包/類
public GuavaLFReturnValueHandler install(RequestMappingHandlerAdapter requestMappingHandlerAdapter) {
    final List<HandlerMethodReturnValueHandler> originalHandlers = new ArrayList<>(
            requestMappingHandlerAdapter.getReturnValueHandlers());

    final int deferredPos = indexOfType(originalHandlers, DeferredResultMethodReturnValueHandler.class);
    // Add our handler directly after the deferred handler.
    originalHandlers.add(deferredPos + 1, this);

    requestMappingHandlerAdapter.setReturnValueHandlers(originalHandlers);

    return this;
}
 
開發者ID:salesforce,項目名稱:grpc-java-contrib,代碼行數:13,代碼來源:GuavaLFReturnValueHandler.java

示例3: returnValueHandlers

import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter; //導入方法依賴的package包/類
@Bean
public List<HandlerMethodReturnValueHandler> returnValueHandlers(RequestMappingHandlerAdapter requestMappingHandlerAdapter) {
    final List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(requestMappingHandlerAdapter.getReturnValueHandlers());
    handlers.add(0, new ObserableReturnValueHandler());
    handlers.add(0, new ListenableFutureReturnValueHandler());
    requestMappingHandlerAdapter.setReturnValueHandlers(handlers);
    return handlers;
}
 
開發者ID:Kixeye,項目名稱:chassis,代碼行數:9,代碼來源:SpringMvcConfiguration.java


注:本文中的org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.getReturnValueHandlers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。