Interface RemoteCloseable<T>

All Superinterfaces:
AutoCloseable, Closeable, Remote
All Known Implementing Classes:
RemoteCloseableImpl

public interface RemoteCloseable<T> extends Remote, Closeable
A resource that can be exposed remotely, and closed locally as well as remotely.
Author:
Christian Kohlschütter
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the resource on the server-side (i.e., where it was created), and — as long as the wrapped resource returned by get() supports it — locally as well.
    get()
    Returns the resource (or the Remote instance of it).
  • Method Details

    • get

      Returns the resource (or the Remote instance of it). If the returned resource is Closeable, then closing via get().close()} will affect the client-side (local), but not necessarily the server-side as well (the exact behavior depends on the resource).
      Returns:
      The wrapped resource.
      Throws:
      NoSuchObjectException - if this instance has been closed already.
      IOException - if there was a problem.
    • close

      void close() throws IOException
      Closes the resource on the server-side (i.e., where it was created), and — as long as the wrapped resource returned by get() supports it — locally as well.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - if there was a problem.