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 arlut.csd.ganymede.FileReceiver |
localReceiver
|
| Fields inherited from class java.rmi.server.UnicastRemoteObject |
|
| Fields inherited from class java.rmi.server.RemoteServer |
|
| Fields inherited from class java.rmi.server.RemoteObject |
ref |
|
Constructor Summary |
FileReceiverBase(arlut.csd.ganymede.FileReceiver localReceiver)
|
|
Method Summary |
arlut.csd.ganymede.ReturnVal |
end(boolean completed)
This method is called to notify the FileReceiver that no more
of the file will be transmitted. |
arlut.csd.ganymede.ReturnVal |
sendBytes(byte[] bytes)
This method is used to send chunks of a file, in order, to the
FileReceiver. |
arlut.csd.ganymede.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, 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 |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
localReceiver
private arlut.csd.ganymede.FileReceiver localReceiver
FileReceiverBase
public FileReceiverBase(arlut.csd.ganymede.FileReceiver localReceiver)
throws java.rmi.RemoteException
sendBytes
public arlut.csd.ganymede.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
java.rmi.RemoteException
sendBytes
public arlut.csd.ganymede.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
java.rmi.RemoteException
end
public arlut.csd.ganymede.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
- Returns:
- Returns true if the FileReceiver successfully received
the file in its entirety.
java.rmi.RemoteException
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