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


Java JsonRpcService.value方法代碼示例

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


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

示例1: findServiceBeanDefinitions

import com.googlecode.jsonrpc4j.JsonRpcService; //導入方法依賴的package包/類
/**
 * Finds the beans to expose and puts them in the {@link #serviceBeanNames}
 * map.
 * <p>
 * Searches parent factories as well.
 */
private void findServiceBeanDefinitions(
	ConfigurableListableBeanFactory beanFactory) {
	for (String beanName : beanFactory.getBeanDefinitionNames()) {
		JsonRpcService jsonRpcPath = beanFactory.findAnnotationOnBean(beanName, JsonRpcService.class);
		if (jsonRpcPath != null) {
			String pathValue = jsonRpcPath.value();
			LOG.debug(format("Found JSON-RPC path '%s' for bean [%s].",
								pathValue, beanName));
			if (serviceBeanNames.containsKey(pathValue)) {
				String otherBeanName = serviceBeanNames.get(pathValue);
				LOG.warn(format(
										"Duplicate JSON-RPC path specification: found %s on both [%s] and [%s].",
										pathValue, beanName, otherBeanName));
			}
			serviceBeanNames.put(pathValue, beanName);
		}
	}
	BeanFactory parentBeanFactory = beanFactory.getParentBeanFactory();
	if (parentBeanFactory != null 
		&& ConfigurableListableBeanFactory.class.isInstance(parentBeanFactory)) {
		findServiceBeanDefinitions((ConfigurableListableBeanFactory) parentBeanFactory);
	}
}
 
開發者ID:esz,項目名稱:jsonrpc,代碼行數:30,代碼來源:AutoJsonRpcServiceExporter.java

示例2: analyzeController

import com.googlecode.jsonrpc4j.JsonRpcService; //導入方法依賴的package包/類
/**
 * Analyze controller and search resource
 *
 * @param controllerClazz
 *            class
 * @param resourceMap
 *            map of result
 * @param description
 *            description
 * @return return result map
 */
private Map<String, SpringResource> analyzeController(Class<?> controllerClazz,
        Map<String, SpringResource> resourceMap, String description) {

    JsonRpcService serviceAnnotation =
            AnnotationUtils.findAnnotation(controllerClazz, JsonRpcService.class);
    if (serviceAnnotation != null) {
        String requestUrl = serviceAnnotation.value();
        for (Method method : controllerClazz.getMethods()) {
            JsonRpcMethod jsonRpcMethod =
                    AnnotationUtils.findAnnotation(method, JsonRpcMethod.class);
            if (jsonRpcMethod != null) {
                // It is necessary to modify as few methods able to live on the same url in
                // swagger
                String resourceKey = controllerClazz.getCanonicalName() + requestUrl + ' '
                        + jsonRpcMethod.value();
                if (!resourceMap.containsKey(resourceKey)) {
                    SpringResource springResource = new SpringResource(controllerClazz,
                            requestUrl, resourceKey, description);
                    springResource.setControllerMapping(requestUrl);
                    resourceMap.put(resourceKey, springResource);
                }
                resourceMap.get(resourceKey).addMethod(method);
            }
        }
    }
    return resourceMap;
}
 
開發者ID:uralmax,項目名稱:jsonrpc4j-swagger-maven-plugin-helper,代碼行數:39,代碼來源:JsonRpcSwaggerApiReader.java

示例3: findServiceBeanDefinitions

import com.googlecode.jsonrpc4j.JsonRpcService; //導入方法依賴的package包/類
/**
 * Finds the beans to expose
 * map.
 * <p>
 * Searches parent factories as well.
 */
private static Map<String, String> findServiceBeanDefinitions(ConfigurableListableBeanFactory beanFactory) {
	final Map<String, String> serviceBeanNames = new HashMap<>();
	for (String beanName : beanFactory.getBeanDefinitionNames()) {
		JsonRpcService jsonRpcPath = beanFactory.findAnnotationOnBean(beanName, JsonRpcService.class);
		if (hasServiceAnnotation(jsonRpcPath)) {
			String pathValue = jsonRpcPath.value();
			logger.debug("Found JSON-RPC path '{}' for bean [{}].", pathValue, beanName);
			if (isNotDuplicateService(serviceBeanNames, beanName, pathValue))
				serviceBeanNames.put(pathValue, beanName);
		}
	}
	collectFromParentBeans(beanFactory, serviceBeanNames);
	return serviceBeanNames;
}
 
開發者ID:briandilley,項目名稱:jsonrpc4j,代碼行數:21,代碼來源:AutoJsonRpcServiceExporter.java


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