|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.AbstractBuffers
org.mortbay.jetty.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.mortbay.jetty.AbstractBuffers |
---|
AbstractBuffers.ThreadBuffers |
Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
protected int |
_lowResourceMaxIdleTime
|
protected int |
_maxIdleTime
|
protected int |
_soLingerTime
|
Fields inherited from class org.mortbay.component.AbstractLifeCycle |
---|
_listeners |
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(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()
|
ThreadPool |
getThreadPool()
|
boolean |
isConfidential(Request request)
|
boolean |
isForwarded()
Is reverse proxy handling on? |
boolean |
isIntegral(Request request)
|
void |
join()
|
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(ThreadPool pool)
|
void |
statsReset()
Reset statistics. |
void |
stopAccept(int acceptorID)
|
String |
toString()
|
Methods inherited from class org.mortbay.jetty.AbstractBuffers |
---|
getBuffer, getHeaderBufferSize, getRequestBufferSize, getResponseBufferSize, newBuffer, returnBuffer, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSize |
Methods inherited from class org.mortbay.component.AbstractLifeCycle |
---|
addLifeCycleListener, 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.mortbay.jetty.Connector |
---|
close, getConnection, getHeaderBufferSize, getLocalPort, getRequestBufferSize, getResponseBufferSize, open, setHeaderBufferSize, setRequestBufferSize, setResponseBufferSize |
Methods inherited from interface org.mortbay.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Methods inherited from interface org.mortbay.io.Buffers |
---|
getBuffer, returnBuffer |
Field Detail |
---|
protected int _maxIdleTime
protected int _lowResourceMaxIdleTime
protected int _soLingerTime
Constructor Detail |
---|
public AbstractConnector()
Method Detail |
---|
public Server getServer()
getServer
in interface Connector
public void setServer(Server server)
setServer
in interface Connector
public ThreadPool getThreadPool()
public void setThreadPool(ThreadPool pool)
public void setHost(String host)
setHost
in interface Connector
public String getHost()
getHost
in interface Connector
public void setPort(int port)
setPort
in interface Connector
port
- The port fto listen of for connections or 0 if any available
port may be used.public int getPort()
getPort
in interface Connector
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 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
protected String getLeftMostValue(String headerValue)
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 request
public 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 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.public Continuation newContinuation()
newContinuation
in interface Connector
protected abstract void accept(int acceptorID) throws IOException, InterruptedException
IOException
InterruptedException
public void stopAccept(int acceptorID) throws Exception
Exception
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()
getName
in interface Connector
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |