forked from Percy0601/boot-dubbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
71 additions
and
55 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../infrastructure/ApplicationBootstrap.java → .../test/java/boot/ApplicationBootstrap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package boot.dubbo.infrastructure; | ||
package boot; | ||
|
||
import java.io.IOException; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
boot-dubbo-service/src/main/java/boot/dubbo/config/WebConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package boot.dubbo.config; | ||
|
||
//import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
//import org.springframework.context.annotation.ComponentScan; | ||
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | ||
// | ||
//@SpringBootApplication | ||
//@ComponentScan(basePackages = "boot") | ||
//public class WebConfig extends WebMvcConfigurerAdapter { | ||
// | ||
//} | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | ||
|
||
@SpringBootApplication | ||
@ComponentScan(basePackages = "boot") | ||
public class WebConfig extends WebMvcConfigurerAdapter { | ||
|
||
} |
82 changes: 42 additions & 40 deletions
82
boot-dubbo-service/src/main/java/boot/dubbo/starter/SpringBootStarter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,44 @@ | ||
package boot.dubbo.starter; | ||
|
||
//import javax.servlet.ServletContext; | ||
//import javax.servlet.ServletException; | ||
// | ||
//import org.slf4j.Logger; | ||
//import org.slf4j.LoggerFactory; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
//import org.springframework.boot.builder.SpringApplicationBuilder; | ||
//import org.springframework.boot.context.web.SpringBootServletInitializer; | ||
//import org.springframework.context.annotation.ComponentScan; | ||
//import org.springframework.core.env.Environment; | ||
|
||
//@SpringBootApplication | ||
//@ComponentScan(basePackages = "boot") | ||
//public class SpringBootStarter extends SpringBootServletInitializer { | ||
// private Logger log = LoggerFactory.getLogger(SpringBootStarter.class); | ||
// | ||
// @Autowired | ||
// private Environment env; | ||
// | ||
// @Override | ||
// protected SpringApplicationBuilder configure( | ||
// SpringApplicationBuilder application) { | ||
// log.info("=============容器启动(Spring Boot Container Start...)============="); | ||
// return application.sources(WebConfig.class); | ||
// } | ||
// | ||
// /** | ||
// * Config ServletListener, ServletFilter | ||
// */ | ||
// @Override | ||
// public void onStartup(ServletContext servletContext) | ||
// throws ServletException { | ||
// log.info("+++++++++++++容器启动(Web Container Servetlet Start...)+++++++++++++"); | ||
// log.info("++++++++++++++++++++++++++{}" + (env == null)); | ||
// | ||
// super.onStartup(servletContext); | ||
// } | ||
// | ||
//} | ||
import javax.servlet.ServletContext; | ||
import javax.servlet.ServletException; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.builder.SpringApplicationBuilder; | ||
import org.springframework.boot.context.web.SpringBootServletInitializer; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.core.env.Environment; | ||
|
||
import boot.dubbo.config.WebConfig; | ||
|
||
@SpringBootApplication | ||
@ComponentScan(basePackages = "boot") | ||
public class SpringBootStarter extends SpringBootServletInitializer { | ||
private Logger log = LoggerFactory.getLogger(SpringBootStarter.class); | ||
|
||
@Autowired | ||
private Environment env; | ||
|
||
@Override | ||
protected SpringApplicationBuilder configure( | ||
SpringApplicationBuilder application) { | ||
log.info("=============容器启动(Spring Boot Container Start...)============="); | ||
return application.sources(WebConfig.class); | ||
} | ||
|
||
/** | ||
* Config ServletListener, ServletFilter | ||
*/ | ||
@Override | ||
public void onStartup(ServletContext servletContext) | ||
throws ServletException { | ||
log.info("+++++++++++++容器启动(Web Container Servetlet Start...)+++++++++++++"); | ||
log.info("++++++++++++++++++++++++++{}" + (env == null)); | ||
|
||
super.onStartup(servletContext); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters