Java Code Examples for org.springframework.core.annotation.OrderUtils#getOrder()

The following examples show how to use org.springframework.core.annotation.OrderUtils#getOrder() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ControllerAdviceBean.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private static int initOrderFromBeanType(@Nullable Class<?> beanType) {
	Integer order = null;
	if (beanType != null) {
		order = OrderUtils.getOrder(beanType);
	}
	return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
}
 
Example 2
Source File: BeanFactoryAspectInstanceFactory.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * 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();
		}
		return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE);
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 3
Source File: BeanFactoryAspectInstanceFactory.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
		}
		return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE);
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 4
Source File: ControllerAdviceBean.java    From java-technology-stack with MIT License 5 votes vote down vote up
private static int initOrderFromBeanType(@Nullable Class<?> beanType) {
	Integer order = null;
	if (beanType != null) {
		order = OrderUtils.getOrder(beanType);
	}
	return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
}
 
Example 5
Source File: BeanFactoryAspectInstanceFactory.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * 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();
		}
		return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE);
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 6
Source File: BeanFactoryAspectInstanceFactory.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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();
		}
		return OrderUtils.getOrder(type, Ordered.LOWEST_PRECEDENCE);
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 7
Source File: SqlViewCustomizerMap.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
private static int getOrder(@NonNull final SqlViewCustomizer viewCustomizer)
{
	if (viewCustomizer instanceof Ordered)
	{
		return ((Ordered)viewCustomizer).getOrder();
	}
	else
	{
		return OrderUtils.getOrder(viewCustomizer.getClass(), Ordered.LOWEST_PRECEDENCE);
	}
}
 
Example 8
Source File: ControllerAdviceBean.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private static int initOrderFromBeanType(Class<?> beanType) {
	return OrderUtils.getOrder(beanType, Ordered.LOWEST_PRECEDENCE);
}
 
Example 9
Source File: ControllerAdviceBean.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
private static int initOrderFromBeanType(Class<?> beanType) {
	return OrderUtils.getOrder(beanType, Ordered.LOWEST_PRECEDENCE);
}
 
Example 10
Source File: SingletonMetadataAwareAspectInstanceFactory.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 11
Source File: SimpleMetadataAwareAspectInstanceFactory.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 12
Source File: SingletonMetadataAwareAspectInstanceFactory.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 13
Source File: SimpleMetadataAwareAspectInstanceFactory.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 14
Source File: SingletonMetadataAwareAspectInstanceFactory.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 15
Source File: SimpleMetadataAwareAspectInstanceFactory.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 16
Source File: SingletonMetadataAwareAspectInstanceFactory.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}
 
Example 17
Source File: SimpleMetadataAwareAspectInstanceFactory.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return OrderUtils.getOrder(aspectClass, Ordered.LOWEST_PRECEDENCE);
}