public abstract class AbstractConnector extends AggregateLifeCycle implements HttpBuffers, Connector, Dumpable
AbstractLifeCycle.AbstractLifeCycleListenerLifeCycle.Listener| Modifier and Type | Field and Description |
|---|---|
protected HttpBuffersImpl |
_buffers |
protected int |
_lowResourceMaxIdleTime |
protected int |
_maxIdleTime |
protected int |
_soLingerTime |
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING| Constructor and Description |
|---|
AbstractConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
accept(int acceptorID) |
protected void |
checkForwardedHeaders(EndPoint endpoint,
Request request) |
protected void |
configure(Socket socket) |
protected void |
connectionClosed(Connection connection) |
protected void |
connectionOpened(Connection connection) |
protected void |
connectionUpgraded(Connection oldConnection,
Connection newConnection) |
void |
customize(EndPoint endpoint,
Request request)
Customize a request for an endpoint.
|
protected void |
doStart() |
protected void |
doStop() |
int |
getAcceptorPriorityOffset() |
int |
getAcceptors() |
int |
getAcceptQueueSize() |
int |
getConfidentialPort() |
String |
getConfidentialScheme() |
int |
getConnections() |
long |
getConnectionsDurationMax() |
double |
getConnectionsDurationMean() |
double |
getConnectionsDurationStdDev() |
long |
getConnectionsDurationTotal() |
int |
getConnectionsOpen() |
int |
getConnectionsOpenMax() |
int |
getConnectionsRequestsMax() |
double |
getConnectionsRequestsMean() |
double |
getConnectionsRequestsStdDev() |
String |
getForwardedCipherSuiteHeader() |
String |
getForwardedForHeader() |
String |
getForwardedHostHeader() |
String |
getForwardedProtoHeader()
Get the forwardedProtoHeader.
|
String |
getForwardedServerHeader() |
String |
getForwardedSslSessionIdHeader() |
String |
getHost() |
String |
getHostHeader() |
int |
getIntegralPort() |
String |
getIntegralScheme() |
protected String |
getLeftMostFieldValue(HttpFields fields,
String header) |
int |
getLowResourceMaxIdleTime()
Deprecated.
|
int |
getLowResourcesMaxIdleTime() |
int |
getMaxBuffers() |
int |
getMaxIdleTime() |
String |
getName() |
int |
getPort() |
Buffers |
getRequestBuffers() |
int |
getRequestBufferSize() |
Buffers.Type |
getRequestBufferType() |
int |
getRequestHeaderSize() |
Buffers.Type |
getRequestHeaderType() |
int |
getRequests() |
boolean |
getResolveNames() |
Buffers |
getResponseBuffers() |
int |
getResponseBufferSize() |
Buffers.Type |
getResponseBufferType() |
int |
getResponseHeaderSize() |
Buffers.Type |
getResponseHeaderType() |
boolean |
getReuseAddress() |
Server |
getServer() |
int |
getSoLingerTime() |
boolean |
getStatsOn() |
long |
getStatsOnMs() |
ThreadPool |
getThreadPool() |
boolean |
isConfidential(Request request) |
boolean |
isForwarded()
Is reverse proxy handling on?
|
boolean |
isIntegral(Request request) |
boolean |
isLowResources()
Check if low on resources.
|
void |
join() |
void |
persist(EndPoint endpoint)
Persist an endpoint.
|
void |
setAcceptorPriorityOffset(int offset)
Set the priority offset of the acceptor threads.
|
void |
setAcceptors(int acceptors) |
void |
setAcceptQueueSize(int acceptQueueSize) |
void |
setConfidentialPort(int confidentialPort) |
void |
setConfidentialScheme(String confidentialScheme) |
void |
setForwarded(boolean check)
Set reverse proxy handling.
|
void |
setForwardedCipherSuiteHeader(String forwardedCipherSuite) |
void |
setForwardedForHeader(String forwardedRemoteAddressHeader) |
void |
setForwardedHostHeader(String forwardedHostHeader) |
void |
setForwardedProtoHeader(String forwardedProtoHeader)
Set the forwardedProtoHeader.
|
void |
setForwardedServerHeader(String forwardedServerHeader) |
void |
setForwardedSslSessionIdHeader(String forwardedSslSessionId) |
void |
setHost(String host)
Set the hostname of the interface to bind to.
|
void |
setHostHeader(String hostHeader)
Set a forced valued for the host header to control what is returned by
ServletRequest.getServerName() and ServletRequest.getServerPort(). |
void |
setIntegralPort(int integralPort) |
void |
setIntegralScheme(String integralScheme) |
void |
setLowResourceMaxIdleTime(int maxIdleTime)
Deprecated.
|
void |
setLowResourcesMaxIdleTime(int maxIdleTime) |
void |
setMaxBuffers(int maxBuffers) |
void |
setMaxIdleTime(int maxIdleTime)
Set the maximum Idle time for a connection, which roughly translates to the
Socket.setSoTimeout(int) call, although with NIO implementations
other mechanisms may be used to implement the timeout. |
void |
setName(String name) |
void |
setPort(int port) |
void |
setRequestBuffers(Buffers requestBuffers) |
void |
setRequestBufferSize(int requestBufferSize)
Set the size of the content buffer for receiving requests.
|
void |
setRequestHeaderSize(int requestHeaderSize)
Set the size of the buffer to be used for request headers.
|
void |
setResolveNames(boolean resolve) |
void |
setResponseBuffers(Buffers responseBuffers) |
void |
setResponseBufferSize(int responseBufferSize)
Set the size of the content buffer for sending responses.
|
void |
setResponseHeaderSize(int responseHeaderSize)
Set the size of the buffer to be used for request headers.
|
void |
setReuseAddress(boolean reuseAddress) |
void |
setServer(Server server) |
void |
setSoLingerTime(int soLingerTime) |
void |
setStatsOn(boolean on) |
void |
setThreadPool(ThreadPool pool)
Set the ThreadPool.
|
void |
statsReset()
Reset statistics.
|
void |
stopAccept(int acceptorID) |
String |
toString() |
addBean, addBean, contains, destroy, dump, dump, dump, dump, dump, dumpObject, dumpStdErr, dumpThis, getBean, getBeans, getBeans, isManaged, manage, removeBean, removeBeans, unmanageaddLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, getConnection, getLocalPort, openaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopprotected int _maxIdleTime
protected int _lowResourceMaxIdleTime
protected int _soLingerTime
protected final HttpBuffersImpl _buffers
public ThreadPool getThreadPool()
public void setThreadPool(ThreadPool pool)
AggregateLifeCycle.addBean(Object) so that
it's lifecycle may be managed as a AggregateLifeCycle.pool - the threadPool to setpublic void setHost(String host)
Connectorpublic String getHost()
public void setPort(int port)
public int getPort()
public int getMaxIdleTime()
getMaxIdleTime in interface Connectorpublic void setMaxIdleTime(int maxIdleTime)
Socket.setSoTimeout(int) call, although with NIO implementations
other mechanisms may be used to implement the timeout. The max idle time is applied:
Previously, Jetty supported separate idle timeouts and IO operation timeouts, however the expense of changing the value of soTimeout was significant, so these timeouts were merged. With the advent of NIO, it may be possible to again differentiate these values (if there is demand).
setMaxIdleTime in interface ConnectormaxIdleTime - The maxIdleTime to set.public int getLowResourcesMaxIdleTime()
public void setLowResourcesMaxIdleTime(int maxIdleTime)
maxIdleTime - The maxIdleTime to set when resources are low.@Deprecated public final int getLowResourceMaxIdleTime()
getLowResourceMaxIdleTime in interface Connector@Deprecated public final void setLowResourceMaxIdleTime(int maxIdleTime)
setLowResourceMaxIdleTime in interface ConnectormaxIdleTime - The maxIdleTime to set when resources are low.public int getSoLingerTime()
public int getAcceptQueueSize()
public void setAcceptQueueSize(int acceptQueueSize)
acceptQueueSize - The acceptQueueSize to set.public int getAcceptors()
public void setAcceptors(int acceptors)
acceptors - The number of acceptor threads to set.public void setSoLingerTime(int soLingerTime)
soLingerTime - The soLingerTime to set or -1 to disable.protected void doStart()
throws Exception
doStart in class AggregateLifeCycleExceptionprotected void doStop()
throws Exception
doStop in class AggregateLifeCycleExceptionpublic void join()
throws InterruptedException
InterruptedExceptionprotected void configure(Socket socket) throws IOException
IOExceptionpublic void customize(EndPoint endpoint, Request request) throws IOException
Connectorcustomize in interface ConnectorIOExceptionprotected void checkForwardedHeaders(EndPoint endpoint, Request request) throws IOException
IOExceptionprotected String getLeftMostFieldValue(HttpFields fields, String header)
public void persist(EndPoint endpoint) throws IOException
Connectorpersist in interface ConnectorIOExceptionpublic int getConfidentialPort()
getConfidentialPort in interface ConnectorConstraintpublic String getConfidentialScheme()
getConfidentialScheme in interface ConnectorConstraintpublic boolean isIntegral(Request request)
isIntegral in interface Connectorrequest - A requestpublic int getIntegralPort()
getIntegralPort in interface ConnectorConstraintpublic String getIntegralScheme()
getIntegralScheme in interface ConnectorConstraintpublic boolean isConfidential(Request request)
isConfidential in interface Connectorrequest - A requestpublic void setConfidentialPort(int confidentialPort)
confidentialPort - The confidentialPort to set.public void setConfidentialScheme(String confidentialScheme)
confidentialScheme - The confidentialScheme to set.public void setIntegralPort(int integralPort)
integralPort - The integralPort to set.public void setIntegralScheme(String integralScheme)
integralScheme - The integralScheme to set.protected abstract void accept(int acceptorID)
throws IOException,
InterruptedException
IOExceptionInterruptedExceptionpublic boolean getResolveNames()
getResolveNames in interface Connectorpublic void setResolveNames(boolean resolve)
public boolean isForwarded()
public void setForwarded(boolean check)
check - true if this connector is checking the x-forwarded-for/host/server headerssetForwardedForHeader(String),
setForwardedHostHeader(String),
setForwardedProtoHeader(String),
setForwardedServerHeader(String)public String getHostHeader()
public void setHostHeader(String hostHeader)
ServletRequest.getServerName() and ServletRequest.getServerPort().
This value is only used if isForwarded() is true.hostHeader - The value of the host header to force.public String getForwardedHostHeader()
public void setForwardedHostHeader(String forwardedHostHeader)
forwardedHostHeader - The header name for forwarded hosts (default x-forwarded-host)setForwarded(boolean)public String getForwardedServerHeader()
setForwarded(boolean)public void setForwardedServerHeader(String forwardedServerHeader)
forwardedServerHeader - The header name for forwarded server (default x-forwarded-server)setForwarded(boolean)public String getForwardedForHeader()
setForwarded(boolean)public void setForwardedForHeader(String forwardedRemoteAddressHeader)
forwardedRemoteAddressHeader - The header name for forwarded for (default x-forwarded-for)setForwarded(boolean)public String getForwardedProtoHeader()
setForwarded(boolean)public void setForwardedProtoHeader(String forwardedProtoHeader)
forwardedProtoHeader - the forwardedProtoHeader to set (default X-Forwarded-For)setForwarded(boolean)public String getForwardedCipherSuiteHeader()
public void setForwardedCipherSuiteHeader(String forwardedCipherSuite)
forwardedCipherSuite - The header name holding a forwarded cipher suite (default null)public String getForwardedSslSessionIdHeader()
public void setForwardedSslSessionIdHeader(String forwardedSslSessionId)
forwardedSslSessionId - The header name holding a forwarded SSL Session ID (default null)public int getRequestBufferSize()
getRequestBufferSize in interface HttpBuffersgetRequestBufferSize in interface Connectorpublic void setRequestBufferSize(int requestBufferSize)
ConnectorsetRequestBufferSize in interface HttpBufferssetRequestBufferSize in interface ConnectorrequestBufferSize - The requestBufferSize to set.public int getRequestHeaderSize()
getRequestHeaderSize in interface HttpBuffersgetRequestHeaderSize in interface Connectorpublic void setRequestHeaderSize(int requestHeaderSize)
ConnectorsetRequestHeaderSize in interface HttpBufferssetRequestHeaderSize in interface ConnectorrequestHeaderSize - The size in bytes.public int getResponseBufferSize()
getResponseBufferSize in interface HttpBuffersgetResponseBufferSize in interface Connectorpublic void setResponseBufferSize(int responseBufferSize)
ConnectorsetResponseBufferSize in interface HttpBufferssetResponseBufferSize in interface ConnectorresponseBufferSize - The responseBufferSize to set.public int getResponseHeaderSize()
getResponseHeaderSize in interface HttpBuffersgetResponseHeaderSize in interface Connectorpublic void setResponseHeaderSize(int responseHeaderSize)
ConnectorsetResponseHeaderSize in interface HttpBufferssetResponseHeaderSize in interface ConnectorresponseHeaderSize - The size in bytes.public Buffers.Type getRequestBufferType()
getRequestBufferType in interface HttpBufferspublic Buffers.Type getRequestHeaderType()
getRequestHeaderType in interface HttpBufferspublic Buffers.Type getResponseBufferType()
getResponseBufferType in interface HttpBufferspublic Buffers.Type getResponseHeaderType()
getResponseHeaderType in interface HttpBufferspublic void setRequestBuffers(Buffers requestBuffers)
setRequestBuffers in interface HttpBufferspublic void setResponseBuffers(Buffers responseBuffers)
setResponseBuffers in interface HttpBufferspublic Buffers getRequestBuffers()
getRequestBuffers in interface HttpBuffersgetRequestBuffers in interface Connectorpublic Buffers getResponseBuffers()
getResponseBuffers in interface HttpBuffersgetResponseBuffers in interface Connectorpublic void setMaxBuffers(int maxBuffers)
setMaxBuffers in interface HttpBufferspublic int getMaxBuffers()
getMaxBuffers in interface HttpBufferspublic String getName()
public void setName(String name)
public int getRequests()
getRequests in interface Connectorpublic long getConnectionsDurationTotal()
getConnectionsDurationTotal in interface Connectorpublic int getConnections()
getConnections in interface Connectorpublic int getConnectionsOpen()
getConnectionsOpen in interface Connectorpublic int getConnectionsOpenMax()
getConnectionsOpenMax in interface Connectorpublic double getConnectionsDurationMean()
getConnectionsDurationMean in interface Connectorpublic long getConnectionsDurationMax()
getConnectionsDurationMax in interface Connectorpublic double getConnectionsDurationStdDev()
getConnectionsDurationStdDev in interface Connectorpublic double getConnectionsRequestsMean()
getConnectionsRequestsMean in interface Connectorpublic int getConnectionsRequestsMax()
getConnectionsRequestsMax in interface Connectorpublic double getConnectionsRequestsStdDev()
getConnectionsRequestsStdDev in interface Connectorpublic void statsReset()
statsReset in interface Connectorpublic void setStatsOn(boolean on)
setStatsOn in interface Connectorpublic boolean getStatsOn()
getStatsOn in interface Connectorpublic long getStatsOnMs()
getStatsOnMs in interface Connectorprotected void connectionOpened(Connection connection)
protected void connectionUpgraded(Connection oldConnection, Connection newConnection)
protected void connectionClosed(Connection connection)
public int getAcceptorPriorityOffset()
public void setAcceptorPriorityOffset(int offset)
offset - the amount to alter the priority of the acceptor threads.public boolean getReuseAddress()
public void setReuseAddress(boolean reuseAddress)
reuseAddress - True if the the server socket will be opened in SO_REUSEADDR mode.public boolean isLowResources()
ConnectorThreadPool.isLowOnThreads() on the connector threadpool
or the server threadpool if there is no connector threadpool.
For blocking connectors, low resources is used to trigger
usage of Connector.getLowResourceMaxIdleTime() for the timeout
of an idle connection.
for non-blocking connectors, the number of connections is used instead of this method, to select the timeout of an idle connection.
For all connectors, low resources is used to trigger the
usage of Connector.getLowResourceMaxIdleTime() for read and
write operations.
isLowResources in interface ConnectorCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.