Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The ThreadIO service replaces the System streams so that the output and input on a thread associated with a command can be captured. Unfortunately, this occupies the singletons of System.in/out/err. There are many others that want to use the same mechanism. This change introduces a SystemIO service that dispatches the System streams to any number of listeners. The ThreadIO is modified to use this service. By default, the Gogo runtime will register its own SystemIO service. However, it is possible to disable this with the "org.apache.felix.gogo.systemio.timeout" (SystemIO.TIMEOUT) framework property. If this is set to a numeric value, it will indicate that Gogo should look for an external service. The numeric value indicates the amount of time Gogo should wait for this service. 30000 is a common value. Additionally, there is an onClose method added to the session so that it is possible to get a callback when the session closes. Gogo commands can use this to cancel any activity related to a session. The lambda is weakly referenced so it is necessary that the command keeps a strong reference to the callback. Signed-off-by: Peter Kriens <[email protected]>
- Loading branch information