Package com.linecorp.armeria.common.util
Enum Class TransportType
- All Implemented Interfaces:
Serializable,Comparable<TransportType>,java.lang.constant.Constable
Native transport types.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends DatagramChannel>Returns theDatagramChannelclass that is available for this transport type.static Class<? extends DatagramChannel>datagramChannelType(EventLoopGroup eventLoopGroup) Returns the availableDatagramChannelclass that is compatible with the specifiedEventLoopGroup.Class<? extends ServerDomainSocketChannel>Returns theServerDomainSocketChannelclass that is available for this transport type.static Class<? extends ServerDomainSocketChannel>domainServerChannelType(EventLoopGroup eventLoopGroup) Returns theServerDomainSocketChannelclass that is compatible with the specifiedEventLoopGroup.Class<? extends DomainSocketChannel>Returns theDomainSocketChannelclass that is available for this transport type.static Class<? extends DomainSocketChannel>domainSocketChannelType(EventLoopGroup eventLoopGroup) Returns the availableDomainSocketChannelclass that is compatible with the specifiedEventLoopGroup.booleanReturns whether thisTransportTypeis currently available.static booleanisSupported(EventLoopGroup eventLoopGroup) Returns whether the specifiedEventLoopGroupis supported by any of the currently availableTransportTypes.Returns lowercase name ofTransportType.newEventLoopGroup(int nThreads, Function<TransportType, ThreadFactory> threadFactoryFactory) Creates the availableEventLoopGroup.Class<? extends ServerChannel>Returns theServerChannelclass that is available for this transport type.static Class<? extends ServerChannel>serverChannelType(EventLoopGroup eventLoopGroup) Returns theServerChannelclass that is compatible with the specifiedEventLoopGroup.Class<? extends SocketChannel>Returns theSocketChannelclass that is available for this transport type.static Class<? extends SocketChannel>socketChannelType(EventLoopGroup eventLoopGroup) Returns the availableSocketChannelclass that is compatible with the specifiedEventLoopGroup.booleanReturns whether thisTransportTypesupports Unix domain sockets or not.static booleansupportsDomainSockets(EventLoopGroup eventLoopGroup) Returns whether the specifiedEventLoopGroupsupports Unix domain sockets or not.Returns why thisTransportTypeis not available.static TransportTypeReturns the enum constant of this class with the specified name.static TransportType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NIO
-
EPOLL
-
KQUEUE
-
IO_URING
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
serverChannelType
Returns theServerChannelclass that is compatible with the specifiedEventLoopGroup.- Throws:
IllegalStateException- if the specifiedEventLoopGroupis not supported or itsTransportTypeis not currently available.
-
serverChannelType
Returns theServerChannelclass that is available for this transport type.- Throws:
IllegalStateException- if thisTransportTypeis not currently available.
-
socketChannelType
Returns the availableSocketChannelclass that is compatible with the specifiedEventLoopGroup.- Throws:
IllegalStateException- if the specifiedEventLoopGroupis not supported or itsTransportTypeis not currently available.
-
socketChannelType
Returns theSocketChannelclass that is available for this transport type.- Throws:
IllegalStateException- if thisTransportTypeis not currently available.
-
supportsDomainSockets
Returns whether the specifiedEventLoopGroupsupports Unix domain sockets or not. -
supportsDomainSockets
public boolean supportsDomainSockets()Returns whether thisTransportTypesupports Unix domain sockets or not. -
domainServerChannelType
public static Class<? extends ServerDomainSocketChannel> domainServerChannelType(EventLoopGroup eventLoopGroup) Returns theServerDomainSocketChannelclass that is compatible with the specifiedEventLoopGroup.- Throws:
IllegalStateException- if the specifiedEventLoopGroupis not supported or itsTransportTypeis not currently available.
-
domainServerChannelType
Returns theServerDomainSocketChannelclass that is available for this transport type.- Throws:
IllegalStateException- if thisTransportTypeis not currently available or doesn't support Unix domain sockets.
-
domainSocketChannelType
public static Class<? extends DomainSocketChannel> domainSocketChannelType(EventLoopGroup eventLoopGroup) Returns the availableDomainSocketChannelclass that is compatible with the specifiedEventLoopGroup.- Throws:
IllegalStateException- if the specifiedEventLoopGroupis not supported or itsTransportTypeis not currently available or doesn't support Unix domain sockets.
-
domainSocketChannelType
Returns theDomainSocketChannelclass that is available for this transport type.- Throws:
IllegalStateException- if thisTransportTypeis not currently available.
-
datagramChannelType
Returns the availableDatagramChannelclass that is compatible with the specifiedEventLoopGroup.- Throws:
IllegalStateException- if the specifiedEventLoopGroupis not supported or itsTransportTypeis not currently available.
-
datagramChannelType
Returns theDatagramChannelclass that is available for this transport type.- Throws:
IllegalStateException- if thisTransportTypeis not currently available.
-
isSupported
Returns whether the specifiedEventLoopGroupis supported by any of the currently availableTransportTypes. -
lowerCasedName
Returns lowercase name ofTransportType. This method is a shortcut for:Ascii.toLowerCase(name()); -
isAvailable
public boolean isAvailable()Returns whether thisTransportTypeis currently available.- See Also:
-
newEventLoopGroup
public EventLoopGroup newEventLoopGroup(int nThreads, Function<TransportType, ThreadFactory> threadFactoryFactory) Creates the availableEventLoopGroup.
-