arlut.csd.ganymede.client
Class FileReceiverBase

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--arlut.csd.ganymede.client.FileReceiverBase
All Implemented Interfaces:
FileReceiver, java.rmi.Remote, java.io.Serializable, java.rmi.server.Unreferenced

public class FileReceiverBase
extends java.rmi.server.UnicastRemoteObject
implements FileReceiver, java.rmi.server.Unreferenced

Standard remotely accessible FileReceiver object for use in Ganymede clients. By using a single class that implements the FileReceiver interface, we only need to have a single stub in the server's jar file.

See Also:
Serialized Form

Field Summary
private  FileReceiver localReceiver
           
 
Fields inherited from class java.rmi.server.UnicastRemoteObject
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf
 
Fields inherited from class java.rmi.server.RemoteServer
log, logname
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
FileReceiverBase(FileReceiver localReceiver)
           
 
Method Summary
 ReturnVal end(boolean completed)
          This method is called to notify the FileReceiver that no more of the file will be transmitted.
 ReturnVal sendBytes(byte[] bytes)
          This method is used to send chunks of a file, in order, to the FileReceiver.
 ReturnVal sendBytes(byte[] bytes, int offset, int len)
          This method is used to send chunks of a file, in order, to the FileReceiver.
 void unreferenced()
          This method implements the Unreferenced interface.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
, clone, exportObject, exportObject, exportObject, exportObject, readObject, reexport, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub, writeObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

localReceiver

private FileReceiver localReceiver
Constructor Detail

FileReceiverBase

public FileReceiverBase(FileReceiver localReceiver)
                 throws java.rmi.RemoteException
Method Detail

sendBytes

public ReturnVal sendBytes(byte[] bytes)
                    throws java.rmi.RemoteException

This method is used to send chunks of a file, in order, to the FileReceiver. The FileReceiver can return a non-successful ReturnVal if it doesn't want to stop receiving the file. A null return value indicates success, keep sending.

Specified by:
sendBytes in interface FileReceiver

sendBytes

public ReturnVal sendBytes(byte[] bytes,
                           int offset,
                           int len)
                    throws java.rmi.RemoteException

This method is used to send chunks of a file, in order, to the FileReceiver. The FileReceiver can return a non-successful ReturnVal if it doesn't want to stop receiving the file. A null return value indicates success, keep sending.

Specified by:
sendBytes in interface FileReceiver

end

public ReturnVal end(boolean completed)
              throws java.rmi.RemoteException

This method is called to notify the FileReceiver that no more of the file will be transmitted. The boolean parameter will be true if the file was completely sent, or false if the transmission is being aborted by the sender for some reason.

Specified by:
end in interface FileReceiver
Following copied from interface: arlut.csd.ganymede.FileReceiver
Returns:
Returns true if the FileReceiver successfully received the file in its entirety.

unreferenced

public void unreferenced()

This method implements the Unreferenced interface. The RMI system on the client will call this method if the server drops the reference to the FileReceiverBase. This will allow the client to realize that the file transmission has timed out if the server dies.

Specified by:
unreferenced in interface java.rmi.server.Unreferenced