Spring Framework OrderComparator - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework OrderComparator class.

This code example shows how to use the following methods:
 * @since 2.0.1 
 * @see org.springframework.core.Ordered 
 * @see Order 
 * @see javax.annotation.Priority 
 */ 
public class AnnotationAwareOrderComparator extends OrderComparator {
 
	/** 
	 * Shared default instance of AnnotationAwareOrderComparator. 
	 */ 
	public static final AnnotationAwareOrderComparator INSTANCE = new AnnotationAwareOrderComparator();
 
 
	/** 
	 * This implementation checks for the {@link Order} annotation 
	 * on various kinds of elements, in addition to the 
	 * {@link org.springframework.core.Ordered} check in the superclass. 
	 */ 
	protected Integer findOrder(Object obj) {
		// Check for regular Ordered interface 
5
CodeRank
This code example shows how to use the following methods:
	public void setApplicationContext(ApplicationContext context) {
		List<AuthorizationPolicy> policies = Generics.newArrayList();
		policies.addAll(BeanFactoryUtils.beansOfTypeIncludingAncestors(
				context, AuthorizationPolicy.class).values());
		 
		Collections.sort(policies, new OrderComparator());
		AccessController.setPolicies(policies);
	} 
	 
} 
5
CodeRank
This code example shows how to use the following methods:
 * @since 1.0.3 
 */ 
@SuppressWarnings({"unchecked"}) 
class OrderedAwareCopyOnWriteArraySet<E> implements Set<E> {
 
	private final OrderComparator comparator = new OrderComparator();
 
	private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
 
	private final ReadLock readLock = rwl.readLock();
 
	private final WriteLock writeLock = rwl.writeLock();
 
	private final CopyOnWriteArraySet<E> elements;
 
    private final Set<E> unmodifiableElements;
 
    public OrderedAwareCopyOnWriteArraySet() { 
        elements = new CopyOnWriteArraySet<E>();
        unmodifiableElements = Collections.unmodifiableSet(elements);
4
CodeRank