org.zodiac.autoconfigure.boot.PlatformBootReactiveAutoConfiguration Maven / Gradle / Ivy
package org.zodiac.autoconfigure.boot;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
import org.springframework.context.annotation.Bean;
import org.zodiac.autoconfigure.web.HttpContextProperties;
@SpringBootConfiguration
@ConditionalOnWebApplication(type = Type.REACTIVE)
@ConditionalOnClass(value = {org.springframework.web.server.WebHandler.class, org.springframework.web.reactive.DispatcherHandler.class})
public class PlatformBootReactiveAutoConfiguration {
public PlatformBootReactiveAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean(value = {org.zodiac.core.web.HttpHeadersGetter.class})
@ConditionalOnClass(value = {org.zodiac.core.web.config.HttpContextInfo.class})
protected org.zodiac.core.web.reactive.ReactiveHttpHeadersGetter httpHeadersGetter(HttpContextProperties contextProperties) {
return new org.zodiac.core.web.reactive.ReactiveHttpHeadersGetter(contextProperties);
}
@Bean
@ConditionalOnMissingBean
@ConditionalOnClass(value = {org.zodiac.core.web.config.HttpContextInfo.class})
protected org.zodiac.core.context.platform.ServiceContext serviceContext(HttpContextProperties contextProperties,
org.zodiac.core.web.reactive.ReactiveHttpHeadersGetter httpHeadersGetter) {
return new org.zodiac.core.context.platform.ReactivePlatformServiceContext(contextProperties, httpHeadersGetter);
}
}