Re: Re: Obtain process ID of DefaultExecutor process

Gary Gregory <[email protected]> Tue, 3 Mar 2026 06:29:10 -0500
Newsgroups gmane.comp.jakarta.commons.user
Message-ID <CACZkXPyP2uGHagdau+tYk5=N6DrXa0vZ3tUh5coSVSzTwxexiQ@mail.gmail.com>
I'm not sure there is a reply in there to my:

> Have you tried registering an ExecuteWatchdog with a DefaultExecutor?
> It accepts a Process that you can query.

Gary

On Mon, Mar 2, 2026 at 2:07=E2=80=AFAM Jose Nos <[email protected]> wrot=
e:
>
> On 2026/02/25 20:53:06 Gary Gregory wrote:
> > On Sat, Feb 21, 2026 at 9:12=E2=80=AFAM Tenenbaum, Peter G. (ARC-TN)[SE=
TI
> > INSTITUTE] via user <[email protected]> wrote:
> > >
> > > Hi there =E2=80=94
> > >
> > > I was looking for a way to get the process ID of a process that gets
> started by the DefaultExecutor. From looking at the javadoc, there=E2=80=
=99s no
> built-in way to do it.
> > >
> > > Google recommends that I create a subclass of DefaultExecutor that
> overrides the launch() method, such that the Process it returns is
> interrogated for the PID. DefaultExecutor isn=E2=80=99t final and launch(=
) is
> protected, so in principle this can be done.
> > >
> > > However:
> > >
> > > The only public constructor for DefaultExecutor is deprecated. The
> non-deprecated method to instantiate a DefaultExecutor is to use the
> DefaultExecutor builder, but AFAICT there=E2=80=99s no way to get this bu=
ilder to
> return a DefaultExecutor subclass. I could subclass the DefaultExecutor
> builder, but the DefaultExecutor builder uses a package-private
> DefaultExecutor constructor, so my subclass of DefaultExecutor builder
> can=E2=80=99t use that constructor.
> > >
> > > In a pinch, I could imagine giving my subclass its own constructor th=
at
> emulates the package-private one in DefaultExecutor. Unfortunately, this
> also won=E2=80=99t work: all the instance variables are private and there=
 are no
> protected setters for them.
> > >
> > > It seems like the intent is there to allow users to subclass
> DefaultExecutor, but in practice the only way to do it appears to be the
> deprecated public constructor. Am I missing something?
> > >
> > > Is there an easier way to get the PID from a DefaultExecutor?
> >
> > Hello PT,
> >
> > Have you tried registering an ExecuteWatchdog with a DefaultExecutor?
> > It accepts a Process that you can query.
> >
> > Gary
> >
> > >
> > > Thanks,
> > > -PT
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >