You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by GitBox <gi...@apache.org> on 2021/03/30 13:08:00 UTC

[GitHub] [felix-dev] pkriens opened a new pull request #48: [io] Refactor of ThreadIO

pkriens opened a new pull request #48:
URL: https://github.com/apache/felix-dev/pull/48


   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 <Pe...@aqute.biz>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] rotty3000 commented on pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
rotty3000 commented on pull request #48:
URL: https://github.com/apache/felix-dev/pull/48#issuecomment-811134781


   👍
   
   On Wed, Mar 31, 2021 at 10:53 AM Amit Kumar Mondal ***@***.***>
   wrote:
   
   > @rotty3000 <https://github.com/rotty3000> What I noticed earlier that if
   > I start a local Felix runtime in Eclipse with Gogo and simultaneously
   > connect the runtime using Telnet, all commands executed in the Telnet
   > console get captured by ThreadIO, and the execution result gets
   > dispatched to all available streams. The result gets displayed not only on
   > the Telnet console but also on the Eclipse IDE console. In my opinion, the
   > result should not have been displayed in IDE if the command is executed on
   > Telnet and vice versa. This is why, after discussing with @pkriens
   > <https://github.com/pkriens>, it has been decided that it would have
   > great to disable the use of ThreadIO on demand which @pkriens
   > <https://github.com/pkriens> accomplished in this PR by introducing the
   > SystemIO service. In my scenario, I just needed to export a custom
   > implementation of SystemIO with the framework property
   > org.apache.felix.gogo.systemio.timeout set to a proper timeout value
   > (i.e. 20000 milliseconds).
   >
   > —
   > You are receiving this because you were mentioned.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/felix-dev/pull/48#issuecomment-811130501>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AABD2TGBSXU3RAT4JSJL3H3TGMZNNANCNFSM4RG7RW3A>
   > .
   >
   
   
   -- 
   *Raymond Augé* ***@***.***)
   Senior Software Architect *Liferay, Inc.* (@Liferay)
   OSGi Fellow
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] rotty3000 commented on pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
rotty3000 commented on pull request #48:
URL: https://github.com/apache/felix-dev/pull/48#issuecomment-811115077


   To help me understand, maybe to improve the documentation, could you
   explain a use case?
   
   - Ray
   
   On Wed, Mar 31, 2021 at 9:43 AM Amit Kumar Mondal ***@***.***>
   wrote:
   
   > I just tested the branch and it works like a charm 👍. I strongly believe
   > that this is a great enhancement to Gogo runtime.
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/felix-dev/pull/48#issuecomment-811079234>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AABD2TGIFRF7JG7TVQX6BF3TGMRJZANCNFSM4RG7RW3A>
   > .
   >
   
   
   -- 
   *Raymond Augé* ***@***.***)
   Senior Software Architect *Liferay, Inc.* (@Liferay)
   OSGi Fellow
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] amitjoy commented on pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
amitjoy commented on pull request #48:
URL: https://github.com/apache/felix-dev/pull/48#issuecomment-811079234


   I just tested the branch and it works like a charm 👍. I strongly believe that this is a great enhancement to Gogo runtime.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] amitjoy commented on pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
amitjoy commented on pull request #48:
URL: https://github.com/apache/felix-dev/pull/48#issuecomment-811130501


   @rotty3000 What I noticed earlier that if I start a local Felix runtime in Eclipse with Gogo and simultaneously connect the runtime using Telnet, all commands executed in the Telnet console get captured by `ThreadIO`, and the execution result gets dispatched to all available streams. The result gets displayed not only on the Telnet console but also on the Eclipse IDE console. In my opinion, the result should not have been displayed in IDE if the command is executed on Telnet and vice versa. This is why, after discussing with @pkriens, it has been decided that it would have been great to disable the use of `ThreadIO` on demand which @pkriens accomplished in this PR by introducing the `SystemIO` service. In my scenario, I just needed to export a custom implementation of `SystemIO` with the framework property `org.apache.felix.gogo.systemio.timeout` set to a proper timeout value (i.e. 20000 milliseconds).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] amitjoy edited a comment on pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
amitjoy edited a comment on pull request #48:
URL: https://github.com/apache/felix-dev/pull/48#issuecomment-811130501


   @rotty3000 What I noticed earlier that if I start a local Felix runtime in Eclipse with Gogo and simultaneously connect the runtime using Telnet, all commands executed in the Telnet console get captured by `ThreadIO`, and the execution result gets dispatched to all available streams. The result gets displayed not only on the Telnet console but also on the Eclipse IDE console. In my opinion, the result should not have been displayed in IDE if the command is executed on Telnet and vice versa. This is why, after discussing with @pkriens, it has been decided that it would have been great to disable the use of `ThreadIO` on demand which @pkriens accomplished in this PR by introducing the `SystemIO` service. In my scenario, I just needed to export a custom implementation of `SystemIO` with the framework property `org.apache.felix.gogo.systemio.timeout` set to a proper timeout value (i.e. 20000 milliseconds).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [felix-dev] pkriens closed pull request #48: [io] Refactor of ThreadIO

Posted by GitBox <gi...@apache.org>.
pkriens closed pull request #48:
URL: https://github.com/apache/felix-dev/pull/48


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org