daml/libs-scala
Leonid Shlyapnikov 29e1931f17
Add --port-file command line option to JSON API (#5454)
* Adding `--port-file` support

* ``--port-file`` support

* Updating docs

changelog_begin

[JSON API] Add support for ``--port-file`` command line option.
``--http-port 0 --port-file ./json-api.port`` will pick up a free port
and write it into ``./json-api.port` file.

changelog_end

* reformatting

* Usage grammar

* use bimap

* Adding `PortFiles` utility for creating and deleting port files on JVM exit

* Adding scaladoc explaining that the port file should be deleted on

JVM termination.

* Updating usage and docs to reflect that the file must be unique and

will be deleted on graceful shutdown

* Relying on `java.nio.file.FileAlreadyExistsException` to determine the

case when failed due to the nonunique file name.

* toString instead of Exception.getMessage

java.nio exception's getMessage can be just a file name, need the class
name to capture the error context.

* updatePortFile -> createPortFile

* write to file instead of write into file
2020-04-08 18:48:11 +00:00
..
auth-utils Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
build-info Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
contextualized-logging Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
direct-execution-context Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
grpc-utils Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
ports Add --port-file command line option to JSON API (#5454) 2020-04-08 18:48:11 +00:00
postgresql-testing Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
resources Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
resources-akka Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00
timer-utils Use com.daml as root package (#5343) 2020-04-05 19:49:57 +02:00