Mercurial > hg > tomcat-userconfig
changeset 26:9501a363dcbb
Override start and stop event handlers.
author | Mikhail Kryshen <mikhail@kryshen.net> |
---|---|
date | Tue, 03 Nov 2009 17:20:42 +0300 |
parents | 620ec7263ee1 |
children | ec5d764b73a3 |
files | nbproject/project.xml src/kryshen/catalina/userconfig/UserConfig.java |
diffstat | 2 files changed, 45 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/nbproject/project.xml Tue Nov 03 05:10:39 2009 +0300 +++ b/nbproject/project.xml Tue Nov 03 17:20:42 2009 +0300 @@ -51,10 +51,21 @@ <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1"> <compilation-unit> <package-root>src</package-root> - <classpath mode="compile">../../../misc/opt/apache-tomcat-6.0.20/lib/catalina.jar:../../../misc/opt/apache-tomcat-6.0.20/bin/tomcat-juli.jar</classpath> + <classpath mode="compile">../../../misc/apache-tomcat-6.0.20/lib/catalina.jar:../../../misc/apache-tomcat-6.0.20/bin/tomcat-juli.jar</classpath> <built-to>build</built-to> <source-level>1.5</source-level> </compilation-unit> </java-data> + <preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1"> + <module name="org-netbeans-modules-editor-indent"> + <node name="CodeStyle"> + <property name="usedProfile" value="default"/> + <node name="project"> + <property name="tab-size" value="8"/> + <property name="text-limit-width" value="80"/> + </node> + </node> + </module> + </preferences> </configuration> </project>
--- a/src/kryshen/catalina/userconfig/UserConfig.java Tue Nov 03 05:10:39 2009 +0300 +++ b/src/kryshen/catalina/userconfig/UserConfig.java Tue Nov 03 17:20:42 2009 +0300 @@ -88,12 +88,6 @@ deployUserApps(); } - @Override - protected void deployApps(String name) { - throw new UnsupportedOperationException - ("deployApps(String) is not supported."); - } - /** * Deploy applications for all available users. */ @@ -187,6 +181,13 @@ } } + /** + * Constructs context path for the specifed user name and application. + * + * @param user User name. + * @param app Application name. + * @return Context path. + */ protected String getContextPath(String user, String app) { if (app.equals("ROOT")) { return "/~" + user; @@ -194,4 +195,30 @@ return "/~" + user + '/' + app.replace('#', '/'); } + + /** + * Process a start event. + */ + @Override + public void start() { + if (log.isDebugEnabled()) { + log.debug("Starging UserConfig."); + } + + if (host.getDeployOnStartup()) { + deployApps(); + } + } + + /** + * Process a stop event. + */ + @Override + public void stop() { + if (log.isDebugEnabled()) { + log.debug("Stopping UserConfig"); + } + + undeployApps(); + } }