You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Martin Kresse (JIRA)" <ji...@apache.org> on 2012/09/28 13:01:07 UTC

[jira] [Created] (IO-345) Supply a hook method allowing Tailer actively determining stop condition

Martin Kresse created IO-345:
--------------------------------

             Summary: Supply a hook method allowing Tailer actively determining stop condition
                 Key: IO-345
                 URL: https://issues.apache.org/jira/browse/IO-345
             Project: Commons IO
          Issue Type: Improvement
            Reporter: Martin Kresse


I am using the {{Tailer}} class on the server side and would like add some timeout checking to automatically stop the tailer. With the current version, if I want to avoid the usage of another thread, I can perform this check only inside the methods of the {{TailerListener}}. If no events are generated (due to the tailed file not changing), this check would never be executed.
Therefore I suggest the addition of a protected method, something like:
{code:title=Tailer.java|borderStyle=none}
protected boolean shouldRun() {
    return this.run;
}
{code}
Instead of testing the boolean variable {{run}}, the {{Tailer}} thread would call this method.
This would allow subclassing {{Tailer}} for adding some logic, which dynamically decides whether the tailer should continue running or not. For users not needing this feature, nothing would change.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (IO-345) Supply a hook method allowing Tailer actively determining stop condition

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IO-345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory resolved IO-345.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5
    
> Supply a hook method allowing Tailer actively determining stop condition
> ------------------------------------------------------------------------
>
>                 Key: IO-345
>                 URL: https://issues.apache.org/jira/browse/IO-345
>             Project: Commons IO
>          Issue Type: Improvement
>            Reporter: Martin Kresse
>             Fix For: 2.5
>
>
> I am using the {{Tailer}} class on the server side and would like add some timeout checking to automatically stop the tailer. With the current version, if I want to avoid the usage of another thread, I can perform this check only inside the methods of the {{TailerListener}}. If no events are generated (due to the tailed file not changing), this check would never be executed.
> Therefore I suggest the addition of a protected method, something like:
> {code:title=Tailer.java|borderStyle=none}
> protected boolean shouldRun() {
>     return this.run;
> }
> {code}
> Instead of testing the boolean variable {{run}}, the {{Tailer}} thread would call this method.
> This would allow subclassing {{Tailer}} for adding some logic, which dynamically decides whether the tailer should continue running or not. For users not needing this feature, nothing would change.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (IO-345) Supply a hook method allowing Tailer actively determining stop condition

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IO-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465555#comment-13465555 ] 

Gary D. Gregory commented on IO-345:
------------------------------------

Sounds reasonable. Added:

{code:java}

/**
  * Gets whether to keep on running.
  * 
  * @return whether to keep on running.
  * @since 2.5
  */
  protected boolean getRun() {
     return run;
  }
{code}
                
> Supply a hook method allowing Tailer actively determining stop condition
> ------------------------------------------------------------------------
>
>                 Key: IO-345
>                 URL: https://issues.apache.org/jira/browse/IO-345
>             Project: Commons IO
>          Issue Type: Improvement
>            Reporter: Martin Kresse
>             Fix For: 2.5
>
>
> I am using the {{Tailer}} class on the server side and would like add some timeout checking to automatically stop the tailer. With the current version, if I want to avoid the usage of another thread, I can perform this check only inside the methods of the {{TailerListener}}. If no events are generated (due to the tailed file not changing), this check would never be executed.
> Therefore I suggest the addition of a protected method, something like:
> {code:title=Tailer.java|borderStyle=none}
> protected boolean shouldRun() {
>     return this.run;
> }
> {code}
> Instead of testing the boolean variable {{run}}, the {{Tailer}} thread would call this method.
> This would allow subclassing {{Tailer}} for adding some logic, which dynamically decides whether the tailer should continue running or not. For users not needing this feature, nothing would change.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira