electric.webserver.messages.tcp
Class TCPMessageFactory

java.lang.Object
  extended byelectric.webserver.messages.tcp.TCPMessageFactory
All Implemented Interfaces:
IHTTPConstants, IMessageFactory

public class TCPMessageFactory
extends java.lang.Object
implements IMessageFactory, IHTTPConstants

TCPMessageFactory creates servlet request and response objects based on plain-old-sockets. This is the default factory, and is made available even if no factories are registered in glue-config.xml.

Author:
webMethods

Field Summary
 
Fields inherited from interface electric.util.http.IHTTPConstants
ACCEPT_LANGUAGE, ACCEPT_RANGES, APPLICATION_BINARY, APPLICATION_OCTET_STREAM, ASCII, AUTHORIZATION, BASIC, BOUNDARY, CHARSET_EQUALS, CHUNKED, CLOSE, COLON_SLASH_SLASH, CONNECT, CONNECTION, CONTENT_ID, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, CONTINUATION_STATUS, CONTINUE_EXPECTATION, COOKIE, COOKIE_LISTENER, DATE, DEFAULT_CONTENT_TYPE, DEFAULT_HTTP_CHARSET, DEFAULT_HTTPS_PORT, DEFAULT_MIME_TYPE, DEFAULT_PROXY_PORT, DIGEST, EOL, EXPECT, EXPECT_HEADER, FORM_URLENCODED, GET, GLUE_SESSION, HEAD, HOST, HTTP_1_0, HTTP_1_1, HTTP_PROTOCOL, HTTPS_PROTOCOL, IF_MODIFIED_SINCE, KEEP_ALIVE, LAST_MODIFIED, LOCATION, MD5_HASH, MIME_BOUNDARY, MIME_VERSION, MULTIPART_CONTENT_TYPE, OK, POST, PROXY_AUTHORIZATION, RANGE, SC_CONTINUE, SC_MOVED, SC_MOVED_PERMANENTLY, SC_OK, SC_PROXY_AUTHENTICATION_REQUIRED, SC_UNAUTHORIZED, SEPARATOR, SERVER, SERVER_PREFIX, SERVER_TYPE, SET_COOKIE_0, SET_COOKIE_1, SLASH, START, TEXT_HTML, TEXT_PLAIN, TEXT_XML, TEXT_XML_UTF_8, TRANSFER_ENCODING, USER_AGENT, WWW_AUTHENTICATE
 
Constructor Summary
TCPMessageFactory()
           
 
Method Summary
 InboundHTTPRequest createRequest(IChannel channel)
          Create a new servlet request based on the channel.
 OutboundHTTPResponse createResponse(IChannel channel, InboundHTTPRequest request)
          Create a servlet response based on the given channel and request.
 boolean matches(java.lang.String protocol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCPMessageFactory

public TCPMessageFactory()
Method Detail

matches

public boolean matches(java.lang.String protocol)
Specified by:
matches in interface IMessageFactory
Parameters:
protocol -
Returns:
true if the protocol is "http", false otherwise.

createRequest

public InboundHTTPRequest createRequest(IChannel channel)
                                 throws java.io.IOException
Description copied from interface: IMessageFactory
Create a new servlet request based on the channel. To faciliate low-level filtering, this method may return null, in which case the channel will be immediately forwarded to createResponse for generation of an error response.

Specified by:
createRequest in interface IMessageFactory
Parameters:
channel -
Returns:
a new InboundHTTPRequest.
Throws:
java.io.IOException

createResponse

public OutboundHTTPResponse createResponse(IChannel channel,
                                           InboundHTTPRequest request)
                                    throws java.io.IOException
Description copied from interface: IMessageFactory
Create a servlet response based on the given channel and request. If the request is null, assume that there is an error condition and create an appropriate http error response. The error response will be returned directly to the client without being dispatched to any user servlet. If null is returned, the channel will be closed immediately with no response at all returned to the client.

This is an internal GLUE api, and is subject to change without notice across minor revisions.

Specified by:
createResponse in interface IMessageFactory
Parameters:
channel -
request -
Returns:
a new OutboundHTTPResponse
Throws:
java.io.IOException


copyright© 2001-2004 by webMethods All Rights Reserved.