|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.healthmarketscience.rmiio.RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream> com.healthmarketscience.rmiio.RemoteOutputStreamServer
public abstract class RemoteOutputStreamServer
Server implementation base class for a RemoteOutputStream. Handles the retry logic (the sequence ids) and the RemoteStreamMonitor updates for the server. Subclasses must implement the actual data handling methods.
RemoteStreamServer.writeReplace()
,
Serialized FormField Summary | |
---|---|
protected OutputStream |
_out
the real output stream to which we are writing data |
static RemoteStreamMonitor<RemoteOutputStreamServer> |
DUMMY_MONITOR
Default monitor for operations done by RemoteOutputStreamServer which does nothing. |
Fields inherited from class com.healthmarketscience.rmiio.RemoteStreamServer |
---|
_monitor, INITIAL_INVALID_SEQUENCE_ID, INITIAL_VALID_SEQUENCE_ID, LOG |
Constructor Summary | |
---|---|
RemoteOutputStreamServer(OutputStream out)
|
|
RemoteOutputStreamServer(OutputStream out,
RemoteStreamMonitor<RemoteOutputStreamServer> monitor)
|
Method Summary | |
---|---|
void |
close(boolean writeSuccess)
Closes the output stream and releases the resources for this server object. |
protected void |
closeImpl(boolean writeSuccess)
Closes (possibly flushes) the underlying streams and cleans up any resources. |
void |
flush()
Flushes the output stream and forces as much as possible of any buffered bytes to be written out. |
protected abstract void |
flushImpl()
Flushes the underlying stream. |
protected RemoteOutputStreamServer |
getAsSub()
Returns a handle to this object as a subclass instance. |
protected Object |
getLock()
Returns a handle to the object used to lock the underlying stream operations for this remote stream. |
OutputStream |
getOutputStream()
Returns the real OutputStream to which this stream is writing data |
Class<RemoteOutputStream> |
getRemoteClass()
|
protected abstract void |
writePacket(byte[] packet)
Writes the given packet to the underlying stream. |
void |
writePacket(byte[] packet,
int packetId)
Writes the next chunk of data to this stream. |
Methods inherited from class com.healthmarketscience.rmiio.RemoteStreamServer |
---|
abort, checkAborted, close, export, exported, finish, isClosed, unreferenced, writeReplace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.healthmarketscience.rmiio.RemoteOutputStream |
---|
usingGZIPCompression |
Field Detail |
---|
public static final RemoteStreamMonitor<RemoteOutputStreamServer> DUMMY_MONITOR
protected final transient OutputStream _out
Constructor Detail |
---|
public RemoteOutputStreamServer(OutputStream out)
public RemoteOutputStreamServer(OutputStream out, RemoteStreamMonitor<RemoteOutputStreamServer> monitor)
out
- the real output stream from which the data will be readmonitor
- monitor for tracking the progress of the stream usageMethod Detail |
---|
public OutputStream getOutputStream()
protected final Object getLock()
RemoteStreamServer
getLock
in class RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream>
protected RemoteOutputStreamServer getAsSub()
RemoteStreamServer
getAsSub
in class RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream>
public Class<RemoteOutputStream> getRemoteClass()
getRemoteClass
in class RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream>
protected void closeImpl(boolean writeSuccess) throws IOException
RemoteStreamServer
closeImpl
in class RemoteStreamServer<RemoteOutputStreamServer,RemoteOutputStream>
writeSuccess
- true
iff all data was successfully
transferred, false
otherwise
IOException
public final void close(boolean writeSuccess) throws IOException
RemoteOutputStream
close
in interface RemoteOutputStream
writeSuccess
- true
iff all data was sent successfully
from the client, false
otherwise
IOException
public final void flush() throws IOException
RemoteOutputStream
flush
in interface RemoteOutputStream
flush
in interface Flushable
IOException
public final void writePacket(byte[] packet, int packetId) throws IOException
RemoteOutputStream
writePacket
in interface RemoteOutputStream
packet
- iff the packetId was the same one from the last read call,
this chunk of data is ignored. Otherwise, writes this new
chunk of data to the stream.packetId
- client specified id for this packet
IOException
protected abstract void flushImpl() throws IOException
IOException
protected abstract void writePacket(byte[] packet) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |