WebObjects 5.2

com.webobjects.eodistribution.client
Class EOHTTPChannel

java.lang.Object
  |
  +--com.webobjects.eodistribution.client.EODistributionChannel
        |
        +--com.webobjects.eodistribution.client.EOHTTPChannel

public class EOHTTPChannel
extends EODistributionChannel

An EOHTTPChannel is a concrete implementation of an EODistributionChannel which handles communication between the client and server in distributed Java Client applications using the HTTP protocol (POST commands).

EOHTTPChannels use regular sockets to establish the connection. You can subclass EOHTTPChannel and override the createSocket method if you want to use different kinds of sockets, for example to implement an SSL channel.


Inner classes inherited from class com.webobjects.eodistribution.client.EODistributionChannel
EODistributionChannel.Delegate
 
Field Summary
static String ApplicationURLKey
          The name of the applicationURL connection key.
static String ComponentURLKey
          The name of the componentURL connection key.
static String PageKey
          The name of the page connection key.
static String SessionIDKey
          The name of the sessionID connection key.
 
Constructor Summary
EOHTTPChannel()
          Creates a new HTTP channel.
 
Method Summary
 NSArray connectionKeys()
          Returns the connection keys for EOHTTPChannels (not all the keys have to be specified, usually the application URL is sufficient):
 Socket createSocket(String protocol, String hostName, int portNumber)
          Creates and returns a new socket to communicate with the server.
 void establishConnection()
          Establishes a connection with the server and begins communication using the HTTP protocol.
 Object responseToMessage(Object message, NSCoder coder)
          Sends the message message from the client to the server using the HTTP POST command.
 
Methods inherited from class com.webobjects.eodistribution.client.EODistributionChannel
channelWithName, connectionDictionary, delegate, setConnectionDictionary, setDelegate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ApplicationURLKey

public static final String ApplicationURLKey
The name of the applicationURL connection key. The application URL is the URL of the server application.

ComponentURLKey

public static final String ComponentURLKey
The name of the componentURL connection key. The component URL identifies the WOJavaClientComponent component used on the server side to represent the client.

PageKey

public static final String PageKey
The name of the page connection key. If specified, the channel connects to a WOJavaClientComponent on the page specified by name with this connection key (the default is the Main page).

SessionIDKey

public static final String SessionIDKey
The name of the sessionID connection key. The session ID identifies the session used on the server side for the client.
Constructor Detail

EOHTTPChannel

public EOHTTPChannel()
Creates a new HTTP channel.
Method Detail

connectionKeys

public NSArray connectionKeys()

Returns the connection keys for EOHTTPChannels (not all the keys have to be specified, usually the application URL is sufficient):

applicationURL The URL of the server application.
componentURL The component URL of the WOJavaClientComponent on the server side.
sessionID The Session ID of the session on the server side.
page The page to connect to.
Overrides:
connectionKeys in class EODistributionChannel
Returns:
an array of the HTTP channel connection keys

createSocket

public Socket createSocket(String protocol,
                           String hostName,
                           int portNumber)
                    throws IOException
Creates and returns a new socket to communicate with the server. You can override this method if you wish to use different kinds of sockets, for example to implement an SSL channel.
Parameters:
protocol - the communication protocol to use
hostName - the name of the host to connect to
portNumber - the port number to connect to
Returns:
the socket

establishConnection

public void establishConnection()
Establishes a connection with the server and begins communication using the HTTP protocol. The method retrieves host, port, and URL information from the connection dictionary (application URL). Throws an NSForwardException containing an IOException if a communication problem occurs and an IllegalArgumentException if required information is missing from the connection dictionary.
Overrides:
establishConnection in class EODistributionChannel
Following copied from class: com.webobjects.eodistribution.client.EODistributionChannel
See Also:
EODistributionChannel.responseToMessage(Object, NSCoder)

responseToMessage

public Object responseToMessage(Object message,
                                NSCoder coder)
Sends the message message from the client to the server using the HTTP POST command. The message is encoded before it is sent using the coder coder. Synchronously receives, decodes, and returns the response to the message. Throws an IllegalStateException if the method is re-entered or an NSForwardException containing an IOException if a communication problem occurs.
Overrides:
responseToMessage in class EODistributionChannel
Parameters:
message - the message object to be sent to the server
coder - the coder to be used to encode the message object
Returns:
the message return value

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.