Java Code Examples for org.springframework.core.Ordered#LOWEST_PRECEDENCE

The following examples show how to use org.springframework.core.Ordered#LOWEST_PRECEDENCE . 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: LogGlobalFilter.java    From WeEvent with Apache License 2.0 5 votes vote down vote up
@Override
public int getOrder() {
    return Ordered.LOWEST_PRECEDENCE;
}
 
Example 2
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 3
Source File: AbstractPointcutAdvisor.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
public int getOrder() {
	if (this.order != null) {
		return this.order;
	}
	Advice advice = getAdvice();
	if (advice instanceof Ordered) {
		return ((Ordered) advice).getOrder();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 4
Source File: TransactionUtil.java    From mPaaS with Apache License 2.0 5 votes vote down vote up
@Override
public int getOrder() {
	if (runner instanceof Ordered) {
		return ((Ordered) runner).getOrder();
	}
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 5
Source File: DefaultPlaylistExportHandler.java    From airsonic-advanced with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getOrder() {
    return Ordered.LOWEST_PRECEDENCE;
}
 
Example 6
Source File: RaftAnnotationBeanPostProcessor.java    From sofa-registry with Apache License 2.0 4 votes vote down vote up
@Override
public int getOrder() {
    return Ordered.LOWEST_PRECEDENCE;
}
 
Example 7
Source File: TransactionSynchronizationAdapter.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 8
Source File: AbstractApplicationRunListener.java    From mPass with Apache License 2.0 4 votes vote down vote up
@Override
public int getOrder() {
    return Ordered.LOWEST_PRECEDENCE;
}
 
Example 9
Source File: AuthorizationHeaderFilter.java    From java-microservices-examples with Apache License 2.0 4 votes vote down vote up
@Override
public int filterOrder() {
    return Ordered.LOWEST_PRECEDENCE;
}
 
Example 10
Source File: ConfigurationClassPostProcessor.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return Ordered.LOWEST_PRECEDENCE;  // within PriorityOrdered
}
 
Example 11
Source File: GenericApplicationListenerAdapter.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return (this.delegate instanceof Ordered ? ((Ordered) this.delegate).getOrder() : Ordered.LOWEST_PRECEDENCE);
}
 
Example 12
Source File: SourceFilteringListener.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return (this.delegate != null ? this.delegate.getOrder() : Ordered.LOWEST_PRECEDENCE);
}
 
Example 13
Source File: MultiServerUserRegistry.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return (this.delegateApplicationEvents ?
			((SmartApplicationListener) this.localRegistry).getOrder() : Ordered.LOWEST_PRECEDENCE);
}
 
Example 14
Source File: TestExecutionListenersTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public int getOrder() {
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 15
Source File: ResourcesBeanDefinitionParser.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public BeanDefinition parse(Element element, ParserContext context) {
	Object source = context.extractSource(element);

	registerUrlProvider(context, source);

	RuntimeBeanReference pathMatcherRef = MvcNamespaceUtils.registerPathMatcher(null, context, source);
	RuntimeBeanReference pathHelperRef = MvcNamespaceUtils.registerUrlPathHelper(null, context, source);

	String resourceHandlerName = registerResourceHandler(context, element, pathHelperRef, source);
	if (resourceHandlerName == null) {
		return null;
	}

	Map<String, String> urlMap = new ManagedMap<>();
	String resourceRequestPath = element.getAttribute("mapping");
	if (!StringUtils.hasText(resourceRequestPath)) {
		context.getReaderContext().error("The 'mapping' attribute is required.", context.extractSource(element));
		return null;
	}
	urlMap.put(resourceRequestPath, resourceHandlerName);

	RootBeanDefinition handlerMappingDef = new RootBeanDefinition(SimpleUrlHandlerMapping.class);
	handlerMappingDef.setSource(source);
	handlerMappingDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
	handlerMappingDef.getPropertyValues().add("urlMap", urlMap);
	handlerMappingDef.getPropertyValues().add("pathMatcher", pathMatcherRef).add("urlPathHelper", pathHelperRef);

	String orderValue = element.getAttribute("order");
	// Use a default of near-lowest precedence, still allowing for even lower precedence in other mappings
	Object order = StringUtils.hasText(orderValue) ? orderValue : Ordered.LOWEST_PRECEDENCE - 1;
	handlerMappingDef.getPropertyValues().add("order", order);

	RuntimeBeanReference corsRef = MvcNamespaceUtils.registerCorsConfigurations(null, context, source);
	handlerMappingDef.getPropertyValues().add("corsConfigurations", corsRef);

	String beanName = context.getReaderContext().generateBeanName(handlerMappingDef);
	context.getRegistry().registerBeanDefinition(beanName, handlerMappingDef);
	context.registerComponent(new BeanComponentDefinition(handlerMappingDef, beanName));

	// Ensure BeanNameUrlHandlerMapping (SPR-8289) and default HandlerAdapters are not "turned off"
	// Register HttpRequestHandlerAdapter
	MvcNamespaceUtils.registerDefaultComponents(context, source);

	return null;
}
 
Example 16
Source File: ConfigurationClassUtils.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * Determine the order for the given configuration class bean definition,
 * as set by {@link #checkConfigurationClassCandidate}.
 * @param beanDef the bean definition to check
 * @return the {@link Order @Order} annotation value on the configuration class,
 * or {@link Ordered#LOWEST_PRECEDENCE} if none declared
 * @since 4.2
 */
public static int getOrder(BeanDefinition beanDef) {
	Integer order = (Integer) beanDef.getAttribute(ORDER_ATTRIBUTE);
	return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
}
 
Example 17
Source File: SimpleAspectInstanceFactory.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * 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
 */
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 18
Source File: AbstractTestExecutionListener.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * The default implementation returns {@link Ordered#LOWEST_PRECEDENCE},
 * thereby ensuring that custom listeners are ordered after default
 * listeners supplied by the framework. Can be overridden by subclasses
 * as necessary.
 * @since 4.1
 */
@Override
public int getOrder() {
	return Ordered.LOWEST_PRECEDENCE;
}
 
Example 19
Source File: ConfigurationClassUtils.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * Determine the order for the given configuration class bean definition,
 * as set by {@link #checkConfigurationClassCandidate}.
 * @param beanDef the bean definition to check
 * @return the {@link Order @Order} annotation value on the configuration class,
 * or {@link Ordered#LOWEST_PRECEDENCE} if none declared
 * @since 4.2
 */
public static int getOrder(BeanDefinition beanDef) {
	Integer order = (Integer) beanDef.getAttribute(ORDER_ATTRIBUTE);
	return (order != null ? order : Ordered.LOWEST_PRECEDENCE);
}
 
Example 20
Source File: SimpleAspectInstanceFactory.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * 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
 */
protected int getOrderForAspectClass(Class<?> aspectClass) {
	return Ordered.LOWEST_PRECEDENCE;
}