Class PreferredObjectSelector<T>

  extended by org.mule.config.PreferredObjectSelector<T>

public class PreferredObjectSelector<T>
extends Object

Selects a preferred object from a collection of instances of the same type based on the weight of the Preferred annotation. If there is no preferred instances, then it just returns the first object in the collection.

Constructor Summary
Method Summary
 T select(Iterator<T> iterator)
          Selects a preferred object from instances returned by an Iterator.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PreferredObjectSelector()
Method Detail


public T select(Iterator<T> iterator)
Selects a preferred object from instances returned by an Iterator.

The preferred instance will be the instance annotated with Preferred annotation with the highest weight attribute if there is any, or a non annotated class otherwise.

iterator - contains the objects to select from
the preferred instance

Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.