org.eclipse.swordfish.internal.core.planner
Class SortingStrategyImpl

java.lang.Object
  extended by org.eclipse.swordfish.internal.core.planner.SortingStrategyImpl
All Implemented Interfaces:
SortingStrategy, Strategy

public class SortingStrategyImpl
extends java.lang.Object
implements SortingStrategy

Author:
dwolz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.swordfish.core.planner.strategy.SortingStrategy
SortingStrategy.Role
 
Constructor Summary
SortingStrategyImpl()
           
 
Method Summary
 int getPriority()
          Indicates the ordering if several unified strategies can be applied.
 void setSortingStrategies(java.util.List<SortingStrategy> sortingStrategies)
           
 java.util.List<Interceptor> sort(java.util.Set<Interceptor> interceptors, ReadOnlyRegistry<Interceptor> registry, javax.jbi.messaging.MessageExchange exchange)
          Create and return an interceptor chain with the interceptors of the original chain in the order in which they shall be invoked in order to process subsequent message exchanges.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortingStrategyImpl

public SortingStrategyImpl()
Method Detail

sort

public java.util.List<Interceptor> sort(java.util.Set<Interceptor> interceptors,
                                        ReadOnlyRegistry<Interceptor> registry,
                                        javax.jbi.messaging.MessageExchange exchange)
Description copied from interface: SortingStrategy
Create and return an interceptor chain with the interceptors of the original chain in the order in which they shall be invoked in order to process subsequent message exchanges. The following rules apply for sorting:

Specified by:
sort in interface SortingStrategy
Parameters:
interceptors - - the interceptor chain to be sorted. This original List will not be modified.
registry - - the interceptor registry containing property data for the interceptors of the chain using the corresponding interceptor instance as key. The properties are merged by Swordfish from the properties returned by the getProperties() method of the interceptor, the property dictionary provided at OSGI service registration, and the Swordfish configuration. Values from the Swordfish configuration have precedence over those provided at OSGI service registration. Hard-coded properties from the getProperties() method have lowest precedence.
Returns:
the filtered interceptor chain (must not be null).

getPriority

public int getPriority()
Description copied from interface: Strategy
Indicates the ordering if several unified strategies can be applied.

Specified by:
getPriority in interface Strategy

setSortingStrategies

public void setSortingStrategies(java.util.List<SortingStrategy> sortingStrategies)