users@glassfish.java.net

Re: Startup Glassfish 2.1 in "offline-mode"

From: <glassfish_at_javadesktop.org>
Date: Sat, 16 Jan 2010 13:07:43 PST

Hi Mattias,

how about using Lifecycle Listeners, see "Chapter 13 Developing Lifecycle Listeners" in the GF v2.1
docs at http://docs.sun.com/app/docs/doc/820-4336/beamc?l=en&a=view

The Lifecycle module is notified by the server startup and can then disable the http listener using AMX calls. The usage of AMX to disable the http listener is the tricky part, I got some by Anissa Lam from Sun help in the thread "How to start the server with a disabled HTTP listener":

http://forums.java.net/jive/message.jspa?messageID=358794#358794

Finally, putting the pieces together resulted in the attached code for a Lifecycle module.
We use the standard http listener configuration without clustering so you may have to adapt
the code a bit.

Cheers, Jörg
[Message sent by forum member 'jthoennes' (joerg.thoennes_at_macd.com)]

http://forums.java.net/jive/thread.jspa?messageID=381367