-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathJettyWebServerConfig.java
More file actions
24 lines (21 loc) · 1.13 KB
/
JettyWebServerConfig.java
File metadata and controls
24 lines (21 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package tobySpringBoot.config.autoconfig;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.Conditional;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.util.ClassUtils;
import tobySpringBoot.config.ConditionalMyOnClass;
import tobySpringBoot.config.MyAutoConfiguration;
@MyAutoConfiguration
@ConditionalMyOnClass("org.eclipse.jetty.server.Server")
public class JettyWebServerConfig {
@Bean("jettyWebServerFactory") // bean name은 기본적으로 method 명을 따라간다. 동일 이름이 있으면 충돌이 날 수 있으니 이름을 구분!!
@ConditionalOnMissingBean
public ServletWebServerFactory servletWebServerFactory() {
return new JettyServletWebServerFactory();
}
}