View Javadoc

1   /*
2    * $Id: Preferred.java 20925 2011-01-06 19:53:34Z pablo.kraan $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.config;
12  
13  import java.lang.annotation.ElementType;
14  import java.lang.annotation.Retention;
15  import java.lang.annotation.RetentionPolicy;
16  import java.lang.annotation.Target;
17  
18  /**
19   * Provides a means to give preference to an SPI implementation over others. Use either with
20   * or without a weight, in the latter case the higher the value, the stronger the preference.
21   */
22  @Retention(RetentionPolicy.RUNTIME)
23  @Target(ElementType.TYPE)
24  public @interface Preferred
25  {
26      int weight() default -1;
27  }