|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.http.HttpBuffers
org.eclipse.jetty.server.AbstractConnector
public abstract class AbstractConnector
Abstract Connector implementation. This abstract implementation of the Connector interface provides:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
AbstractLifeCycle.AbstractLifeCycleListener |
| Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
LifeCycle.Listener |
| Field Summary | |
|---|---|
protected int |
_lowResourceMaxIdleTime
|
protected int |
_maxIdleTime
|
protected int |
_soLingerTime
|
| Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
_listeners, FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING |
| Constructor Summary | |
|---|---|
AbstractConnector()
|
|
| Method Summary | |
|---|---|
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()
|
String |
dump()
|
void |
dump(Appendable out,
String indent)
|
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 |
getMaxIdleTime()
|
String |
getName()
|
int |
getPort()
|
int |
getRequests()
|
boolean |
getResolveNames()
|
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 |
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 |
setResolveNames(boolean resolve)
|
void |
setReuseAddress(boolean reuseAddress)
|
void |
setServer(Server server)
|
void |
setSoLingerTime(int soLingerTime)
|
void |
setStatsOn(boolean on)
|
void |
setThreadPool(ThreadPool pool)
|
void |
statsReset()
Reset statistics. |
void |
stopAccept(int acceptorID)
|
String |
toString()
|
| Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
|---|
addLifeCycleListener, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.jetty.server.Connector |
|---|
close, getConnection, getLocalPort, getRequestBuffers, getRequestBufferSize, getRequestHeaderSize, getResponseBuffers, getResponseBufferSize, getResponseHeaderSize, open, setRequestBufferSize, setRequestHeaderSize, setResponseBufferSize, setResponseHeaderSize |
| Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
|---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
| Field Detail |
|---|
protected int _maxIdleTime
protected int _lowResourceMaxIdleTime
protected int _soLingerTime
| Constructor Detail |
|---|
public AbstractConnector()
| Method Detail |
|---|
public Server getServer()
getServer in interface Connectorpublic void setServer(Server server)
setServer in interface Connectorpublic ThreadPool getThreadPool()
public void setThreadPool(ThreadPool pool)
public void setHost(String host)
Connector
setHost in interface Connectorhost - The hostname representing the interface to which
this connector will bind, or null for all interfaces.public String getHost()
getHost in interface Connectorpublic void setPort(int port)
setPort in interface Connectorport - The port fto listen of for connections or 0 if any available
port may be used.public int getPort()
getPort in interface Connectorpublic 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.public final int getLowResourceMaxIdleTime()
getLowResourceMaxIdleTime in interface Connectorpublic 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 HttpBuffersException
protected void doStop()
throws Exception
doStop in class HttpBuffersException
public void join()
throws InterruptedException
InterruptedException
protected void configure(Socket socket)
throws IOException
IOException
public void customize(EndPoint endpoint,
Request request)
throws IOException
Connector
customize in interface ConnectorIOException
protected void checkForwardedHeaders(EndPoint endpoint,
Request request)
throws IOException
IOException
protected String getLeftMostFieldValue(HttpFields fields,
String header)
public void persist(EndPoint endpoint)
throws IOException
Connector
persist in interface ConnectorIOExceptionpublic int getConfidentialPort()
getConfidentialPort in interface ConnectorConstraint.getDataConstraint()public String getConfidentialScheme()
getConfidentialScheme in interface ConnectorConstraint.getDataConstraint()public boolean isIntegral(Request request)
isIntegral in interface Connectorrequest - A request
public int getIntegralPort()
getIntegralPort in interface ConnectorConstraint.getDataConstraint()public String getIntegralScheme()
getIntegralScheme in interface ConnectorConstraint.getDataConstraint()public boolean isConfidential(Request request)
isConfidential in interface Connectorrequest - A request
public 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
IOException
InterruptedException
public void stopAccept(int acceptorID)
throws Exception
Exceptionpublic 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 headerspublic 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 String toString()
toString in class AbstractLifeCyclepublic String getName()
getName in interface Connectorpublic 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 Connectorpublic String dump()
dump in interface Dumpable
public void dump(Appendable out,
String indent)
throws IOException
dump in interface DumpableIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||