Class Transport.Wrapper
- All Implemented Interfaces:
Transport
- Direct Known Subclasses:
QuicTransport
- Enclosing interface:
- Transport
A wrapper for Transport
instances to allow layering of Transport
s.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Transport
Transport.IP, Transport.Socket, Transport.TCPIP, Transport.TCPUnix, Transport.UDPIP, Transport.UDPUnix, Transport.Unix, Transport.Wrapper
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
connect
(SocketAddress socketAddress, Map<String, Object> context) Establishes a connection to the given socket address.boolean
newConnection
(EndPoint endPoint, Map<String, Object> context) Creates a newConnection
to be associated with the given low-levelEndPoint
.newEndPoint
(Scheduler scheduler, ManagedSelector selector, SelectableChannel selectable, SelectionKey selectionKey) ForTransport
s that are based on sockets, or forTransport
s that are layered on top of anotherTransport
that is based on sockets, this method is invoked to create a newEndPoint
that wraps theSelectableChannel
created byTransport.newSelectableChannel()
.ForTransport
s that are based on sockets, or forTransport
s that are layered on top of anotherTransport
that is based on sockets, this method is invoked to create a newSelectableChannel
used for the socket communication.boolean
Returns whether thisTransport
requires resolution of domain names.toString()
unwrap()
-
Constructor Details
-
Wrapper
-
-
Method Details
-
getWrapped
-
unwrap
-
isIntrinsicallySecure
public boolean isIntrinsicallySecure()- Specified by:
isIntrinsicallySecure
in interfaceTransport
- Returns:
- whether this
Transport
is intrinsically secure.
-
requiresDomainNameResolution
public boolean requiresDomainNameResolution()Description copied from interface:Transport
Returns whether this
Transport
requires resolution of domain names.When domain name resolution is required, it must be performed by an external service, and the value returned by
Transport.getSocketAddress()
is ignored, while the resolved socket address is eventually passed toTransport.connect(SocketAddress, Map)
. Otherwise, domain name resolution is not required, and the value returned byTransport.getSocketAddress()
is eventually passed toTransport.connect(SocketAddress, Map)
.- Specified by:
requiresDomainNameResolution
in interfaceTransport
- Returns:
- whether this
Transport
requires domain names resolution
-
connect
Description copied from interface:Transport
Establishes a connection to the given socket address.
For
Transport
s thatrequire domain name resolution
, this is the IP address resolved from the domain name. ForTransport
s that do not require domain name resolution (for example Unix-Domain sockets, or memory) this is the socket address to connect to. -
getSocketAddress
- Specified by:
getSocketAddress
in interfaceTransport
- Returns:
- the socket address to connect to in case domain name resolution is not required
-
newSelectableChannel
Description copied from interface:Transport
For
Transport
s that are based on sockets, or forTransport
s that are layered on top of anotherTransport
that is based on sockets, this method is invoked to create a newSelectableChannel
used for the socket communication.- Specified by:
newSelectableChannel
in interfaceTransport
- Returns:
- a new
SelectableChannel
used for the socket communication, ornull
if the communication does not use sockets. - Throws:
IOException
- if theSelectableChannel
cannot be created
-
newEndPoint
public EndPoint newEndPoint(Scheduler scheduler, ManagedSelector selector, SelectableChannel selectable, SelectionKey selectionKey) Description copied from interface:Transport
For
Transport
s that are based on sockets, or forTransport
s that are layered on top of anotherTransport
that is based on sockets, this method is invoked to create a newEndPoint
that wraps theSelectableChannel
created byTransport.newSelectableChannel()
.- Specified by:
newEndPoint
in interfaceTransport
- Parameters:
scheduler
- theScheduler
selector
- theManagedSelector
selectable
- theSelectableChannel
selectionKey
- theSelectionKey
- Returns:
- a new
EndPoint
-
newConnection
Description copied from interface:Transport
Creates a new
Connection
to be associated with the given low-levelEndPoint
.For non-layered
Transport
s such as TCP/IP, theConnection
is typically that of the high-level protocol. For layeredTransport
s such as QUIC, theConnection
is typically that of the layeredTransport
.- Specified by:
newConnection
in interfaceTransport
- Parameters:
endPoint
- theEndPoint
to associate theConnection
tocontext
- the context information to create the connection- Returns:
- a new
Connection
- Throws:
IOException
- if theConnection
cannot be created
-
toString
-