org.zodiac.autoconfigure.boot.PlatformBootServletAutoConfiguration 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.SERVLET)
@ConditionalOnClass(value = {javax.servlet.Servlet.class, org.springframework.web.servlet.DispatcherServlet.class})
public class PlatformBootServletAutoConfiguration {
public PlatformBootServletAutoConfiguration() {
super();
}
@Bean
@ConditionalOnMissingBean(value = {org.zodiac.core.web.HttpHeadersGetter.class})
@ConditionalOnClass(value = {org.zodiac.core.web.config.HttpContextInfo.class})
protected org.zodiac.core.web.servlet.ServletHttpHeadersGetter httpHeadersGetter(HttpContextProperties contextProperties) {
return new org.zodiac.core.web.servlet.ServletHttpHeadersGetter(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.servlet.ServletHttpHeadersGetter httpHeadersGetter) {
return new org.zodiac.core.context.platform.ServletPlatformServiceContext(contextProperties, httpHeadersGetter);
}
}