org.apache.mina.common
Class TransportType
java.lang.Object
org.apache.mina.common.TransportType
- Serializable
public final class TransportType
extends java.lang.Object
implements Serializable
Represents network transport types.
MINA provides three transport types by default:
You can also create your own transport type. Please refer to
TransportType(String[],boolean)
.
TransportType(String[] names, Object> envelopeType, boolean connectionless) - Creates a new instance.
|
TransportType(String[] names, boolean connectionless) - Creates a new instance.
|
DATAGRAM
public static final TransportType DATAGRAM
Transport type: UDP/IP (Registry name: "DATAGRAM" or "UDP")
SOCKET
public static final TransportType SOCKET
Transport type: TCP/IP (Registry name: "SOCKET" or "TCP")
TransportType
public TransportType(String[] names,
Object> envelopeType,
boolean connectionless)
Creates a new instance. New transport type is automatically registered
to internal registry so that you can look it up using
getInstance(String)
.
names
- the name or aliases of this transport typeconnectionless
- true if and only if this transport type is connectionless
TransportType
public TransportType(String[] names,
boolean connectionless)
Creates a new instance. New transport type is automatically registered
to internal registry so that you can look it up using
getInstance(String)
.
names
- the name or aliases of this transport typeconnectionless
- true if and only if this transport type is connectionless
String toString
public @Override String toString()
extends Object> getEnvelopeType
public Class extends Object> getEnvelopeType()
getInstance
public static TransportType getInstance(String name)
Returns the transport type of the specified name.
All names are case-insensitive.
name
- the name of the transport type
getNames
public Set getNames()
Returns the known names of this transport type.
isConnectionless
public boolean isConnectionless()
Returns true
if the session of this transport type is
connectionless.