Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mortbay.jetty
Interface Connector

All Superinterfaces:
  Buffers, LifeCycle

All Known Implementing Classes:
  AbstractConnector, AbstractNIOConnector, Ajp13SocketConnector, BlockingChannelConnector, InheritedChannelConnector, LocalConnector, SelectChannelConnector, SocketConnector, SslSelectChannelConnector, SslSocketConnector

    public interface Connector

extends LifeCycle, Buffers

HTTP Connector. Implementations of this interface provide connectors for the HTTP protocol. A connector receives requests (normally from a socket) and calls the handle method of the Handler object. These operations are performed using threads from the ThreadPool set on the connector. When a connector is registered with an instance of Server, then the server will set itself as both the ThreadPool and the Handler. Note that a connector can be used without a Server if a thread pool and handler are directly provided.

Author:
  gregw

Nested Class Summary

Nested classes/interfaces inherited from interface org.mortbay.component.LifeCycle
`LifeCycle.Listener`

Method Summary
`void` | `close()`
`void` | `customize(EndPoint endpoint, Request request)` Customize a request for an endpoint.
`int` | `getConfidentialPort()`
`java.lang.String` | `getConfidentialScheme()`
`java.lang.Object` | `getConnection()`
`int` | `getConnections()`
`long` | `getConnectionsDurationAve()`
`long` | `getConnectionsDurationMax()`
`long` | `getConnectionsDurationMin()`
`long` | `getConnectionsDurationTotal()`
`int` | `getConnectionsOpen()`
`int` | `getConnectionsOpenMax()`
`int` | `getConnectionsOpenMin()`
`int` | `getConnectionsRequestsAve()`
`int` | `getConnectionsRequestsMax()`
`int` | `getConnectionsRequestsMin()`
`int` | `getHeaderBufferSize()`
`java.lang.String` | `getHost()`
`int` | `getIntegralPort()`
`java.lang.String` | `getIntegralScheme()`
`int` | `getLocalPort()`
`int` | `getLowResourceMaxIdleTime()`
`int` | `getMaxIdleTime()`
`java.lang.String` | `getName()`
`int` | `getPort()`
`int` | `getRequestBufferSize()`
`int` | `getRequests()`
`boolean` | `getResolveNames()`
`int` | `getResponseBufferSize()`
`Server` | `getServer()`
`boolean` | `getStatsOn()`
`long` | `getStatsOnMs()`
`boolean` | `isConfidential(Request request)`
`boolean` | `isIntegral(Request request)`
`Continuation` | `newContinuation()`
`void` | `open()` Opens the connector
`void` | `persist(EndPoint endpoint)` Persist an endpoint.
`void` | `setHeaderBufferSize(int headerBufferSize)` Set the size of the buffer to be used for request and response headers.
`void` | `setHost(java.lang.String hostname)`
`void` | `setLowResourceMaxIdleTime(int ms)`
`void` | `setMaxIdleTime(int ms)`
`void` | `setPort(int port)`
`void` | `setRequestBufferSize(int requestBufferSize)` Set the size of the content buffer for receiving requests.
`void` | `setResponseBufferSize(int responseBufferSize)` Set the size of the content buffer for sending responses.
`void` | `setServer(Server server)`
`void` | `setStatsOn(boolean on)`
`void` | `statsReset()` Reset statistics.

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`

Method Detail

### getName

    java.lang.String getName()

  Returns:
    the name of the connector. Defaults to the HostName:port

### open

    void open()
              throws java.io.IOException

  Opens the connector

  Throws:
    `java.io.IOException`

### close

    void close()
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### setServer

    void setServer(Server server)

### getServer

    Server getServer()

### getHeaderBufferSize

    int getHeaderBufferSize()

  Returns:
    Returns the headerBufferSize.

### setHeaderBufferSize

    void setHeaderBufferSize(int headerBufferSize)

  Set the size of the buffer to be used for request and response headers. An idle connection will at most have one buffer of this size allocated.

  Parameters:
    `headerBufferSize` - The headerBufferSize to set.

### getRequestBufferSize

    int getRequestBufferSize()

  Returns:
    Returns the requestBufferSize.

### setRequestBufferSize

    void setRequestBufferSize(int requestBufferSize)

  Set the size of the content buffer for receiving requests. These buffers are only used for active connections that have requests with bodies that will not fit within the header buffer.

  Parameters:
    `requestBufferSize` - The requestBufferSize to set.

### getResponseBufferSize

    int getResponseBufferSize()

  Returns:
    Returns the responseBufferSize.

### setResponseBufferSize

    void setResponseBufferSize(int responseBufferSize)

  Set the size of the content buffer for sending responses. These buffers are only used for active connections that are sending responses with bodies that will not fit within the header buffer.

  Parameters:
    `responseBufferSize` - The responseBufferSize to set.

### getIntegralPort

    int getIntegralPort()

  Returns:
    The port to use when redirecting a request if a data constraint of integral is required. See `Constraint.getDataConstraint()`

### getIntegralScheme

    java.lang.String getIntegralScheme()

  Returns:
    The schema to use when redirecting a request if a data constraint of integral is required. See `Constraint.getDataConstraint()`

### isIntegral

    boolean isIntegral(Request request)

  Parameters:
    `request` - A request
  Returns:
    true if the request is integral. This normally means the https schema has been used.

### getConfidentialPort

    int getConfidentialPort()

  Returns:
    The port to use when redirecting a request if a data constraint of confidential is required. See `Constraint.getDataConstraint()`

### getConfidentialScheme

    java.lang.String getConfidentialScheme()

  Returns:
    The schema to use when redirecting a request if a data constraint of confidential is required. See `Constraint.getDataConstraint()`

### isConfidential

    boolean isConfidential(Request request)

  Parameters:
    `request` - A request
  Returns:
    true if the request is confidential. This normally means the https schema has been used.

### customize

    void customize(EndPoint endpoint,
                   Request request)
                   throws java.io.IOException

  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).

  Parameters:
    `endpoint` -
    `request` -
  Throws:
    `java.io.IOException`

### persist

    void persist(EndPoint endpoint)
                 throws java.io.IOException

  Persist an endpoint. Called after every request if the connection is to remain open.

  Parameters:
    `endpoint` -
    `request` -
  Throws:
    `java.io.IOException`

### newContinuation

    Continuation newContinuation()

### getHost

    java.lang.String getHost()

### setHost

    void setHost(java.lang.String hostname)

### setPort

    void setPort(int port)

  Parameters:
    `port` - The port fto listen of for connections or 0 if any available port may be used.

### getPort

    int getPort()

  Returns:
    The configured port for the connector or 0 if any available port may be used.

### getLocalPort

    int getLocalPort()

  Returns:
    The actual port the connector is listening on or -1 if there is no port or the connector is not open.

### getMaxIdleTime

    int getMaxIdleTime()

### setMaxIdleTime

    void setMaxIdleTime(int ms)

### getLowResourceMaxIdleTime

    int getLowResourceMaxIdleTime()

### setLowResourceMaxIdleTime

    void setLowResourceMaxIdleTime(int ms)

### getConnection

    java.lang.Object getConnection()

  Returns:
    the underlying socket, channel, buffer etc. for the connector.

### getResolveNames

    boolean getResolveNames()

  Returns:
    true if names resolution should be done.

### getRequests

    int getRequests()

  Returns:
    Get the number of requests handled by this connector since last call of statsReset(). If setStatsOn(false) then this is undefined.

### getConnectionsDurationMin

    long getConnectionsDurationMin()

  Returns:
    Returns the connectionsDurationMin.

### getConnectionsDurationTotal

    long getConnectionsDurationTotal()

  Returns:
    Returns the connectionsDurationTotal.

### getConnectionsOpenMin

    int getConnectionsOpenMin()

  Returns:
    Returns the connectionsOpenMin.

### getConnectionsRequestsMin

    int getConnectionsRequestsMin()

  Returns:
    Returns the connectionsRequestsMin.

### getConnections

    int getConnections()

  Returns:
    Number of connections accepted by the server since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsOpen

    int getConnectionsOpen()

  Returns:
    Number of connections currently open that were opened since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsOpenMax

    int getConnectionsOpenMax()

  Returns:
    Maximum number of connections opened simultaneously since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsDurationAve

    long getConnectionsDurationAve()

  Returns:
    Average duration in milliseconds of open connections since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsDurationMax

    long getConnectionsDurationMax()

  Returns:
    Maximum duration in milliseconds of an open connection since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsRequestsAve

    int getConnectionsRequestsAve()

  Returns:
    Average number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

### getConnectionsRequestsMax

    int getConnectionsRequestsMax()

  Returns:
    Maximum number of requests per connection since statsReset() called. Undefined if setStatsOn(false).

### statsReset

    void statsReset()

  Reset statistics.

### setStatsOn

    void setStatsOn(boolean on)

### getStatsOn

    boolean getStatsOn()

  Returns:
    True if statistics collection is turned on.

### getStatsOnMs

    long getStatsOnMs()

  Returns:
    Timestamp stats were started at.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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