electric.webserver.messages
Interface IMessageFactory

All Known Implementing Classes:
SSLMessageFactory, TCPMessageFactory

public interface IMessageFactory

IMessageFactory creates servlet request and response objects from IChannels. The messages may be customized based on the protocol of the underlying channel. For example. requests based on SSL expose certain SSL parameters as request attributes. Also, non-HTTP protocols that map closely to HTTP may be wrapped. Implementations are registered in glue-config.xml using <MessageFactory> elements. This is an internal webmethods interface and may change without notice even across minor versions.

One factory of each class is created and reused for all matching servers, so a factory should not hold server-specific state.

Author:
webMethods

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)
           
 

Method Detail

matches

public boolean matches(java.lang.String protocol)
Parameters:
protocol -
Returns:
true if this factory matches the given protocol, false otherwise.

createRequest

public InboundHTTPRequest createRequest(IChannel channel)
                                 throws java.io.IOException
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.

Parameters:
channel -
Returns:
a servlet request based on the given channel, or null if there is some problem with the request.
Throws:
java.io.IOException

createResponse

public OutboundHTTPResponse createResponse(IChannel channel,
                                           InboundHTTPRequest request)
                                    throws java.io.IOException
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.

Parameters:
channel -
request -
Returns:
a servlet response based on the given channel and request, or null if no response makes sense.
Throws:
java.io.IOException


copyright© 2001-2004 by webMethods All Rights Reserved.