Interface ServerStream
-
- All Superinterfaces:
AutoCloseable,Closeable,de.aristaflow.adept2.model.communication.ServerSideProxy,de.aristaflow.adept2.model.communication.TimeTrackingSsProxy
- All Known Implementing Classes:
ServerInputStream,ServerUDTInputStream
public interface ServerStream extends de.aristaflow.adept2.model.communication.TimeTrackingSsProxyA server stream establishes a connection between a client and a server and allows the client to access the stream via the AristaFlow-communication framework. Therefore the content of an input stream does not need to be transferred completely from server to client but will be transferred as requested.This behaviour is achieved by using the normal proxy/callback mechanisms of the communication framework, that is, when requesting a
ServerStreama proxy is created at the client and this connects to the originating stream on the server. The connection remains open untilclosing the streamor shutting down the communication.
When transferring aServerStreamas 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 toclose()the stream eventually.
Unlike a normal input stream, a disconnectedServerStreamthrowsServiceConnectionExceptions for every called method instead of the usualIOException.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intavailable()voidclose()InputStream.close()This additionally removes the skeleton in the communication framework.voidmark(int readlimit)booleanmarkSupported()intread()byte[]read(int len)ResemblesInputStream.read(byte[])by reading the designated amount of bytes from the stream.voidreset()longskip(long n)
-
-
-
Method Detail
-
read
int read() throws IOException
- 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
byte[] read(int len) throws IOExceptionResemblesInputStream.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
long skip(long n) throws IOException
- 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
int available() throws IOException- 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
void close() throws IOExceptionInputStream.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
void reset() throws IOException- 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.
-
-