if ( bean instanceof OrderedInModule ) {
return ( (OrderedInModule) bean ).getOrderInModule();
}
if ( bean != null ) {
Class<?> clazz = ( bean instanceof Class ? (Class<?>) bean : bean.getClass() );
OrderInModule order = AnnotationUtils.findAnnotation( clazz, OrderInModule.class );
if ( order != null ) {
return order.value();
}
}
return Ordered.LOWEST_PRECEDENCE;
}