Class RemoteWorkspaceServer

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class RemoteWorkspaceServer
    extends java.lang.Object
    implements java.io.Closeable
    Implements an RPC interface to a workspace. When a workspace is created then it can create a Remote Workspace Server to allow remote access.

    This server will register the ephemeral port it uses in the cnf/cache/remotews directory so that it can be found by clients. This registration is deleted when the process properly exits.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the server.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RemoteWorkspaceServer

        public RemoteWorkspaceServer​(Workspace workspace)
                              throws java.net.UnknownHostException,
                                     java.io.IOException
        Create a new Remote Workspace Server. This will create a server socket on a random port. The protocole over this socket is defined by the RemoteWorkspace interface. The port number will be registered in cnf/cache/remotews/<portnr>. That is, it is possible to have multiple workspaces open on the system workspace. (Locking between workspaces is not handled though.)
        Parameters:
        workspace - the given workspace
        Throws:
        java.net.UnknownHostException
        java.io.IOException
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Close the server. This generally happens when the corresponding workspace is closed. It will release the ephemeral port and delete the registration file.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException