uk.ac.rdg.resc.jstyx.client.callbacks
Class ReadCallback

java.lang.Object
  extended by uk.ac.rdg.resc.jstyx.client.MessageCallback
      extended by uk.ac.rdg.resc.jstyx.client.callbacks.ReadCallback

public class ReadCallback
extends MessageCallback

Callback used when reading from a file (see CStyxFile.readAsync())

Author:
jdb $Revision: 523 $ $Date: 2005-12-07 08:51:14 +0000 (Wed, 07 Dec 2005) $ $Log$ Revision 1.2 2005/12/07 08:51:14 jonblower Added option to readAsync() to open file for reading and writing with truncation Revision 1.1 2005/08/05 13:46:40 jonblower Factored out all callback objects from CStyxFile into separate classes

Constructor Summary
ReadCallback(CStyxFile file, long offset, int bytesRequired, boolean openForWriting, MessageCallback callback)
           
 
Method Summary
 void error(java.lang.String message, StyxMessage tMessage)
          Called when an error occurs (this may occur if the server returned an Rerror message, or if the reply was not of the expected type, or for other reasons).
 void nextStage()
           
 void replyArrived(StyxMessage rMessage, StyxMessage tMessage)
          Called when the reply arrives.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadCallback

public ReadCallback(CStyxFile file,
                    long offset,
                    int bytesRequired,
                    boolean openForWriting,
                    MessageCallback callback)
Method Detail

nextStage

public void nextStage()

replyArrived

public void replyArrived(StyxMessage rMessage,
                         StyxMessage tMessage)
Description copied from class: MessageCallback
Called when the reply arrives. If the reply is an RreadMessage, the message's buffer should be released when it is no longer needed, using rMessage.getData().release().

Specified by:
replyArrived in class MessageCallback
Parameters:
rMessage - the reply
tMessage - the original T-message

error

public void error(java.lang.String message,
                  StyxMessage tMessage)
Description copied from class: MessageCallback
Called when an error occurs (this may occur if the server returned an Rerror message, or if the reply was not of the expected type, or for other reasons).

Specified by:
error in class MessageCallback
Parameters:
message - The error string
tMessage - The T-message that caused this error to happen


Copyright © 2004-2006 Reading e-Science Centre. All Rights Reserved.