org.apache.catalina

Interface Connector

Known Implementing Classes:
Ajp13Connector, CoyoteConnector, CoyoteConnector

public interface Connector

A Connector is a component responsible receiving requests from, and returning responses to, a client application. A Connector performs the following general logic:
  • Identify an appropriate Container to use for processing this request. For a stand alone Catalina installation, this will probably be a (singleton) Engine implementation. For a Connector attaching Catalina to a web server such as Apache, this step could take advantage of parsing already performed within the web server to identify the Context, and perhaps even the Wrapper, to utilize in satisfying this Request.
  • Call the invoke() method of the selected Container, passing the initialized Request and Response instances as arguments.
  • Return any response created by the Container to the client, or return an appropriate error message if an exception of any type was thrown.
  • If utilizing a pool of Request and Response objects, recycle the pair of instances that was just used. It is expected that the implementation details of various Connectors will vary widely, so the logic above should considered typical rather than normative.
  • Version:
    $Revision: 1.3 $ $Date: 2004/02/27 14:58:38 $

    Author:
    Craig R. McClanahan

    Method Summary

    Request
    createRequest()
    Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.
    Response
    createResponse()
    Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.
    Container
    getContainer()
    Return the Container used for processing requests received by this Connector.
    boolean
    getEnableLookups()
    Return the "enable DNS lookups" flag.
    ServerSocketFactory
    getFactory()
    Return the server socket factory used by this Container.
    String
    getInfo()
    Return descriptive information about this Connector implementation.
    int
    getRedirectPort()
    Return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.
    String
    getScheme()
    Return the scheme that will be assigned to requests received through this connector.
    boolean
    getSecure()
    Return the secure connection flag that will be assigned to requests received through this connector.
    Service
    getService()
    Return the Service with which we are associated (if any).
    void
    initialize()
    Invoke a pre-startup initialization.
    void
    pause()
    Pause the connector.
    void
    resume()
    Pause the connector.
    void
    setContainer(Container container)
    Set the Container used for processing requests received by this Connector.
    void
    setEnableLookups(boolean enableLookups)
    Set the "enable DNS lookups" flag.
    void
    setFactory(ServerSocketFactory factory)
    Set the server socket factory used by this Container.
    void
    setRedirectPort(int redirectPort)
    Set the redirect port number.
    void
    setScheme(String scheme)
    Set the scheme that will be assigned to requests received through this connector.
    void
    setSecure(boolean secure)
    Set the secure connection flag that will be assigned to requests received through this connector.
    void
    setService(Service service)
    Set the Service with which we are associated (if any).

    Method Details

    createRequest

    public Request createRequest()
    Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.


    createResponse

    public Response createResponse()
    Create (or allocate) and return a Response object suitable for receiving the contents of a Response from the responsible Container.


    getContainer

    public Container getContainer()
    Return the Container used for processing requests received by this Connector.


    getEnableLookups

    public boolean getEnableLookups()
    Return the "enable DNS lookups" flag.


    getFactory

    public ServerSocketFactory getFactory()
    Return the server socket factory used by this Container.


    getInfo

    public String getInfo()
    Return descriptive information about this Connector implementation.


    getRedirectPort

    public int getRedirectPort()
    Return the port number to which a request should be redirected if it comes in on a non-SSL port and is subject to a security constraint with a transport guarantee that requires SSL.


    getScheme

    public String getScheme()
    Return the scheme that will be assigned to requests received through this connector. Default value is "http".


    getSecure

    public boolean getSecure()
    Return the secure connection flag that will be assigned to requests received through this connector. Default value is "false".


    getService

    public Service getService()
    Return the Service with which we are associated (if any).


    initialize

    public void initialize()
                throws LifecycleException
    Invoke a pre-startup initialization. This is used to allow connectors to bind to restricted ports under Unix operating environments.

    Throws:
    LifecycleException - If this server was already initialized.


    pause

    public void pause()
                throws LifecycleException
    Pause the connector.


    resume

    public void resume()
                throws LifecycleException
    Pause the connector.


    setContainer

    public void setContainer(Container container)
    Set the Container used for processing requests received by this Connector.

    Parameters:
    container - The new Container to use


    setEnableLookups

    public void setEnableLookups(boolean enableLookups)
    Set the "enable DNS lookups" flag.

    Parameters:
    enableLookups - The new "enable DNS lookups" flag value


    setFactory

    public void setFactory(ServerSocketFactory factory)
    Set the server socket factory used by this Container.

    Parameters:
    factory - The new server socket factory


    setRedirectPort

    public void setRedirectPort(int redirectPort)
    Set the redirect port number.

    Parameters:
    redirectPort - The redirect port number (non-SSL to SSL)


    setScheme

    public void setScheme(String scheme)
    Set the scheme that will be assigned to requests received through this connector.

    Parameters:
    scheme - The new scheme


    setSecure

    public void setSecure(boolean secure)
    Set the secure connection flag that will be assigned to requests received through this connector.

    Parameters:
    secure - The new secure connection flag


    setService

    public void setService(Service service)
    Set the Service with which we are associated (if any).

    Parameters:
    service - The service that owns this Engine


    Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.