RE: Remaining tasklist for alpha?

"Bordet, Simone" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Hi Lachezar,

> > But tell me, how do you stop gracefully your system ?
> > Say you configure one MBeans and then you call start() on it. To
> > stop it gracefully you have to call stop() on it. How do you do it ?
>
> Well... Our system is built as a Standalone app.
> We have set up all the available shutdown hooks and 
> interrupt handlers.
> 
> If you're asking about the shutdown of the beans...
> My implementation had sections in the XML for both the 
> startup phase and the shutdown phase.
> 
> I also had installed an MBean, that would read/execute the
> startup/shutdown script.
> 
> The handlers will then call this ROOT bean upon shutdown 
> and request, that it executes the shutdown procedure.
> I am thinking of it as an MLet-like bean, that also has the 
> start() and stop() methods.
> It is however the developer's task to set-up appropriate shutdown
> handlers, that will notify the ROOT loader of the shutdown process.

I see.
This approach seems very like JBoss' ServiceManager: one root MBean that starts all other MBeans.
The ServiceManager MBean has also the notion of dependencies, to cycle the life of MBeans (so if I stop an MBean via management interface, also the ones that depend on it will be stopped).
Also there there is a shutdown hook that calls stop on this root MBean.
I think this approach requires a lifecycle interface with at least start()/stop() methods, so that the root MBean can invoke these methods (although reflection-style-JMX-invocation allows you to "try" to invoke stop() and if there is no stop() method it does not matter).

What I'm often facing is that I would like to start my standalone server from a remote shell, and also from a remote shell, shut it down (no physical access to hardware), and then to close that shell.
I would like to have a startup.sh script and a shutdown.sh script, very much like Tomcat's (which relies on sockets).

Instead of sockets I can of course rely on JSR 160, but that requires a lot of machinery to be present: the RMIConnectorServer and a naming service on 1099, otherwise I am reduced to parse JMXConnectorServer output or PIDs, sigh.

I would like very much to write a startup.xml and a shutdown.xml with information on how to start and how to stop my server; and a startup.sh and shutdown.sh that feed these 2 xml to a configuration loader.

This is JMX, and still I see no easy way to do this.

Any idea ?

Simon


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.