From a26866f27e7d67daefd468669b6400625c023562 Mon Sep 17 00:00:00 2001 From: javahongxi Date: Sat, 6 Oct 2018 09:12:13 +0800 Subject: [PATCH] rename Class --- .../remoting/netty4/{TimeClient.java => HelloClient.java} | 6 +++--- .../{TimeClientHandler.java => HelloClientHandler.java} | 4 ++-- .../remoting/netty4/{TimeServer.java => HelloServer.java} | 6 +++--- .../{TimeServerHandler.java => HelloServerHandler.java} | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/{TimeClient.java => HelloClient.java} (93%) rename whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/{TimeClientHandler.java => HelloClientHandler.java} (90%) rename whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/{TimeServer.java => HelloServer.java} (92%) rename whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/{TimeServerHandler.java => HelloServerHandler.java} (93%) diff --git a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClient.java b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClient.java similarity index 93% rename from whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClient.java rename to whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClient.java index 2c03391b..1ae06a62 100644 --- a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClient.java +++ b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClient.java @@ -12,7 +12,7 @@ import io.netty.channel.socket.nio.NioSocketChannel; /** * Created by shenhongxi on 2018/10/5. */ -public class TimeClient { +public class HelloClient { public void connect(int port, String host) throws Exception { // 配置客户端NIO线程组 @@ -24,7 +24,7 @@ public class TimeClient { .handler(new ChannelInitializer() { @Override protected void initChannel(SocketChannel socketChannel) throws Exception { - socketChannel.pipeline().addLast(new TimeClientHandler()); + socketChannel.pipeline().addLast(new HelloClientHandler()); } }); @@ -40,6 +40,6 @@ public class TimeClient { } public static void main(String[] args) throws Exception { - new TimeClient().connect(8080, "127.0.0.1"); + new HelloClient().connect(8080, "127.0.0.1"); } } diff --git a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClientHandler.java b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClientHandler.java similarity index 90% rename from whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClientHandler.java rename to whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClientHandler.java index fe9c526b..654279ec 100644 --- a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeClientHandler.java +++ b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloClientHandler.java @@ -8,11 +8,11 @@ import io.netty.channel.ChannelInboundHandlerAdapter; /** * Created by shenhongxi on 2018/10/5. */ -public class TimeClientHandler extends ChannelInboundHandlerAdapter { +public class HelloClientHandler extends ChannelInboundHandlerAdapter { private final ByteBuf firstMessage; - public TimeClientHandler() { + public HelloClientHandler() { byte[] req = "QUERY TIME COMMAND".getBytes(); firstMessage = Unpooled.buffer(req.length); firstMessage.writeBytes(req); diff --git a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServer.java b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServer.java similarity index 92% rename from whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServer.java rename to whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServer.java index a99c02af..bfa7bb27 100644 --- a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServer.java +++ b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServer.java @@ -12,7 +12,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel; /** * Created by shenhongxi on 2018/10/5. */ -public class TimeServer { +public class HelloServer { public void bind(int port) throws Exception { // 配置服务端的NIO线程组 @@ -41,11 +41,11 @@ public class TimeServer { @Override protected void initChannel(SocketChannel socketChannel) throws Exception { - socketChannel.pipeline().addLast(new TimeServerHandler()); + socketChannel.pipeline().addLast(new HelloServerHandler()); } } public static void main(String[] args) throws Exception { - new TimeServer().bind(8080); + new HelloServer().bind(8080); } } diff --git a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServerHandler.java b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServerHandler.java similarity index 93% rename from whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServerHandler.java rename to whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServerHandler.java index b834a2a2..bf6324bb 100644 --- a/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/TimeServerHandler.java +++ b/whatsmars-remoting/src/main/java/org/hongxi/whatsmars/remoting/netty4/HelloServerHandler.java @@ -10,7 +10,7 @@ import java.util.Date; /** * Created by shenhongxi on 2018/10/5. */ -public class TimeServerHandler extends ChannelInboundHandlerAdapter { +public class HelloServerHandler extends ChannelInboundHandlerAdapter { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ByteBuf buf = (ByteBuf) msg; -- GitLab