@Deprecated public abstract class ConnectionHelper<T extends Connector> extends BaseHelper<T>
Parameter name | Value type | Default value | Description |
---|---|---|---|
maxConnectionsPerHost | int | -1 | Maximum number of concurrent connections per host (IP address). |
initialConnections | int | 100 | Initial number of connections pre-created in the connections pool. This saves time during establishment of new connections as heavy byte buffers are simply reused. |
maxTotalConnections | int | -1 | Maximum number of concurrent connections in total. |
persistingConnections | boolean | true | Indicates if connections should be kept alive after a call. |
pipeliningConnections | boolean | false | Indicates if pipelining connections are supported. |
pooledConnections | boolean | true | Indicates if connections should be pooled to save instantiation time. |
socketKeepAlive | boolean | true | Indicates if a TCP connection should be automatically kept alive after 2 hours of inactivity. |
socketOobInline | boolean | false | Indicates if urgent TCP data received on the socket will be received through the socket input stream. |
socketLingerTimeMs | int | -1 | Time to block when a socket close is requested or -1 to not block at all. |
socketNoDelay | boolean | false | Enables Nagle's algorithm if set to false, preventing sending of small TCP packets. |
socketReceiveBufferSize | int | 8192 | The hinted size of the underlying TCP buffers used by the platform for inbound network I/O. |
socketReuseAddress | boolean | true | Indicates if sockets can be reused right away even if they are busy (in TIME_WAIT or 2MSL wait state). |
socketSendBufferSize | int | 8192 | The hinted size of the underlying TCP buffers used by the platform for outbound network I/O. |
socketTrafficClass | int | 0 | Type of service to set in IP packets. |
clientSide, controller, inboundMessages, outboundMessages
Constructor and Description |
---|
ConnectionHelper(T connector,
boolean clientSide)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addOutboundMessage(Response response)
Deprecated.
Add the outbound message to the queue and wake up the IO controller.
|
void |
checkin(org.restlet.ext.nio.internal.connection.Connection<?> connection)
Deprecated.
Checks in the connection back into the pool.
|
org.restlet.ext.nio.internal.connection.Connection<T> |
checkout(java.nio.channels.SocketChannel socketChannel,
org.restlet.ext.nio.internal.controller.ConnectionController controller,
java.net.InetSocketAddress socketAddress)
Deprecated.
Checks out a connection associated to the given socket from the pool.
|
void |
configure(java.net.Socket socket)
Deprecated.
Configures a given socket based on the helper parameters.
|
abstract org.restlet.ext.nio.internal.connection.Connection<T> |
createConnection(java.nio.channels.SocketChannel socketChannel,
org.restlet.ext.nio.internal.controller.ConnectionController controller,
java.net.InetSocketAddress socketAddress)
Deprecated.
Creates a connection associated to the given socket.
|
void |
createConnectionPool()
Deprecated.
Creates the connection pool.
|
abstract org.restlet.ext.nio.internal.way.InboundWay |
createInboundWay(org.restlet.ext.nio.internal.connection.Connection<T> connection,
int bufferSize)
Deprecated.
Creates an inbound way for the given connection.
|
abstract org.restlet.ext.nio.internal.way.OutboundWay |
createOutboundWay(org.restlet.ext.nio.internal.connection.Connection<T> connection,
int bufferSize)
Deprecated.
Creates an outbound way for the given connection.
|
protected void |
doFinishStop()
Deprecated.
Finish stopping the helper.
|
protected void |
doGracefulStop()
Deprecated.
Do a graceful stop first.
|
org.restlet.ext.nio.internal.connection.ConnectionPool<T> |
getConnectionPool()
Deprecated.
Returns the connection pool.
|
java.util.List<org.restlet.ext.nio.internal.connection.Connection<T>> |
getConnections()
Deprecated.
Returns the set of active connections.
|
int |
getInitialConnections()
Deprecated.
Returns the initial number of connections pre-created in the connections
pool.
|
int |
getMaxConnectionsPerHost()
Deprecated.
Returns the maximum concurrent connections per host (IP address).
|
int |
getMaxTotalConnections()
Deprecated.
Returns the maximum number of concurrent connections allowed.
|
int |
getSocketLingerTimeMs()
Deprecated.
Returns the time to block when a socket close is requested or -1 to not
block at all.
|
int |
getSocketReceiveBufferSize()
Deprecated.
Returns the hinted size of the underlying TCP buffers used by the
platform for inbound network I/O.
|
int |
getSocketSendBufferSize()
Deprecated.
Returns the hinted size of the underlying TCP buffers used by the
platform for outbound network I/O.
|
int |
getSocketTrafficClass()
Deprecated.
Returns the type of service to set in IP packets.
|
boolean |
isPersistingConnections()
Deprecated.
Indicates if persistent connections should be used if possible.
|
boolean |
isPipeliningConnections()
Deprecated.
Indicates if pipelining connections are supported.
|
boolean |
isPooledConnection()
Deprecated.
Indicates if the connection objects should be pooled to save
instantiation time.
|
abstract boolean |
isProxying()
Deprecated.
Indicates if the helper is going through a client proxy or is a server
proxy.
|
boolean |
isSocketKeepAlive()
Deprecated.
Indicates if a TCP connection should be automatically kept alive after 2
hours of inactivity.
|
boolean |
isSocketNoDelay()
Deprecated.
Enables Nagle's algorithm if set to false, preventing sending of small
TCP packets.
|
boolean |
isSocketOobInline()
Deprecated.
Indicates if urgent TCP data received on the socket will be received
through the socket input stream.
|
boolean |
isSocketReuseAddress()
Deprecated.
Indicates if sockets can be reused right away even if they are busy (in
TIME_WAIT or 2MSL wait state).
|
control, createController, createControllerService, createRequest, createWorkerService, doHandleInbound, doHandleOutbound, execute, getController, getControllerSleepTimeMs, getInboundBufferSize, getInboundMessages, getLowThreads, getMaxIoIdleTimeMs, getMaxQueued, getMaxThreadIdleTimeMs, getMaxThreads, getMinThreads, getOutboundBufferSize, getOutboundMessages, getRequest, getThrottleTimeMs, getTraceStream, getTransport, getWorkerService, handleInbound, handleInbound, handleOutbound, handleOutbound, hasWorkerThreads, isClientSide, isControllerDaemon, isDirectBuffers, isServerSide, isTracing, isWorkerServiceOverloaded, onInboundError, onOutboundError, start, stop, traceWorkerService
getConnectorService, getContext, getProtocols, update
getAttributes, getHelped, getHelpedParameters, getLogger, getMetadataService, handle, setHelped
public ConnectionHelper(T connector, boolean clientSide)
connector
- The helped connector.clientSide
- True if it is helping a client connector.public void addOutboundMessage(Response response)
response
- The outbound message.public void checkin(org.restlet.ext.nio.internal.connection.Connection<?> connection)
connection
- The connection to check in.public org.restlet.ext.nio.internal.connection.Connection<T> checkout(java.nio.channels.SocketChannel socketChannel, org.restlet.ext.nio.internal.controller.ConnectionController controller, java.net.InetSocketAddress socketAddress) throws java.io.IOException
socketChannel
- The underlying NIO socket channel.controller
- The underlying IO controller.socketAddress
- The associated IP address.java.io.IOException
public void configure(java.net.Socket socket) throws java.net.SocketException
socket
- The socket to configure.java.net.SocketException
public abstract org.restlet.ext.nio.internal.connection.Connection<T> createConnection(java.nio.channels.SocketChannel socketChannel, org.restlet.ext.nio.internal.controller.ConnectionController controller, java.net.InetSocketAddress socketAddress) throws java.io.IOException
socketChannel
- The underlying NIO socket channel.controller
- The underlying IO controller.socketAddress
- The associated IP address.java.io.IOException
public void createConnectionPool()
public abstract org.restlet.ext.nio.internal.way.InboundWay createInboundWay(org.restlet.ext.nio.internal.connection.Connection<T> connection, int bufferSize)
connection
- The parent connection.bufferSize
- The byte buffer size.public abstract org.restlet.ext.nio.internal.way.OutboundWay createOutboundWay(org.restlet.ext.nio.internal.connection.Connection<T> connection, int bufferSize)
connection
- The parent connection.bufferSize
- The byte buffer size.protected void doFinishStop()
BaseHelper
doFinishStop
in class BaseHelper<T extends Connector>
protected void doGracefulStop()
BaseHelper
doGracefulStop
in class BaseHelper<T extends Connector>
public org.restlet.ext.nio.internal.connection.ConnectionPool<T> getConnectionPool()
public java.util.List<org.restlet.ext.nio.internal.connection.Connection<T>> getConnections()
public int getInitialConnections()
public int getMaxConnectionsPerHost()
public int getMaxTotalConnections()
public int getSocketLingerTimeMs()
public int getSocketReceiveBufferSize()
public int getSocketSendBufferSize()
public int getSocketTrafficClass()
public boolean isPersistingConnections()
public boolean isPipeliningConnections()
public boolean isPooledConnection()
public abstract boolean isProxying()
public boolean isSocketKeepAlive()
public boolean isSocketNoDelay()
public boolean isSocketOobInline()
public boolean isSocketReuseAddress()
Copyright © 2005-2020 Restlet.