private static class TcpEndpoint.ConnectionEndpointImpl extends Object implements ConnectionEndpoint
Modifier and Type | Field and Description |
---|---|
private String |
host |
private int |
port |
private SocketFactory |
sf |
Constructor and Description |
---|
ConnectionEndpointImpl(String host,
int port,
SocketFactory sf) |
Modifier and Type | Method and Description |
---|---|
private void |
checkResolvePermission() |
Connection |
connect(OutboundRequestHandle handle)
Invoked by ConnectionManager to create a new connection.
|
Connection |
connect(OutboundRequestHandle handle,
Collection active,
Collection idle)
Invoked by ConnectionManager to reuse an existing
connection.
|
private Socket |
connectToHost(Constraints.Distilled distilled)
Returns a socket connected to this endpoint's host and
port, according the specified constraints.
|
private Socket |
connectToSocketAddress(SocketAddress socketAddress,
Constraints.Distilled distilled)
Returns a socket connected to the specified address, with a
timeout governed by the specified constraints.
|
private Socket |
newSocket()
Returns a new unconnected socket, using this endpoint's
socket factory if non-null.
|
private final String host
private final int port
private final SocketFactory sf
ConnectionEndpointImpl(String host, int port, SocketFactory sf)
public Connection connect(OutboundRequestHandle handle) throws IOException
connect
in interface ConnectionEndpoint
handle
- the handle for the requestIOException
- if an I/O exception occursprivate Socket connectToHost(Constraints.Distilled distilled) throws IOException
IOException
private Socket connectToSocketAddress(SocketAddress socketAddress, Constraints.Distilled distilled) throws IOException
IOException
private Socket newSocket() throws IOException
IOException
public Connection connect(OutboundRequestHandle handle, Collection active, Collection idle)
connect
in interface ConnectionEndpoint
handle
- the handle for the requestactive
- the connections with requests in progressidle
- the connections with no requests in progressnull
private void checkResolvePermission()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.