stopping an application that requires pre-shutdown tasks

  • From: <nando@robotchrist.com>
  • To: talk@jruby-rack.kenai.com
  • Subject: stopping an application that requires pre-shutdown tasks
  • Date: Tue, 30 Jun 2009 19:59:12 +0000 (GMT)

Hi all,

I'm running a WARbled non-Rails app on top of Glassfishv3-b52. It's
ruote-rest, a great ruby workflow engine. All seems to run just peachy,
except when stopping the app.

The original Ruby code catches an INT signal, and then stops both
Mongrel and the engine itself:

---- begin snip ----

Rack::Handler::Mongrel.run(b, :Port => port) do |server|
    trap(:INT) do

      server.stop
      RuoteRest.engine.stop <----
      sleep 1

    end
  end

---- /snip----

So, the engine *must* be stopped before stopping the app via GFv3
console/CLI.

Is there any way to access this method from jruby-rack? If so, I guess
the app could be cleanly stopped calling "RuoteRest.engine.stop" from
Servlet.destroy() - but, I wouldn't know where to write it. Too little
time to reverse-engineer jruby-rack.

Any suggestions?

Best regards,
//nando


stopping an application that requires pre-shutdown tasks

nando 06/30/2009
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close