[exec] how to use watchdog / wrong javadoc

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[exec] how to use watchdog / wrong javadoc

Leonardo K
Hi

https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html

says

 ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
 Executer exec = new Executer(myloghandler, watchdog);
 exec.setCommandLine(mycmdline);
 int exitvalue = exec.execute();
 if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
     // it was killed on purpose by the watchdog
 }

but

"Executer" does not exist

"Executor" does exist but it is an interface

DefaultExecutor implements Executor but does not set a watchdog in the
constructor




[]

Leo
Reply | Threaded
Open this post in threaded view
|

Re: [exec] how to use watchdog / wrong javadoc

Woonsan Ko-3
The javadoc seems to have outdated info. It should have been like the following:

  ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
  Executor exec = new DefaultExecutor();
  exec.setStreamHandler(myStreamHandler);
  exec.setWatchdog(watchdog);
  int exitvalue = exec.execute(mycmdline);
  if (DefaultExecutor.isFailure(exitvalue) && watchdog.killedProcess()) {
    // it was killed on purpose by the watchdog
  }

Regards,

Woonsan


On Tue, Apr 26, 2016 at 8:32 AM, Leonardo K. Shikida <[hidden email]> wrote:

> Hi
>
> https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html
>
> says
>
>  ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
>  Executer exec = new Executer(myloghandler, watchdog);
>  exec.setCommandLine(mycmdline);
>  int exitvalue = exec.execute();
>  if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
>      // it was killed on purpose by the watchdog
>  }
>
> but
>
> "Executer" does not exist
>
> "Executor" does exist but it is an interface
>
> DefaultExecutor implements Executor but does not set a watchdog in the
> constructor
>
>
>
>
> []
>
> Leo

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [exec] how to use watchdog / wrong javadoc

garydgregory
Woonsan,

Would you mind updating the Javadoc?

Thank you,
Gary
On Apr 26, 2016 1:32 PM, "Woonsan Ko" <[hidden email]> wrote:

> The javadoc seems to have outdated info. It should have been like the
> following:
>
>   ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
>   Executor exec = new DefaultExecutor();
>   exec.setStreamHandler(myStreamHandler);
>   exec.setWatchdog(watchdog);
>   int exitvalue = exec.execute(mycmdline);
>   if (DefaultExecutor.isFailure(exitvalue) && watchdog.killedProcess()) {
>     // it was killed on purpose by the watchdog
>   }
>
> Regards,
>
> Woonsan
>
>
> On Tue, Apr 26, 2016 at 8:32 AM, Leonardo K. Shikida <[hidden email]>
> wrote:
> > Hi
> >
> >
> https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html
> >
> > says
> >
> >  ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
> >  Executer exec = new Executer(myloghandler, watchdog);
> >  exec.setCommandLine(mycmdline);
> >  int exitvalue = exec.execute();
> >  if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
> >      // it was killed on purpose by the watchdog
> >  }
> >
> > but
> >
> > "Executer" does not exist
> >
> > "Executor" does exist but it is an interface
> >
> > DefaultExecutor implements Executor but does not set a watchdog in the
> > constructor
> >
> >
> >
> >
> > []
> >
> > Leo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [exec] how to use watchdog / wrong javadoc

Woonsan Ko-3
Hi Gary,

I've just fixed the javadoc:
- http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java?r1=1741116&r2=1741115&pathrev=1741116

Thanks for the suggestion! :-)

Woonsan


On Tue, Apr 26, 2016 at 5:23 PM, Gary Gregory <[hidden email]> wrote:

> Woonsan,
>
> Would you mind updating the Javadoc?
>
> Thank you,
> Gary
> On Apr 26, 2016 1:32 PM, "Woonsan Ko" <[hidden email]> wrote:
>
>> The javadoc seems to have outdated info. It should have been like the
>> following:
>>
>>   ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
>>   Executor exec = new DefaultExecutor();
>>   exec.setStreamHandler(myStreamHandler);
>>   exec.setWatchdog(watchdog);
>>   int exitvalue = exec.execute(mycmdline);
>>   if (DefaultExecutor.isFailure(exitvalue) && watchdog.killedProcess()) {
>>     // it was killed on purpose by the watchdog
>>   }
>>
>> Regards,
>>
>> Woonsan
>>
>>
>> On Tue, Apr 26, 2016 at 8:32 AM, Leonardo K. Shikida <[hidden email]>
>> wrote:
>> > Hi
>> >
>> >
>> https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html
>> >
>> > says
>> >
>> >  ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
>> >  Executer exec = new Executer(myloghandler, watchdog);
>> >  exec.setCommandLine(mycmdline);
>> >  int exitvalue = exec.execute();
>> >  if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
>> >      // it was killed on purpose by the watchdog
>> >  }
>> >
>> > but
>> >
>> > "Executer" does not exist
>> >
>> > "Executor" does exist but it is an interface
>> >
>> > DefaultExecutor implements Executor but does not set a watchdog in the
>> > constructor
>> >
>> >
>> >
>> >
>> > []
>> >
>> > Leo
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [exec] how to use watchdog / wrong javadoc

garydgregory
Thank you for doing it! :-)

Gary
On Apr 26, 2016 4:09 PM, "Woonsan Ko" <[hidden email]> wrote:

> Hi Gary,
>
> I've just fixed the javadoc:
> -
> http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/main/java/org/apache/commons/exec/ExecuteWatchdog.java?r1=1741116&r2=1741115&pathrev=1741116
>
> Thanks for the suggestion! :-)
>
> Woonsan
>
>
> On Tue, Apr 26, 2016 at 5:23 PM, Gary Gregory <[hidden email]>
> wrote:
> > Woonsan,
> >
> > Would you mind updating the Javadoc?
> >
> > Thank you,
> > Gary
> > On Apr 26, 2016 1:32 PM, "Woonsan Ko" <[hidden email]> wrote:
> >
> >> The javadoc seems to have outdated info. It should have been like the
> >> following:
> >>
> >>   ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
> >>   Executor exec = new DefaultExecutor();
> >>   exec.setStreamHandler(myStreamHandler);
> >>   exec.setWatchdog(watchdog);
> >>   int exitvalue = exec.execute(mycmdline);
> >>   if (DefaultExecutor.isFailure(exitvalue) && watchdog.killedProcess())
> {
> >>     // it was killed on purpose by the watchdog
> >>   }
> >>
> >> Regards,
> >>
> >> Woonsan
> >>
> >>
> >> On Tue, Apr 26, 2016 at 8:32 AM, Leonardo K. Shikida <[hidden email]
> >
> >> wrote:
> >> > Hi
> >> >
> >> >
> >>
> https://commons.apache.org/proper/commons-exec/apidocs/org/apache/commons/exec/ExecuteWatchdog.html
> >> >
> >> > says
> >> >
> >> >  ExecuteWatchdog watchdog = new ExecuteWatchdog(30000);
> >> >  Executer exec = new Executer(myloghandler, watchdog);
> >> >  exec.setCommandLine(mycmdline);
> >> >  int exitvalue = exec.execute();
> >> >  if (Execute.isFailure(exitvalue) && watchdog.killedProcess()) {
> >> >      // it was killed on purpose by the watchdog
> >> >  }
> >> >
> >> > but
> >> >
> >> > "Executer" does not exist
> >> >
> >> > "Executor" does exist but it is an interface
> >> >
> >> > DefaultExecutor implements Executor but does not set a watchdog in the
> >> > constructor
> >> >
> >> >
> >> >
> >> >
> >> > []
> >> >
> >> > Leo
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>