-
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
4 changed files
with
37 additions
and
10 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
enable-module/src/main/java/name/guolanren/EnableModuleApplication.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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package name.guolanren; | ||
|
||
import name.guolanren.annotation.EnableByImportConfiguration; | ||
import name.guolanren.annotation.EnableByImportImportBeanDefinitionRegistrar; | ||
import name.guolanren.annotation.EnableByImportImportSelector; | ||
import name.guolanren.service.Server; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* @author guolanren | ||
*/ | ||
@SpringBootApplication | ||
@EnableByImportConfiguration | ||
//@EnableByImportImportSelector(type = Server.Type.HTTP) | ||
//@EnableByImportImportBeanDefinitionRegistrar(type = Server.Type.HTTP) | ||
public class EnableModuleApplication implements CommandLineRunner { | ||
|
||
@Autowired | ||
private Server server; | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(EnableModuleApplication.class, args); | ||
} | ||
|
||
@Override | ||
public void run(String... args) throws Exception { | ||
server.start(); | ||
server.stop(); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
enable-module/src/main/java/name/guolanren/config/SomeConfiguration.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,17 +1,17 @@ | ||
package name.guolanren.config; | ||
|
||
import name.guolanren.service.HttpServer; | ||
import name.guolanren.service.Server; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* @author guolanren | ||
*/ | ||
@Configuration | ||
public class SomeConfiguration { | ||
|
||
@Bean | ||
public String sth() { | ||
return "Hello, World"; | ||
public Server httpServer() { | ||
return new HttpServer(); | ||
} | ||
|
||
} |
3 changes: 0 additions & 3 deletions
3
enable-module/src/main/java/name/guolanren/service/FtpServer.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
3 changes: 0 additions & 3 deletions
3
enable-module/src/main/java/name/guolanren/service/HttpServer.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