Package org.apache.mina.common
Class TransportType
java.lang.Object
org.apache.mina.common.TransportType
- All Implemented Interfaces:
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)
.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransportType
Transport type: UDP/IP (Registry name: "DATAGRAM" or "UDP")static final TransportType
Transport type: TCP/IP (Registry name: "SOCKET" or "TCP")static final TransportType
Transport type: in-VM pipe (Registry name: "VM_PIPE") Please refer to org.apache.mina.protocol.vmpipe package. -
Constructor Summary
ConstructorsConstructorDescriptionTransportType
(String[] names, boolean connectionless) Creates a new instance.TransportType
(String[] names, Class<? extends Object> envelopeType, boolean connectionless) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransportType
getInstance
(String name) Returns the transport type of the specified name.getNames()
Returns the known names of this transport type.boolean
Returnstrue
if the session of this transport type is connectionless.toString()
-
Field Details
-
SOCKET
Transport type: TCP/IP (Registry name: "SOCKET" or "TCP") -
DATAGRAM
Transport type: UDP/IP (Registry name: "DATAGRAM" or "UDP") -
VM_PIPE
Transport type: in-VM pipe (Registry name: "VM_PIPE") Please refer to org.apache.mina.protocol.vmpipe package.
-
-
Constructor Details
-
TransportType
Creates a new instance. New transport type is automatically registered to internal registry so that you can look it up usinggetInstance(String)
.- Parameters:
names
- the name or aliases of this transport typeconnectionless
- true if and only if this transport type is connectionless- Throws:
IllegalArgumentException
- if names are already registered or empty
-
TransportType
Creates a new instance. New transport type is automatically registered to internal registry so that you can look it up usinggetInstance(String)
.- Parameters:
names
- the name or aliases of this transport typeconnectionless
- true if and only if this transport type is connectionless- Throws:
IllegalArgumentException
- if names are already registered or empty
-
-
Method Details
-
getInstance
Returns the transport type of the specified name. All names are case-insensitive.- Parameters:
name
- the name of the transport type- Returns:
- the transport type
- Throws:
IllegalArgumentException
- if the specified name is not available.
-
isConnectionless
public boolean isConnectionless()Returnstrue
if the session of this transport type is connectionless. -
getEnvelopeType
-
getNames
Returns the known names of this transport type. -
toString
-