Package aQute.bnd.remoteworkspace.server
Class RemoteWorkspaceServer
- java.lang.Object
-
- aQute.bnd.remoteworkspace.server.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.
-
-
Constructor Summary
Constructors Constructor Description RemoteWorkspaceServer(Workspace workspace)
Create a new Remote Workspace Server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the server.
-
-
-
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 theRemoteWorkspace
interface. The port number will be registered incnf/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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-