Class RemoteWorkspaceClientFactory


  • public class RemoteWorkspaceClientFactory
    extends java.lang.Object
    A class that can setup a 2-way link to a RemoteWorkspace on the same machine.
    • Constructor Detail

      • RemoteWorkspaceClientFactory

        public RemoteWorkspaceClientFactory()
    • Method Detail

      • create

        public static RemoteWorkspace create​(java.io.File dir,
                                             RemoteWorkspaceClient client)
        Create a Remote Workspace object that communicates with a Remote Workspace server on the same machine on the loopback interface.

        This class will search in the {dir}/cnf/cache/remotews directory for registered workspaces. (Multiple can be registered.) It will try to contact these remote workspace servers in order of last modified, newest first. The first one that responds will be returned.

        Parameters:
        dir - The directory of the workspace
        client - the client API
        Returns:
        a RemoteWorkspace
      • create

        public static RemoteWorkspace create​(int port,
                                             RemoteWorkspaceClient client)
                                      throws java.io.IOException
        Create a Remote Workspace on a specific port.
        Parameters:
        port - the port to use
        client - the client API
        Returns:
        a Workspace
        Throws:
        java.io.IOException - when something goes wrong
      • getPortDirectory

        public static java.io.File getPortDirectory​(java.io.File dir,
                                                    java.io.File org)
        Get the directory where the ports are registered in
        Parameters:
        dir - the directory to start from.
        org - the original directory started from
        Returns:
        the directory (cnf/cache/remotews) in the first workspace encountered