|
From: Dave M. <mui...@ya...> - 2010-09-21 22:20:35
|
Hi Leif-
Thanks for the info. Actually, I wasn't so much interested in the Wrapper itself
being an mbean or using the JMX facilities within Java Service Wrapper. Rather,
I was trying to figure out if there is some way to configure JSW (or my
"wrapper.java.mainclass") so that some custom Java code (that I supply) can
decide when/whether to actually continue with the re/start up process - as
opposed to "wrapper.restart.delay" being the deciding factor as to when/how soon
a failed JVM is restarted.
After some experimentation, I think the answer is the WrapperListener
integration style. I wanted to defer re-start of a failed JVM until the value of
an mbean (available from a remote mbean server in the environment) took on a
particular value. I wrote a WrapperListener implementation whose start method
does the following in a loop (until the mbean attribute takes on the required
value): check the mbean attribute, call WrapperManager.signalStarting, call
Thread.sleep. That seems to work fine and meets the need.
Thanks for responding to my question.
Best regards,
Dave
Message: 5
Date: Wed, 22 Sep 2010 02:02:35 +0900
From: Leif Mortenson <lei...@ta...>
Subject: Re: [Wrapper-user] Alternative to time as restart delay
criteria?
To: wra...@li...
Message-ID:
<AAN...@ma...>
Content-Type: text/plain; charset=ISO-8859-1
Dave,
Currently, the Wrapper itself does not publish itself as a JMX bean.
You are talking about delaying the launch of a JVM so any JMX access
there would not be available as the JVM would be down.
In addition to the fixed delay, we added a new "Paused" state to the
JVM starting in version 3.5.0. You will need to first enable pausing:
http://wrapper.tanukisoftware.com/doc/english/prop-pausable.html
You can use the Wrapper's command file to send PAUSE or RESUME
commands to the Wrapper as it is running:
http://wrapper.tanukisoftware.com/doc/english/prop-commandfile.html
You can use the on exit properties to tell the Wrapper to pause when a JVM exits
http://wrapper.tanukisoftware.com/doc/english/prop-on-exit-n.html
There is not currently a way to tell the Wrapper to start paused.
Please let me know how this works for you.
Cheers,
Leif
On Tue, Sep 21, 2010 at 1:43 AM, Dave Muirhead <mui...@ya...> wrote:
> The wrapper.restart.delay?"...controls the number of seconds to pause
> between a JVM exiting for any reason, and a new JVM being launched."
> But I wonder, is there any way to use criteria other than time to decide
> when to relaunch? For example, is there a way to?configure JSW to?monitor
> the value of a JMX MBean attribute and wait to restart the JVM until that
> MBean attribute takes on a specific value?
>
> Thanks,
>
> Dave
|