13
0
geforkt von Mirrors/Velocity

Remove deprecated members

Dieser Commit ist enthalten in:
xDark 2020-07-31 14:17:31 +03:00
Ursprung 6379936f32
Commit 76bef13377

Datei anzeigen

@ -3,7 +3,6 @@ package com.velocitypowered.proxy.network;
import com.velocitypowered.proxy.util.concurrent.VelocityNettyThreadFactory;
import io.netty.channel.ChannelFactory;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.ReflectiveChannelFactory;
import io.netty.channel.epoll.Epoll;
import io.netty.channel.epoll.EpollDatagramChannel;
import io.netty.channel.epoll.EpollEventLoopGroup;
@ -20,22 +19,16 @@ import java.util.concurrent.ThreadFactory;
import java.util.function.BiFunction;
enum TransportType {
NIO("NIO", NioServerSocketChannel::new, NioServerSocketChannel.class,
NioSocketChannel::new, NioSocketChannel.class,
NioDatagramChannel::new, NioDatagramChannel.class,
NIO("NIO", NioServerSocketChannel::new,
NioSocketChannel::new,
NioDatagramChannel::new,
(name, type) -> new NioEventLoopGroup(0, createThreadFactory(name, type))),
EPOLL("epoll", EpollServerSocketChannel::new, EpollServerSocketChannel.class,
EpollSocketChannel::new, EpollSocketChannel.class,
EpollDatagramChannel::new, EpollDatagramChannel.class,
EPOLL("epoll", EpollServerSocketChannel::new,
EpollSocketChannel::new,
EpollDatagramChannel::new,
(name, type) -> new EpollEventLoopGroup(0, createThreadFactory(name, type)));
final String name;
@Deprecated
final Class<? extends ServerSocketChannel> serverSocketChannelClass;
@Deprecated
final Class<? extends SocketChannel> socketChannelClass;
@Deprecated
final Class<? extends DatagramChannel> datagramChannelClass;
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory;
final ChannelFactory<? extends SocketChannel> socketChannelFactory;
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory;
@ -43,34 +36,16 @@ enum TransportType {
TransportType(final String name,
final ChannelFactory<? extends ServerSocketChannel> serverSocketChannelFactory,
final Class<? extends ServerSocketChannel> serverSocketChannelClass,
final ChannelFactory<? extends SocketChannel> socketChannelFactory,
final Class<? extends SocketChannel> socketChannelClass,
final ChannelFactory<? extends DatagramChannel> datagramChannelFactory,
final Class<? extends DatagramChannel> datagramChannelClass,
final BiFunction<String, Type, EventLoopGroup> eventLoopGroupFactory) {
this.name = name;
this.serverSocketChannelClass = serverSocketChannelClass;
this.socketChannelClass = socketChannelClass;
this.datagramChannelClass = datagramChannelClass;
this.serverSocketChannelFactory = serverSocketChannelFactory;
this.socketChannelFactory = socketChannelFactory;
this.datagramChannelFactory = datagramChannelFactory;
this.eventLoopGroupFactory = eventLoopGroupFactory;
}
@Deprecated
TransportType(final String name,
final Class<? extends ServerSocketChannel> serverSocketChannelClass,
final Class<? extends SocketChannel> socketChannelClass,
final Class<? extends DatagramChannel> datagramChannelClass,
final BiFunction<String, Type, EventLoopGroup> eventLoopGroupFactory) {
this(name, new ReflectiveChannelFactory<>(serverSocketChannelClass), serverSocketChannelClass,
new ReflectiveChannelFactory<>(socketChannelClass), socketChannelClass,
new ReflectiveChannelFactory<>(datagramChannelClass), datagramChannelClass,
eventLoopGroupFactory);
}
@Override
public String toString() {
return this.name;