WebObjects 5.2

com.webobjects.eodistribution.client
Interface EODistributionChannel.Delegate

Enclosing class:
EODistributionChannel

public static interface EODistributionChannel.Delegate

This interface defines the methods that can be implemented by the delegate of EODistributionChannels -- mostly to handle exceptions. The delegate does not have to actually implement the interface and all methods of it; it is sufficient to implement just the methods needed, but by implementing the interface, the compiler helps to find problems with wrong method signatures.


Method Summary
 IOException distributionChannelShouldThrowIOException(EODistributionChannel channel, IOException ioException)
          Gives the delegate an opportunity to handle an I/O exception which occured while communicating with the server.
 Throwable distributionChannelShouldThrowServerException(EODistributionChannel channel, Throwable clientExceptionForServerException, String originalServerExceptionClassName, String originalServerExceptionMessage)
          Gives the delegate an opportunity to handle an exception that occured on the server side.
 InputStream distributionChannelWillReadFromStream(EODistributionChannel channel, InputStream stream)
          Gives the delegate an opportunity to decrypt data received from the server.
 OutputStream distributionChannelWillWriteToStream(EODistributionChannel channel, OutputStream stream)
          Gives the delegate an opportunity to encrypt data sent to the server.
 

Method Detail

distributionChannelShouldThrowIOException

public IOException distributionChannelShouldThrowIOException(EODistributionChannel channel,
                                                             IOException ioException)
Gives the delegate an opportunity to handle an I/O exception which occured while communicating with the server. The delegate can try to handle the exception and return a new one or null if it is able to deal with the exception completely. If the delegate does not want to handle the exception, it should return the exception passed as the ioException argument (which is the exception the client throws if the delegate does not implement this method or the method is not set).
Parameters:
channel - the distribution channel
ioException - the I/O exception
Returns:
the (potentially) modified IOException to be thrown or null if no exception should be thrown
See Also:
distributionChannelShouldThrowServerException(EODistributionChannel, Throwable, String, String)

distributionChannelShouldThrowServerException

public Throwable distributionChannelShouldThrowServerException(EODistributionChannel channel,
                                                               Throwable clientExceptionForServerException,
                                                               String originalServerExceptionClassName,
                                                               String originalServerExceptionMessage)
Gives the delegate an opportunity to handle an exception that occured on the server side. The delegate can try to handle the exception and return a new one or null if it is able to deal with the exception completely. If the delegate does not want to handle the exception, it should return the exception passed as the clientExceptionForServerException argument (which is the exception the client throws if the delegate does not implement this method or the method is not set).
Parameters:
channel - the distribution channel
clientExceptionForServerException - the proposed client exception
originalServerExceptionClassName - the class name of the exception which occured on the server side
originalServerExceptionMessage - the message of the exception which occured on the server side
Returns:
the (potentially) modified exception to be thrown on the client or null if no exception should be thrown
See Also:
distributionChannelShouldThrowIOException(EODistributionChannel, IOException)

distributionChannelWillReadFromStream

public InputStream distributionChannelWillReadFromStream(EODistributionChannel channel,
                                                         InputStream stream)
Gives the delegate an opportunity to decrypt data received from the server. Note that the server side has to encrypt the data with the help of the distribution context delegate.
Parameters:
channel - the distribution channel
stream - the stream data is received through
Returns:
a stream from which the decrypted data can be read

distributionChannelWillWriteToStream

public OutputStream distributionChannelWillWriteToStream(EODistributionChannel channel,
                                                         OutputStream stream)
Gives the delegate an opportunity to encrypt data sent to the server. Note that the server side has to decrypt the data with the help of the distribution context delegate.
Parameters:
channel - the distribution channel
stream - the stream data is sent through
Returns:
a stream which puts out the encrypted data

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

Copyright © 2003 Apple Computer, Inc.