Search in sources :

Example 1 with RatpackServerCustomizer

use of ratpack.spring.config.RatpackServerCustomizer in project ratpack by ratpack.

the class ChainConfigurers method execute.

@Override
public void execute(Chain chain) throws Exception {
    List<Action<Chain>> delegates = new ArrayList<>(this.delegates);
    for (RatpackServerCustomizer customizer : customizers) {
        delegates.addAll(customizer.getHandlers());
    }
    if (handlers.size() == 1 || delegates.isEmpty()) {
        delegates.add(singleHandlerAction());
    }
    delegates.add(staticResourcesAction(chain.getServerConfig()));
    AnnotationAwareOrderComparator.sort(delegates);
    for (Action<Chain> delegate : delegates) {
        if (!(delegate instanceof ChainConfigurers)) {
            delegate.execute(chain);
        }
    }
}
Also used : Chain(ratpack.handling.Chain) Action(ratpack.func.Action) ArrayList(java.util.ArrayList) RatpackServerCustomizer(ratpack.spring.config.RatpackServerCustomizer)

Aggregations

ArrayList (java.util.ArrayList)1 Action (ratpack.func.Action)1 Chain (ratpack.handling.Chain)1 RatpackServerCustomizer (ratpack.spring.config.RatpackServerCustomizer)1