org.eclipse.jetty.server.bio
Class SocketConnector
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.http.HttpBuffers
org.eclipse.jetty.server.AbstractConnector
org.eclipse.jetty.server.bio.SocketConnector
- All Implemented Interfaces:
- Connector, LifeCycle
- Direct Known Subclasses:
- Ajp13SocketConnector, SslSocketConnector
public class SocketConnector
- extends AbstractConnector
Socket Connector.
This connector implements a traditional blocking IO and threading model.
Normal JRE sockets are used and a thread is allocated per connection.
Buffers are managed so that large buffers are only allocated to active connections.
This Connector should only be used if NIO is not available.
Methods inherited from class org.eclipse.jetty.server.AbstractConnector |
checkForwardedHeaders, configure, connectionClosed, connectionOpened, getAcceptorPriorityOffset, getAcceptors, getAcceptQueueSize, getConfidentialPort, getConfidentialScheme, getConnections, getConnectionsDurationAve, getConnectionsDurationMax, getConnectionsDurationMin, getConnectionsDurationTotal, getConnectionsOpen, getConnectionsOpenMax, getConnectionsOpenMin, getConnectionsRequestsAve, getConnectionsRequestsMax, getConnectionsRequestsMin, getForwardedForHeader, getForwardedHostHeader, getForwardedServerHeader, getHost, getHostHeader, getIntegralPort, getIntegralScheme, getLeftMostValue, getLowResourceMaxIdleTime, getMaxIdleTime, getName, getPort, getRequests, getResolveNames, getReuseAddress, getServer, getSoLingerTime, getStatsOn, getStatsOnMs, getThreadPool, isConfidential, isForwarded, isIntegral, isLowResources, isRequestHeader, isResponseHeader, join, newBuffer, newRequestBuffer, newRequestHeader, newResponseBuffer, newResponseHeader, persist, setAcceptorPriorityOffset, setAcceptors, setAcceptQueueSize, setConfidentialPort, setConfidentialScheme, setForwarded, setForwardedForHeader, setForwardedHostHeader, setForwardedServerHeader, setHost, setHostHeader, setIntegralPort, setIntegralScheme, setLowResourceMaxIdleTime, setMaxIdleTime, setName, setPort, setResolveNames, setReuseAddress, setServer, setSoLingerTime, setStatsOn, setThreadPool, statsReset, stopAccept, toString |
Methods inherited from class org.eclipse.jetty.http.HttpBuffers |
getHeaderBufferSize, getRequestBuffers, getRequestBufferSize, getRequestHeaderSize, getResponseBuffers, getResponseBufferSize, getResponseHeaderSize, setHeaderBufferSize, setRequestBufferSize, setRequestHeaderSize, setResponseBufferSize, setResponseHeaderSize |
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle |
addLifeCycleListener, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
_serverSocket
protected ServerSocket _serverSocket
_connections
protected final Set _connections
SocketConnector
public SocketConnector()
- Constructor.
getConnection
public Object getConnection()
- Returns:
- the underlying socket, channel, buffer etc. for the connector.
open
public void open()
throws IOException
- Description copied from interface:
Connector
- Opens the connector
- Throws:
IOException
newServerSocket
protected ServerSocket newServerSocket(String host,
int port,
int backlog)
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Throws:
IOException
accept
public void accept(int acceptorID)
throws IOException,
InterruptedException
- Specified by:
accept
in class AbstractConnector
- Throws:
IOException
InterruptedException
newHttpConnection
protected HttpConnection newHttpConnection(EndPoint endpoint)
- Allows subclass to override Conection if required.
customize
public void customize(EndPoint endpoint,
Request request)
throws IOException
- Description copied from interface:
Connector
- Customize a request for an endpoint.
Called on every request to allow customization of the request for
the particular endpoint (eg security properties from a SSL connection).
- Specified by:
customize
in interface Connector
- Overrides:
customize
in class AbstractConnector
- Throws:
IOException
getLocalPort
public int getLocalPort()
- Returns:
- The actual port the connector is listening on or -1 if there
is no port or the connector is not open.
doStart
protected void doStart()
throws Exception
- Overrides:
doStart
in class AbstractConnector
- Throws:
Exception
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class AbstractConnector
- Throws:
Exception
Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.