tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Lutum <>
Subject Shutdown embedded OpenEJB gracefully
Date Tue, 20 Sep 2011 07:11:41 GMT
Hi out there.
I am using OpenEJB 3.1.4 the embedded way and need a way to stop the server gracefully.
I start it via:
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
properties.setProperty("openejb.embedded.remotable", "true");
properties.setProperty("openejb.configuration", openEjbBase+File.separator+"conf"+File.separator+"openejb.xml");
properties.setProperty("openejb.home", openEjbBase);

// and start it
InitialContext localContext =  new InitialContext(properties);

localContext.close() does not work

Our plan is to start and stop the openejb system on demand. It hosts a configuration Backend
which is not needed all the time.
We are running this on a 256MB embedded device so if possible we have to save the memory :-)...
For this I have created a handler which starts a new java VM Process (Runtime.exec) with a
main method which contains the above code.
Killing the process is not really a good option or?

So is there a remote accessible service which allows me to shut down openejb?
If only doable from inside the container what if I monitor the filesystem for a special marker
file via a singleton service and if available start the shutdown process.

So any ideas to "kill" the server would be helpful.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message