Source:
public void afterPropertiesSet() { ApiPolicyResolver apiPolicyResolver = new ApiPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); PolicyChainProvider apiPolicyChainProvider = new ApiPolicyChainProvider(StreamType.ON_REQUEST, apiPolicyResolver); SecurityPolicyResolver securityPolicyResolver = new SecurityPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyResolver); PolicyChainProvider securityPolicyChainProvider = new SecurityPolicyChainProvider(securityPolicyResolver); PlanPolicyResolver planPolicyResolver = new PlanPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyResolver); PolicyChainProvider planPolicyChainProvider = new PlanPolicyChainProvider(StreamType.ON_REQUEST, planPolicyResolver); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); if (api.getProxy().getCors() != null && api.getProxy().getCors().isEnabled()) { providers.add(new ProcessorSupplier<>(() -> new StreamableProcessorDecorator<>(new CorsPreflightRequestProcessor(api.getProxy().getCors())))); } providers.add(securityPolicyChainProvider); if (api.getProxy().getLogging() != null && api.getProxy().getLogging().getMode() != LoggingMode.NONE) { providers.add(new ProcessorSupplier<>(new Supplier<StreamableProcessor<ExecutionContext, Buffer>>() { @Override public StreamableProcessor<ExecutionContext, Buffer> get() { ApiLoggableRequestProcessor processor = new ApiLoggableRequestProcessor(api.getProxy().getLogging(), new LogConfiguration(logSSLInfo, logSSLCertificates, (maxSizeLogMessage <= - 1) ? -1 : maxSizeLogMessage * (1024 * 1024))); return new StreamableProcessorDecorator<>(processor); } } )); } providers.add(planPolicyChainProvider); providers.add(apiPolicyChainProvider); }

Target:
public void afterPropertiesSet() { ApiPolicyResolver apiPolicyResolver = new ApiPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); PolicyChainProvider apiPolicyChainProvider = new ApiPolicyChainProvider(StreamType.ON_REQUEST, apiPolicyResolver); SecurityPolicyResolver securityPolicyResolver = new SecurityPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyResolver); PolicyChainProvider securityPolicyChainProvider = new SecurityPolicyChainProvider(securityPolicyResolver); PlanPolicyResolver planPolicyResolver = new PlanPolicyResolver(); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyResolver); PolicyChainProvider planPolicyChainProvider = new PlanPolicyChainProvider(StreamType.ON_REQUEST, planPolicyResolver); applicationContext.getAutowireCapableBeanFactory().autowireBean(securityPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(planPolicyChainProvider); applicationContext.getAutowireCapableBeanFactory().autowireBean(apiPolicyResolver); if (api.getProxy().getCors() != null && api.getProxy().getCors().isEnabled()) { providers.add(new ProcessorSupplier<>(() -> new StreamableProcessorDecorator<>(new CorsPreflightRequestProcessor(api.getProxy().getCors())))); } providers.add(securityPolicyChainProvider); if (api.getProxy().getLogging() != null && api.getProxy().getLogging().getMode() != LoggingMode.NONE) { providers.add(new ProcessorSupplier<>(new Supplier<StreamableProcessor<ExecutionContext, Buffer>>() { @Override public StreamableProcessor<ExecutionContext, Buffer> get() { ApiLoggableRequestProcessor processor = new ApiLoggableRequestProcessor(api.getProxy().getLogging(), (new LogConfiguration.Builder()) .maxSizeLogMessage(maxSizeLogMessage * (1024 * 1024)) .withSsl(logSSLInfo, logSSLCertificates).build()); return new StreamableProcessorDecorator<>(processor); } } )); } providers.add(planPolicyChainProvider); providers.add(apiPolicyChainProvider); }