[opencms-dev] Restarting OpenCms programmatically

Jonathan Woods jonathan.woods at scintillance.com
Tue May 16 22:14:04 CEST 2006


You could execute the same Java class/method which shuts down the whole of
Tomcat, in org.apache.catalina.startup.Bootstrap.  I haven't looked inside
that class, but I imagine you could mimic the same environment you need to
provide on the command line:

{{runtime.java.home}}/bin/java -Dscintillance.instanceName={{app.name}}
{{runtime.java.localeString}}
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file={{runtime.catalina.base}}/conf/logging.prope
rties -Djava.endorsed.dirs={{runtime.tomcat.home}}/common/endorsed
-classpath {{runtime.java.classpath}} -Djava.awt.headless=true
-Dcatalina.home={{runtime.catalina.home}}
-Dcatalina.base={{runtime.catalina.base}}
-Djava.io.tmpdir={{runtime.catalina.base}}/temp
org.apache.catalina.startup.Bootstrap stop 

(Sorry about the parameterised bits, but you get the idea.)

And you could start things up the same way.  There may be issues to do with
classloaders holding on to things, and maybe the reason you want to restart
entirely is to pick up fundamentally new aspects of configuration - e.g.
module classes - so you might need to execute the Bootstrap method in a new
classloader and thread... not sure.

Now that you ask the question, I wish I'd thought of asking myself the same
thing - it would have saved a lot of time for me!

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Sebastian Himberger
Sent: 16 May 2006 20:34
To: The OpenCms mailing list
Subject: [opencms-dev] Restarting OpenCms programmatically

Hi List,

does anybody know if there's a way to restart OpenCms securely from a Object
inside OpenCms or cause it somehow else to reinitialize it's complete
configuration? There's a shutDown() method in OpenCmsCore but this class is
not public and extreemly internal ;). Any hints would be greatly
appreciated.

best regards
Sebastian


_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list