解除lang3依赖

master
剑器近 2020-11-12 15:24:07 +08:00
parent 0725168a3e
commit 47148b172b
4 changed files with 19 additions and 42 deletions

21
pom.xml
View File

@ -44,7 +44,13 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
<scope>test</scope>
</dependency>
<dependency>
@ -53,25 +59,22 @@
<version>1.7.30</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.51.Final</version>
<version>4.1.54.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.8.5</version>
<version>2.8.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.8.RELEASE</version>
<version>5.2.11.RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>

View File

@ -2,8 +2,8 @@ package io.github.yezhihao.netmc.core.handler;
import io.github.yezhihao.netmc.core.model.Message;
import io.github.yezhihao.netmc.session.Session;
import io.github.yezhihao.netmc.util.BasicThreadFactory;
import io.github.yezhihao.netmc.util.VirtualList;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -51,7 +51,7 @@ public class AsyncBatchHandler extends Handler {
this.queue = new ConcurrentLinkedQueue();
this.executor = new ThreadPoolExecutor(this.poolSize, this.poolSize, 1000L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(400),
new BasicThreadFactory.Builder().namingPattern(actionMethod.getName() + "-pool-%d").build());
new BasicThreadFactory.Builder().daemon(true).namingPattern(actionMethod.getName() + "-pool-%d").build());
for (int i = 0; i < poolSize; i++) {
boolean master = i == 0;

View File

@ -7,10 +7,13 @@ import java.io.Serializable;
* @author yezhihao
* home https://gitee.com/yezhihao/jt808-server
*/
public interface Header<T> extends Serializable {
public interface Header<ClientID, Type> extends Serializable {
/** 客户端唯一标识 */
T getClientId();
ClientID getClientId();
/** 消息类型 */
Type getType();
/** 消息流水号 */
int getSerialNo();

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<properties>
<property name="LOG_HOME">logs/</property>
<property name="LOG_NAME">jt808</property>
</properties>
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="924 %d{HH:mm:ss.SSS} [%thread] %-5level%-21c{10}[%line]%msg%n"/>
</Console>
<RollingRandomAccessFile name="RollingRandomAccessFile" fileName="${LOG_HOME}/${LOG_NAME}.log" filePattern="${LOG_HOME}/${LOG_NAME}-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="828 %d{HH:mm:ss.SSS} [%thread] %-5level%-21c{10}[%line]%msg%n"/>
<DefaultRolloverStrategy max="20"/>
<Policies>
<TimeBasedTriggeringPolicy modulate="true" interval="1"/>
<SizeBasedTriggeringPolicy size="20 MB"/>
</Policies>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
<AppenderRef ref="RollingRandomAccessFile"/>
</Root>
</Loggers>
</Configuration>