uk.ac.rdg.resc.jstyx.gridservice.server
Class ExitCodeFile

java.lang.Object
  extended by uk.ac.rdg.resc.jstyx.server.StyxFile
      extended by uk.ac.rdg.resc.jstyx.gridservice.server.ExitCodeFile

public class ExitCodeFile
extends StyxFile

File that is read in order to get the exit code from the service instance. If the exit code has not yet been set, read requests will be queued and replied to when the exit code is set.

Author:
Jon Blower $Revision: 510 $ $Date: 2005-12-01 08:26:45 +0000 (Thu, 01 Dec 2005) $ $Log$ Revision 1.2 2005/12/01 08:26:45 jonblower Fixed javadoc comment Revision 1.1 2005/11/14 21:31:54 jonblower Got SGSRun working for SC2005 demo

Field Summary
 
Fields inherited from class uk.ac.rdg.resc.jstyx.server.StyxFile
auth, directory, lastModifiedTime, name, parent
 
Constructor Summary
ExitCodeFile()
          Creates a new instance of ExitCodeFile
 
Method Summary
 void read(StyxFileClient client, long offset, int count, int tag)
          Reads data from this file.
 void setExitCode(int exitCode)
          Sets the exit code.
 
Methods inherited from class uk.ac.rdg.resc.jstyx.server.StyxFile
addChangeListener, addClient, checkSetLastModifiedTime, checkSetLength, checkSetMode, checkSetName, clientConnected, clientDisconnected, contentsChanged, delete, fireContentsChanged, getClient, getDirEntry, getFullPath, getGroup, getLength, getName, getNumClients, getOwner, getParent, getPermissions, getQid, getVersion, incrementVersion, isAppendOnly, isAuth, isDirectory, isExclusive, processAndReplyRead, processAndReplyRead, processAndReplyRead, refresh, remove, removeChangeListener, removeClient, rename, replyRead, replyRead, replyRead, replyRead, replyRead, replyWrite, setLastAccessTime, setLastModified, setLength, setMode, setName, setPermissions, setReadOnly, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExitCodeFile

public ExitCodeFile()
             throws StyxException
Creates a new instance of ExitCodeFile

Throws:
StyxException
Method Detail

read

public void read(StyxFileClient client,
                 long offset,
                 int count,
                 int tag)
          throws StyxException
Description copied from class: StyxFile
Reads data from this file. This method could be synchronized in subclasses, but watch out for blocks if the read is expected to take some time to complete. Subclasses must make sure they reply to the read request by creating a java.nio.ByteBuffer or byte array of data, then calling the appropriate readReply() (this can be done at any time; it does not have to be done within the read() method). This default implementation simply throws a StyxException, which will result in an Rerror message being sent back to the client. Subclasses should override this to provide the desired behaviour when the file is read.

Overrides:
read in class StyxFile
Parameters:
client - The client that is performing the read
offset - The point in the file at which to start reading
count - The maximum number of bytes to read
tag - The tag of the incoming Tread message (this is needed when calling readReply())
Throws:
StyxException

setExitCode

public void setExitCode(int exitCode)
Sets the exit code. When this is called, all waiting clients will be notified of the new exit code.



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