void (JavaParameters javaParameters) { try { myTargetBoundServerSocket = TargetBoundServerSocket.fromRequest(getTargetEnvironmentRequest()); int localPort = myTargetBoundServerSocket.getLocalPort(); AsyncPromise<String> hostPortPromise = myTargetBoundServerSocket.getHostPortPromise(); javaParameters.getProgramParametersList() .add(new CompositeParameterTargetedValue("-socket").addTargetPart(String.valueOf(localPort), hostPortPromise)); } catch (IOException e) { LOG.error(e); } }