public abstract class AbstractConnector extends AbstractBuffers implements Connector
AbstractBuffers.ThreadBuffers| Modifier and Type | Field and Description |
|---|---|
protected int |
_lowResourceMaxIdleTime |
protected int |
_maxIdleTime |
protected int |
_soLingerTime |
| 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(HttpConnection connection) |
protected void |
connectionOpened(HttpConnection connection) |
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 |
getConnectionsDurationAve() |
long |
getConnectionsDurationMax() |
long |
getConnectionsDurationMin() |
long |
getConnectionsDurationTotal() |
int |
getConnectionsOpen() |
int |
getConnectionsOpenMax() |
int |
getConnectionsOpenMin() |
int |
getConnectionsRequestsAve() |
int |
getConnectionsRequestsMax() |
int |
getConnectionsRequestsMin() |
String |
getForwardedForHeader() |
String |
getForwardedHostHeader() |
String |
getForwardedServerHeader() |
String |
getHost() |
String |
getHostHeader() |
int |
getIntegralPort() |
String |
getIntegralScheme() |
protected String |
getLeftMostValue(String headerValue) |
int |
getLowResourceMaxIdleTime() |
int |
getMaxIdleTime() |
String |
getName() |
int |
getPort() |
int |
getRequests() |
boolean |
getResolveNames() |
boolean |
getReuseAddress() |
Server |
getServer() |
int |
getSoLingerTime() |
boolean |
getStatsOn() |
long |
getStatsOnMs() |
org.mortbay.thread.ThreadPool |
getThreadPool() |
boolean |
isConfidential(Request request) |
boolean |
isForwarded()
Is reverse proxy handling on?
|
boolean |
isIntegral(Request request) |
void |
join() |
org.mortbay.util.ajax.Continuation |
newContinuation() |
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 |
setForwardedForHeader(String forwardedRemoteAddressHeader) |
void |
setForwardedHostHeader(String forwardedHostHeader) |
void |
setForwardedServerHeader(String forwardedServerHeader) |
void |
setHost(String host) |
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) |
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(org.mortbay.thread.ThreadPool pool) |
void |
statsReset()
Reset statistics.
|
void |
stopAccept(int acceptorID) |
String |
toString() |
getBuffer, getHeaderBufferSize, getRequestBufferSize, getResponseBufferSize, newBuffer, returnBuffer, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSizeaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, getConnection, getHeaderBufferSize, getLocalPort, getRequestBufferSize, getResponseBufferSize, open, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSizeaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopgetBuffer, returnBufferprotected int _maxIdleTime
protected int _lowResourceMaxIdleTime
protected int _soLingerTime
public org.mortbay.thread.ThreadPool getThreadPool()
public void setThreadPool(org.mortbay.thread.ThreadPool pool)
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 getLowResourceMaxIdleTime()
getLowResourceMaxIdleTime in interface Connectorpublic void setLowResourceMaxIdleTime(int maxIdleTime)
setLowResourceMaxIdleTime in interface ConnectormaxIdleTime - The maxIdleTime to set.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 AbstractBuffersExceptionprotected void doStop()
throws Exception
doStop in class org.mortbay.component.AbstractLifeCycleExceptionpublic 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
IOExceptionpublic void persist(EndPoint endpoint) throws IOException
Connectorpersist 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 requestpublic 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 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.public org.mortbay.util.ajax.Continuation newContinuation()
newContinuation in interface Connectorprotected 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 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)public String getForwardedServerHeader()
public void setForwardedServerHeader(String forwardedServerHeader)
forwardedServerHeader - The header name for forwarded server (default x-forwarded-server)public String getForwardedForHeader()
public void setForwardedForHeader(String forwardedRemoteAddressHeader)
forwardedRemoteAddressHeader - The header name for forwarded for (default x-forwarded-for)public String toString()
toString in class AbstractBufferspublic String getName()
public void setName(String name)
public int getRequests()
getRequests in interface Connectorpublic long getConnectionsDurationMin()
getConnectionsDurationMin in interface Connectorpublic long getConnectionsDurationTotal()
getConnectionsDurationTotal in interface Connectorpublic int getConnectionsOpenMin()
getConnectionsOpenMin in interface Connectorpublic int getConnectionsRequestsMin()
getConnectionsRequestsMin in interface Connectorpublic int getConnections()
getConnections in interface Connectorpublic int getConnectionsOpen()
getConnectionsOpen in interface Connectorpublic int getConnectionsOpenMax()
getConnectionsOpenMax in interface Connectorpublic long getConnectionsDurationAve()
getConnectionsDurationAve in interface Connectorpublic long getConnectionsDurationMax()
getConnectionsDurationMax in interface Connectorpublic int getConnectionsRequestsAve()
getConnectionsRequestsAve in interface Connectorpublic int getConnectionsRequestsMax()
getConnectionsRequestsMax 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(HttpConnection connection)
protected void connectionClosed(HttpConnection 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.Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.