WebObjects 5.2.3

com.webobjects.eodistribution.client
Class EODistributionChannel

java.lang.Object
  extended bycom.webobjects.eodistribution.client.EODistributionChannel
Direct Known Subclasses:
EOHTTPChannel

public abstract class EODistributionChannel
extends Object

EODistributionChannel is an abstract class that defines the interface for objects handling the communication of data between the client and the server in a distributed Java Client application. It is used by EODistributedObjectStores to invoke remote methods on the server side. The distribution layer also includes the EOHTTPChannel class, a concrete subclass of EODistributionChannel that handles communication via the HTTP protocol (the most common protocol in distributed Internet applications). You can create you own subclass of EODistributionChannel if you need client-server communication based on a different protocol such as CORBA/IIOP. All distribution channels subclasses are expected to have a no-argument constructor.

An EODistributionChannel object has a connection dictionary that contains the values required to establish a connection on the channel, for example port, host, and URL components. You can change the connection dictionary with the setConnectionDictionary method.


Nested Class Summary
static interface EODistributionChannel.Delegate
          This interface defines the methods that can be implemented by the delegate of EODistributionChannels -- mostly to handle exceptions.
 
Constructor Summary
EODistributionChannel()
          Creates a new distribution channel.
 
Method Summary
static EODistributionChannel channelWithName(String className)
          Returns an EODistributionChannel object instantiated from the class whose name is className.
 NSDictionary connectionDictionary()
          Returns the connection dictionary used to connect to the server.
abstract  NSArray connectionKeys()
          Subclasses have to implement this method to return an array of the connection dictionary keys required to establish a connection to the server.
 Object delegate()
          Returns the receiver's delegate.
abstract  void establishConnection()
          Subclasses have to implement this method to establish a connection with the server using a specific protocol.
abstract  Object responseToMessage(Object message, NSCoder coder)
          Subclasses have to implement this method to send a message to the server and synchronously receive a response.
 void setConnectionDictionary(NSDictionary connectionDictionary)
          Sets the connection dictionary to be used to connect to the server.
 void setDelegate(Object delegate)
          Sets the receiver's delegate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EODistributionChannel

public EODistributionChannel()
Creates a new distribution channel.

Method Detail

channelWithName

public static EODistributionChannel channelWithName(String className)
Returns an EODistributionChannel object instantiated from the class whose name is className. EODistributionChannel subclasses are expected to have a no-argument constructor. This method returns null if the channel can't be instantiated (which is probably because the class cannot be found).

Parameters:
className - the name of the distribution channel class to instantiate
Returns:
the new distribution channel or null if the channel can't be instantiated

connectionDictionary

public NSDictionary connectionDictionary()
Returns the connection dictionary used to connect to the server.

Returns:
the connection dictionary

connectionKeys

public abstract NSArray connectionKeys()
Subclasses have to implement this method to return an array of the connection dictionary keys required to establish a connection to the server.

Returns:
an array of connection dictionary keys
See Also:
setConnectionDictionary(NSDictionary)

delegate

public Object delegate()
Returns the receiver's delegate.

Returns:
the receiver's delegate
See Also:
EODistributionChannel.Delegate

establishConnection

public abstract void establishConnection()
Subclasses have to implement this method to establish a connection with the server using a specific protocol.

See Also:
responseToMessage(Object, NSCoder)

responseToMessage

public abstract Object responseToMessage(Object message,
                                         NSCoder coder)
Subclasses have to implement this method to send a message to the server and synchronously receive a response. It's the receiver's responsibility to encode the message, represented by the message object, with the help of the NSCoder coder.

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
See Also:
establishConnection()

setConnectionDictionary

public void setConnectionDictionary(NSDictionary connectionDictionary)
Sets the connection dictionary to be used to connect to the server.

Parameters:
connectionDictionary - the connection dictionary
See Also:
connectionKeys()

setDelegate

public void setDelegate(Object delegate)
Sets the receiver's delegate.

Parameters:
delegate - the receiver's delegate
See Also:
EODistributionChannel.Delegate

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.