Skip to content

Commit

Permalink
=/ 调整项目结构 对一些不合理的地方进行了重构 by Noseparte
Browse files Browse the repository at this point in the history
  • Loading branch information
noseparte committed Oct 15, 2019
1 parent 483436e commit 7820a5b
Show file tree
Hide file tree
Showing 62 changed files with 717 additions and 711 deletions.
24 changes: 24 additions & 0 deletions src/main/java/com/github/unclecatmyself/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.unclecatmyself;

import com.github.unclecatmyself.auto.ConfigManager;
import com.github.unclecatmyself.auto.InChatServer;
import com.github.unclecatmyself.service.FromServerServiceImpl;
import com.github.unclecatmyself.service.InChatInitializer;
import com.github.unclecatmyself.service.UserAsyncDataListener;
import com.github.unclecatmyself.service.VerifyServiceImpl;

/**
* Created by MySelf on 2019/8/26.
*/
public class Application {


public static void main(String[] args) {
ConfigManager.initNetty = new InChatInitializer();
ConfigManager.fromServerService = FromServerServiceImpl.TYPE2;
ConfigManager.asyncDataListener = new UserAsyncDataListener();
ConfigManager.inChatVerifyService = new VerifyServiceImpl();
InChatServer.open();
}

}
23 changes: 0 additions & 23 deletions src/main/java/com/github/unclecatmyself/application.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.github.unclecatmyself.auto;

import com.github.unclecatmyself.bootstrap.channel.http.FromServerService;
import com.github.unclecatmyself.bootstrap.data.InChatToDataBaseService;
import com.github.unclecatmyself.bootstrap.verify.InChatVerifyService;
import com.github.unclecatmyself.bootstrap.channel.protocol.InChatVerifyService;
import com.github.unclecatmyself.common.bean.InitNetty;
import com.github.unclecatmyself.task.ListenAsynData;
import com.github.unclecatmyself.task.AsyncDataListener;

/**
* 默认配置工厂
* Created by MySelf on 2018/12/21.
*/
public class ConfigFactory {
public class ConfigManager {

/** Redis的ip地址 */
public static String RedisIP;
Expand All @@ -25,6 +24,6 @@ public class ConfigFactory {
public static InitNetty initNetty;

/** 用户监听异步数据伪接口 */
public static ListenAsynData listenAsynData;
public static AsyncDataListener asyncDataListener;

}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.github.unclecatmyself.auto;


import com.github.unclecatmyself.bootstrap.BootstrapServer;
import com.github.unclecatmyself.bootstrap.NettyBootstrapServer;
import com.github.unclecatmyself.bootstrap.server.BootstrapServer;
import com.github.unclecatmyself.bootstrap.server.NettyBootstrapServer;
import com.github.unclecatmyself.common.bean.InitNetty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -11,27 +11,36 @@
* InChat项目启动服务
* Create by UncleCatMySelf in 2018/12/06
**/
public abstract class InitServer {
public class InChatServer {

private final static Logger LOGGER = LoggerFactory.getLogger(InChatServer.class);

/**
* 静态化处理,保证唯一,确保用户启动的是他自己指定的,不是框架的
* 一个数据配置集合
*/
private static InitNetty serverBean = ConfigFactory.initNetty;
private static InitNetty serverBean = ConfigManager.initNetty;

/**
* netty服务器启动切面
*/
static BootstrapServer bootstrapServer;
private static BootstrapServer bootstrapServer;

/**
* 主要还是这个{@link NettyBootstrapServer},实例化想要的netty配置服务
*/
public static void open() {
/**
* 静态化处理,保证唯一,确保用户启动的是他自己指定的,不是框架的
* 一个数据配置集合
*/
if (serverBean != null) {
bootstrapServer = new NettyBootstrapServer();
bootstrapServer.setServerBean(serverBean);
int port = serverBean.getWebport();
int port = serverBean.getWebPort();
if(LOGGER.isInfoEnabled()){
LOGGER.info("Server started, listening on " + port);
}
bootstrapServer.start();
}
}
Expand Down

This file was deleted.

Loading

0 comments on commit 7820a5b

Please sign in to comment.