Interface ServerStream
- All Superinterfaces:
AutoCloseable,Closeable,de.aristaflow.adept2.model.communication.ServerSideProxy,de.aristaflow.adept2.model.communication.TimeTrackingSsProxy
- All Known Implementing Classes:
ServerInputStream,ServerUDTInputStream
This behaviour is achieved by using the normal proxy/callback mechanisms of
the communication framework, that is, when requesting a
ServerStream a proxy is created at the client and this connects
to the originating stream on the server. The connection remains open until
closing the stream or shutting down the communication.
When transferring a ServerStream as parameter to the server, the
client will export it, transfer the URI and the server will create a proxy
for the URI/the stream. Note that if the client terminates before the server
closes the stream, the server will not be able to access the stream any
longer since the stream is disconnected. To prevent this behaviour and memory
leaks, the server has to close() the stream eventually.
Unlike a normal input stream, a disconnected ServerStream throws
ServiceConnectionExceptions for every called method instead of
the usual IOException.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.aristaflow.adept2.model.communication.ServerSideProxy
de.aristaflow.adept2.model.communication.ServerSideProxy.LegacySspCloser, de.aristaflow.adept2.model.communication.ServerSideProxy.ServerSideProxyRemover -
Field Summary
Fields inherited from interface de.aristaflow.adept2.model.communication.ServerSideProxy
DEFAULT_ALIVE_TIMEFields inherited from interface de.aristaflow.adept2.model.communication.TimeTrackingSsProxy
DEFAULT_CLOSE_DEFER_TIME, MAX_ALIVE_TIME_EXTENSION -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()InputStream.close()This additionally removes the skeleton in the communication framework.voidmark(int readlimit) booleanintread()byte[]read(int len) ResemblesInputStream.read(byte[])by reading the designated amount of bytes from the stream.voidreset()longskip(long n) Methods inherited from interface de.aristaflow.adept2.model.communication.TimeTrackingSsProxy
enter, exit, getCloseTime, getRemainingAliveTime, isBusy, keepAlive, setCloseTime
-
Method Details
-
read
- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
read
ResemblesInputStream.read(byte[])by reading the designated amount of bytes from the stream. If there are less bytes remaining in the stream, the returned byte array will be correspondingly shorter. If no bytes remain (java.io.InputStream#read(byte[])returns -1),nullwill be returned.- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
skip
- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
available
- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
close
InputStream.close()This additionally removes the skeleton in the communication framework.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacede.aristaflow.adept2.model.communication.ServerSideProxy- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
mark
void mark(int readlimit) - Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.
-
reset
- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.IOException
-
markSupported
boolean markSupported()- Throws:
de.aristaflow.adept2.model.communication.ServiceConnectionException- If the underlying stream cannot be reached any more through the communication framework, aServiceConnectionExceptionwill be thrown.
-