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


Java Order.value方法代碼示例

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


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

示例1: getOrder

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
/**
 * Determine the order for this factory's target aspect, either
 * an instance-specific order expressed through implementing the
 * {@link org.springframework.core.Ordered} interface (only
 * checked for singleton beans), or an order expressed through the
 * {@link org.springframework.core.annotation.Order} annotation
 * at the class level.
 * @see org.springframework.core.Ordered
 * @see org.springframework.core.annotation.Order
 */
@Override
public int getOrder() {
	Class<?> type = this.beanFactory.getType(this.name);
	if (type != null) {
		if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
			return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
		}
		Order order = AnnotationUtils.findAnnotation(type, Order.class);
		if (order != null) {
			return order.value();
		}
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:25,代碼來源:BeanFactoryAspectInstanceFactory.java

示例2: getOrderForAspectClass

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
/**
 * Determine a fallback order for the case that the aspect instance
 * does not express an instance-specific order through implementing
 * the {@link org.springframework.core.Ordered} interface.
 * <p>The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
 * @param aspectClass the aspect class
 */
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
	if (order != null) {
		return order.value();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:16,代碼來源:SimpleMetadataAwareAspectInstanceFactory.java

示例3: getOrderForAspectClass

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
/**
 * Check whether the aspect class carries an
 * {@link org.springframework.core.annotation.Order} annotation,
 * falling back to {@code Ordered.LOWEST_PRECEDENCE}.
 * @see org.springframework.core.annotation.Order
 */
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	Order order = AnnotationUtils.findAnnotation(aspectClass, Order.class);
	if (order != null) {
		return order.value();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:15,代碼來源:SingletonMetadataAwareAspectInstanceFactory.java

示例4: returnPrimaryOrHighestPriorityBean

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
private Object returnPrimaryOrHighestPriorityBean(List<Bean> beans) {

			long highestPriority = Integer.MIN_VALUE;
			Object highestPrioBean = null;

			for (Bean bean : beans) {

				if (bean.isPrimary()) {
					return bean.getInstance();
				}

				// TODO figure out to retrieve order from BeanDefinition /
				// BeanDeclaration

				Object instance = bean.getInstance();
				Order order = instance.getClass().getAnnotation(Order.class);
				if (order != null) {
					if (order.value() > highestPriority) {
						highestPriority = order.value();
						highestPrioBean = instance;
					}
				}

				Priority priority = instance.getClass().getAnnotation(Priority.class);
				if (priority != null) {
					if (priority.value() > highestPriority) {
						highestPriority = priority.value();
						highestPrioBean = instance;
					}
				}
			}

			return highestPrioBean;
		}
 
開發者ID:thomasdarimont,項目名稱:spring-boot-cdi-instance-example,代碼行數:35,代碼來源:CustomAutowireCandidateResolver.java

示例5: getOrder

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
/**
 * Determine the order for this factory's target aspect, either
 * an instance-specific order expressed through implementing the
 * {@link org.springframework.core.Ordered} interface (only
 * checked for singleton beans), or an order expressed through the
 * {@link org.springframework.core.annotation.Order} annotation
 * at the class level.
 * @see org.springframework.core.Ordered
 * @see org.springframework.core.annotation.Order
 */
public int getOrder() {
	Class<?> type = this.beanFactory.getType(this.name);
	if (type != null) {
		if (Ordered.class.isAssignableFrom(type) && this.beanFactory.isSingleton(this.name)) {
			return ((Ordered) this.beanFactory.getBean(this.name)).getOrder();
		}
		Order order = AnnotationUtils.findAnnotation(type, Order.class);
		if (order != null) {
			return order.value();
		}
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:24,代碼來源:BeanFactoryAspectInstanceFactory.java

示例6: initOrderFromBeanType

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
private static int initOrderFromBeanType(Class<?> beanType) {
	Order ann = AnnotationUtils.findAnnotation(beanType, Order.class);
	return (ann != null ? ann.value() : Ordered.LOWEST_PRECEDENCE);
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:5,代碼來源:ControllerAdviceBean.java

示例7: getOrder

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
@Override
public int getOrder() {
	Order order = getMethodAnnotation(Order.class);
	return (order != null ? order.value() : 0);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:6,代碼來源:ApplicationListenerMethodAdapter.java

示例8: resolveOrder

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
protected int resolveOrder(Method method) {
    Order ann = AnnotatedElementUtils.findMergedAnnotation(method, Order.class);
    return (ann != null ? ann.value() : 0);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:5,代碼來源:UiEventListenerMethodAdapter.java

示例9: initOrderFromBeanType

import org.springframework.core.annotation.Order; //導入方法依賴的package包/類
private static int initOrderFromBeanType(Class<?> beanType) {
	Order annot = AnnotationUtils.findAnnotation(beanType, Order.class);
	return (annot != null) ? annot.value() : Ordered.LOWEST_PRECEDENCE;
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:5,代碼來源:ControllerAdviceBean.java


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