org.mortbay.jetty.bio
Class SocketConnector

java.lang.Object
  extended by org.mortbay.component.AbstractLifeCycle
      extended by org.mortbay.jetty.AbstractConnector
          extended by org.mortbay.jetty.bio.SocketConnector
All Implemented Interfaces:
LifeCycle, Buffers, Connector
Direct Known Subclasses:
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.

Author:
gregw

Nested Class Summary
protected  class SocketConnector.Connection
           
 
Field Summary
protected  ServerSocket _serverSocket
           
 
Fields inherited from class org.mortbay.jetty.AbstractConnector
_maxIdleTime, _soLingerTime
 
Constructor Summary
SocketConnector()
          Constructor.
 
Method Summary
 void accept(int acceptorID)
           
 void close()
           
 void customize(EndPoint endpoint, Request request)
           
protected  Buffer newBuffer(int size)
           
protected  ServerSocket newServerSocket(SocketAddress addr, int backlog)
           
 void open()
           
 
Methods inherited from class org.mortbay.jetty.AbstractConnector
configure, doStart, doStop, getAcceptors, getAcceptQueueSize, getAddress, getBuffer, getConfidentialPort, getConfidentialScheme, getHeaderBufferSize, getHost, getIntegralPort, getIntegralScheme, getMaxIdleTime, getPort, getRequestBufferSize, getResponseBufferSize, getServer, getSoLingerTime, getThreadPool, isConfidential, isIntegral, join, newContinuation, returnBuffer, setAcceptors, setAcceptQueueSize, setConfidentialPort, setConfidentialScheme, setHeaderBufferSize, setHost, setIntegralPort, setIntegralScheme, setMaxIdleTime, setPort, setRequestBufferSize, setResponseBufferSize, setServer, setSoLingerTime, setThreadPool, toString
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, 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.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, start, stop
 

Field Detail

_serverSocket

protected ServerSocket _serverSocket
Constructor Detail

SocketConnector

public SocketConnector()
Constructor.

Method Detail

open

public void open()
          throws IOException
Specified by:
open in interface Connector
Specified by:
open in class AbstractConnector
Throws:
IOException

newServerSocket

protected ServerSocket newServerSocket(SocketAddress addr,
                                       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

newBuffer

protected Buffer newBuffer(int size)
Specified by:
newBuffer in class AbstractConnector

customize

public void customize(EndPoint endpoint,
                      Request request)
               throws IOException
Specified by:
customize in interface Connector
Overrides:
customize in class AbstractConnector
Throws:
IOException