Class ServerInputStream

  • All Implemented Interfaces:
    ServerStream, de.aristaflow.adept2.model.communication.ServerSideProxy, de.aristaflow.adept2.model.communication.TimeTrackingSsProxy, Closeable, AutoCloseable
    Direct Known Subclasses:
    ServerUDTInputStream

    public class ServerInputStream
    extends Object
    implements ServerStream
    This is a simple wrapper for an InputStream as ServerStream which allows for keeping an InputStream locally and use it remotely.
    • Field Detail

      • aliveTimeExtension

        protected final long aliveTimeExtension
        The time in milliseconds the alive time is extended when accessing this stream.
      • busyThreads

        protected final Map<Thread,​AtomicInteger> busyThreads
        The threads which are currently accessing this server-side proxy (and and how often). This is used to avoid closing a currently active server-side proxy.
      • cleanup

        protected final Cleanup<IOException> cleanup
        The clean-up for closing the wrapped input stream as post-mortem action of this ServerInputStream.
    • Constructor Detail

      • ServerInputStream

        @Deprecated(since="15.0.0",
                    forRemoval=true)
        public ServerInputStream​(InputStream in)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a new ServerInputStream providing the content of the designated stream incrementally on client side. Note that this stream as well as the wrapped InputStream will be closed by the remote site. Therefore you should only close this stream (or the wrapped InputStream) if you are sure that the remote side has not closed it and will not close it, for instance since it disconnected abruptly.
        Parameters:
        in - The stream of which the content will be provided incrementally on client side. This stream will be closed by the remote side.
      • ServerInputStream

        public ServerInputStream​(InputStream in,
                                 long initialAliveTime,
                                 long aliveTimeExtension)
        Creates a new ServerInputStream providing the content of the designated stream incrementally on client side. Note that this stream as well as the wrapped InputStream will be closed by the remote site. Therefore you should only close this stream (or the wrapped InputStream) if you are sure that the remote side has not closed it and will not close it, for instance since it disconnected abruptly.
        Parameters:
        in - The stream of which the content will be provided incrementally on client side. This stream will be closed by the remote side.
        initialAliveTime - The initial time in milliseconds this server stream remains open before automatically being closed.
        aliveTimeExtension - The time in milliseconds to extend the alive time when accessing this server stream.