providers = Iterators.asList(ServiceLoader.load(RewriteProvider.class));
resultHandlers = Iterators.asList(ServiceLoader.load(RewriteResultHandler.class));
inbound = Iterators.asList(ServiceLoader.load(InboundRewriteProducer.class));
outbound = Iterators.asList(ServiceLoader.load(OutboundRewriteProducer.class));
Collections.sort(listeners, new WeightedComparator());
Collections.sort(wrappers, new WeightedComparator());
Collections.sort(providers, new WeightedComparator());
Collections.sort(resultHandlers, new WeightedComparator());
Collections.sort(inbound, new WeightedComparator());
Collections.sort(outbound, new WeightedComparator());
ServiceLogger.logLoadedServices(log, RewriteLifecycleListener.class, listeners);
ServiceLogger.logLoadedServices(log, RequestCycleWrapper.class, wrappers);
ServiceLogger.logLoadedServices(log, RewriteProvider.class, providers);
ServiceLogger.logLoadedServices(log, RewriteResultHandler.class, resultHandlers);