FileDocCategorySizeDatePackage
Connector.javaAPI DocGlassfish v2 API11090Fri May 04 22:31:50 BST 2007org.apache.catalina

Connector

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:
  • Receive a request from the client application.
  • Create (or allocate from a pool) appropriate Request and Response instances, and populate their properties based on the contents of the received request, as described below.
    • For all Requests, the connector, protocol, remoteAddr, response, scheme, secure, serverName, serverPort and stream properties MUST be set. The contentLength and contentType properties are also generally set.
    • For HttpRequests, the method, queryString, requestedSessionCookie, requestedSessionId, requestedSessionURL, requestURI, and secure properties MUST be set. In addition, the various addXxx methods must be called to record the presence of cookies, headers, and locales in the original request.
    • For all Responses, the connector, request, and stream properties MUST be set.
    • No additional headers must be set by the Connector for HttpResponses.
  • 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.
author
Craig R. McClanahan
version
$Revision: 1.6 $ $Date: 2007/05/05 05:31:50 $

Fields Summary
Constructors Summary
Methods Summary
public RequestcreateRequest()
Create (or allocate) and return a Request object suitable for specifying the contents of a Request to the responsible Container.

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

public org.apache.coyote.AdaptergetAdapter()
Get the Adapter used by this connector.

public booleangetAuthPassthroughEnabled()
Returns the value of this connector's authPassthroughEnabled flag.

return
true if this connector is receiving its requests from a trusted intermediate server, false otherwise

public java.security.cert.X509Certificate[]getCertificates(Request request)
Get the underlying WebContainer certificate for the request

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

public java.lang.StringgetDefaultHost()
Gets the default host of this Connector.

return
The default host of this Connector

public booleangetEnableLookups()
Return the "enable DNS lookups" flag.

public org.apache.catalina.net.ServerSocketFactorygetFactory()
Return the server socket factory used by this Container.

public java.lang.StringgetInfo()
Return descriptive information about this Connector implementation.

public com.sun.appserv.ProxyHandlergetProxyHandler()
Gets the ProxyHandler instance associated with this CoyoteConnector.

return
ProxyHandler instance associated with this CoyoteConnector, or null

public intgetRedirectPort()
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.

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

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

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

public java.lang.StringgetURIEncoding()
Get the encoding to be used for byte<-->char conversion for data sent/received via this Connector

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

exception
LifecycleException If this server was already initialized.

public voidsetAdapter(org.apache.coyote.Adapter adapter)
Set the Adapter used by this connector.

public voidsetAuthPassthroughEnabled(boolean authPassthroughEnabled)
Sets the value of this connector's authPassthroughEnabled flag.

param
authPassthroughEnabled true if this connector is receiving its requests from a trusted intermediate server, false otherwise

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

param
container The new Container to use

public voidsetDefaultHost(java.lang.String defaultHost)
Sets the default host for this Connector.

param
defaultHost The default host for this Connector

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

param
enableLookups The new "enable DNS lookups" flag value

public voidsetFactory(org.apache.catalina.net.ServerSocketFactory factory)
Set the server socket factory used by this Container.

param
factory The new server socket factory

public voidsetProxyHandler(com.sun.appserv.ProxyHandler proxyHandler)
Sets the ProxyHandler implementation for this CoyoteConnector to use.

param
proxyHandler ProxyHandler instance to use

public voidsetRedirectPort(int redirectPort)
Set the redirect port number.

param
redirectPort The redirect port number (non-SSL to SSL)

public voidsetScheme(java.lang.String scheme)
Set the scheme that will be assigned to requests received through this connector.

param
scheme The new scheme

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

param
secure The new secure connection flag

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

param
service The service that owns this Engine

public voidsetURIEncoding(java.lang.String encoding)
Set the encoding to be used for byte<-->char conversion for data sent/received via this Connector