public class RemoteWorkspaceClientFactory
extends java.lang.Object
RemoteWorkspace
on the same
machine.Modifier and Type | Field and Description |
---|---|
(package private) static java.util.concurrent.ExecutorService |
executorService |
(package private) static org.slf4j.Logger |
logger |
Constructor and Description |
---|
RemoteWorkspaceClientFactory() |
Modifier and Type | Method and Description |
---|---|
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.
|
static RemoteWorkspace |
create(int port,
RemoteWorkspaceClient client)
Create a Remote Workspace on a specific port.
|
private static RemoteWorkspace |
findRemoteWorkspace(java.io.File dir,
FunctionWithException<java.lang.Integer,RemoteWorkspace> attach) |
static java.io.File |
getPortDirectory(java.io.File dir,
java.io.File org)
Get the directory where the ports are registered in
|
static final org.slf4j.Logger logger
static final java.util.concurrent.ExecutorService executorService
public static RemoteWorkspace create(java.io.File dir, RemoteWorkspaceClient client)
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.
dir
- The directory of the workspaceclient
- the client APIpublic static RemoteWorkspace create(int port, RemoteWorkspaceClient client) throws java.io.IOException
port
- the port to useclient
- the client APIjava.io.IOException
- when something goes wrongprivate static RemoteWorkspace findRemoteWorkspace(java.io.File dir, FunctionWithException<java.lang.Integer,RemoteWorkspace> attach)
public static java.io.File getPortDirectory(java.io.File dir, java.io.File org)
dir
- the directory to start from.org
- the original directory started from