## org.eclipse.jetty.websocket
Class WebSocketFactory

    java.lang.Object
      org.eclipse.jetty.websocket.WebSocketFactory

    public class WebSocketFactory

extends Object

Factory to create WebSocket connections

Constructor Summary
`WebSocketFactory()`
`WebSocketFactory(int bufferSize)`

Method Summary
`int` `getBufferSize()` Get the bufferSize.
`long` `getMaxIdleTime()` Get the maxIdleTime.
`void` `setBufferSize(int bufferSize)` Set the bufferSize.
`void` `setMaxIdleTime(int maxIdleTime)` Set the maxIdleTime.
`void` `upgrade(HttpServletRequest request, HttpServletResponse response, WebSocket websocket, String origin, String subprotocol)` Upgrade the request/response to a WebSocket Connection.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WebSocketFactory

    public WebSocketFactory()

### WebSocketFactory

    public WebSocketFactory(int bufferSize)

Method Detail

### getMaxIdleTime

    public long getMaxIdleTime()

  Get the maxIdleTime.

  Returns:
    the maxIdleTime

### setMaxIdleTime

    public void setMaxIdleTime(int maxIdleTime)

  Set the maxIdleTime.

  Parameters:
    `maxIdleTime` - the maxIdleTime to set

### getBufferSize

    public int getBufferSize()

  Get the bufferSize.

  Returns:
    the bufferSize

### setBufferSize

    public void setBufferSize(int bufferSize)

  Set the bufferSize.

  Parameters:
    `bufferSize` - the bufferSize to set

### upgrade

    public void upgrade(HttpServletRequest request,
                        HttpServletResponse response,
                        WebSocket websocket,
                        String origin,
                        String subprotocol)
                 throws IOException

  Upgrade the request/response to a WebSocket Connection.

  This method will not normally return, but will instead throw a UpgradeConnectionException, to exit HTTP handling and initiate WebSocket handling of the connection.

  Parameters:
    `request` - The request to upgrade
    `response` - The response to upgrade
    `websocket` - The websocket handler implementation to use
    `origin` - The origin of the websocket connection
    `subprotocol` - The protocol
  Throws:
    `UpgradeConnectionException` - Thrown to upgrade the connection
    `IOException`

Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.