org.mortbay.jetty
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, setResponseBufferSize
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getConnection, getHeaderBufferSize, getLocalPort, getRequestBufferSize, getResponseBufferSize, open, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSize
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
getBuffer, returnBuffer
protected 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 Connector
public 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 Connector
maxIdleTime
- The maxIdleTime to set.public int getLowResourceMaxIdleTime()
getLowResourceMaxIdleTime
in interface Connector
public void setLowResourceMaxIdleTime(int maxIdleTime)
setLowResourceMaxIdleTime
in interface Connector
maxIdleTime
- 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 AbstractBuffers
Exception
protected void doStop() throws Exception
doStop
in class org.mortbay.component.AbstractLifeCycle
Exception
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 Connector
IOException
protected void checkForwardedHeaders(EndPoint endpoint, Request request) throws IOException
IOException
public void persist(EndPoint endpoint) throws IOException
Connector
persist
in interface Connector
IOException
public int getConfidentialPort()
getConfidentialPort
in interface Connector
Constraint.getDataConstraint()
public String getConfidentialScheme()
getConfidentialScheme
in interface Connector
Constraint.getDataConstraint()
public boolean isIntegral(Request request)
isIntegral
in interface Connector
request
- A requestpublic int getIntegralPort()
getIntegralPort
in interface Connector
Constraint.getDataConstraint()
public String getIntegralScheme()
getIntegralScheme
in interface Connector
Constraint.getDataConstraint()
public boolean isConfidential(Request request)
isConfidential
in interface Connector
request
- 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 Connector
protected abstract void accept(int acceptorID) throws IOException, InterruptedException
IOException
InterruptedException
public boolean getResolveNames()
getResolveNames
in interface Connector
public 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 AbstractBuffers
public String getName()
public void setName(String name)
public int getRequests()
getRequests
in interface Connector
public long getConnectionsDurationMin()
getConnectionsDurationMin
in interface Connector
public long getConnectionsDurationTotal()
getConnectionsDurationTotal
in interface Connector
public int getConnectionsOpenMin()
getConnectionsOpenMin
in interface Connector
public int getConnectionsRequestsMin()
getConnectionsRequestsMin
in interface Connector
public int getConnections()
getConnections
in interface Connector
public int getConnectionsOpen()
getConnectionsOpen
in interface Connector
public int getConnectionsOpenMax()
getConnectionsOpenMax
in interface Connector
public long getConnectionsDurationAve()
getConnectionsDurationAve
in interface Connector
public long getConnectionsDurationMax()
getConnectionsDurationMax
in interface Connector
public int getConnectionsRequestsAve()
getConnectionsRequestsAve
in interface Connector
public int getConnectionsRequestsMax()
getConnectionsRequestsMax
in interface Connector
public void statsReset()
statsReset
in interface Connector
public void setStatsOn(boolean on)
setStatsOn
in interface Connector
public boolean getStatsOn()
getStatsOn
in interface Connector
public long getStatsOnMs()
getStatsOnMs
in interface Connector
protected 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.