Package aQute.bnd.remoteworkspace.server
Class RemoteWorkspaceServer
java.lang.Object
aQute.bnd.remoteworkspace.server.RemoteWorkspaceServer
- All Implemented Interfaces:
Closeable
,AutoCloseable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Holds the implementations of theRemoteWorkspace
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final org.slf4j.Logger
(package private) final ScheduledFuture<?>
(package private) final File
(package private) final Closeable
private final long
(package private) final Workspace
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteWorkspaceServer
(Workspace workspace) Create a new Remote Workspace Server. -
Method Summary
-
Field Details
-
logger
final org.slf4j.Logger logger -
server
-
remotewsPort
-
workspace
-
registerPort
-
startingTime
private final long startingTime
-
-
Constructor Details
-
RemoteWorkspaceServer
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:
UnknownHostException
IOException
-
-
Method Details
-
register
void register() -
close
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-