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 diff
     1.1 --- a/nbproject/project.xml	Tue Nov 03 05:10:39 2009 +0300
     1.2 +++ b/nbproject/project.xml	Tue Nov 03 17:20:42 2009 +0300
     1.3 @@ -51,10 +51,21 @@
     1.4          <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
     1.5              <compilation-unit>
     1.6                  <package-root>src</package-root>
     1.7 -                <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>
     1.8 +                <classpath mode="compile">../../../misc/apache-tomcat-6.0.20/lib/catalina.jar:../../../misc/apache-tomcat-6.0.20/bin/tomcat-juli.jar</classpath>
     1.9                  <built-to>build</built-to>
    1.10                  <source-level>1.5</source-level>
    1.11              </compilation-unit>
    1.12          </java-data>
    1.13 +        <preferences xmlns="http://www.netbeans.org/ns/auxiliary-configuration-preferences/1">
    1.14 +            <module name="org-netbeans-modules-editor-indent">
    1.15 +                <node name="CodeStyle">
    1.16 +                    <property name="usedProfile" value="default"/>
    1.17 +                    <node name="project">
    1.18 +                        <property name="tab-size" value="8"/>
    1.19 +                        <property name="text-limit-width" value="80"/>
    1.20 +                    </node>
    1.21 +                </node>
    1.22 +            </module>
    1.23 +        </preferences>
    1.24      </configuration>
    1.25  </project>
     2.1 --- a/src/kryshen/catalina/userconfig/UserConfig.java	Tue Nov 03 05:10:39 2009 +0300
     2.2 +++ b/src/kryshen/catalina/userconfig/UserConfig.java	Tue Nov 03 17:20:42 2009 +0300
     2.3 @@ -88,12 +88,6 @@
     2.4          deployUserApps();
     2.5      }
     2.6  
     2.7 -    @Override
     2.8 -    protected void deployApps(String name) {
     2.9 -        throw new UnsupportedOperationException
    2.10 -                ("deployApps(String) is not supported.");
    2.11 -    }
    2.12 -
    2.13      /**
    2.14       * Deploy applications for all available users.
    2.15       */
    2.16 @@ -187,6 +181,13 @@
    2.17          }
    2.18      }
    2.19  
    2.20 +    /**
    2.21 +     * Constructs context path for the specifed user name and application.
    2.22 +     *
    2.23 +     * @param user User name.
    2.24 +     * @param app Application name.
    2.25 +     * @return Context path.
    2.26 +     */
    2.27      protected String getContextPath(String user, String app) {
    2.28          if (app.equals("ROOT")) {
    2.29              return "/~" + user;
    2.30 @@ -194,4 +195,30 @@
    2.31  
    2.32          return "/~" + user + '/' + app.replace('#', '/');
    2.33      }
    2.34 +
    2.35 +    /**
    2.36 +     * Process a start event.
    2.37 +     */
    2.38 +    @Override
    2.39 +    public void start() {
    2.40 +        if (log.isDebugEnabled()) {
    2.41 +            log.debug("Starging UserConfig.");
    2.42 +        }
    2.43 +
    2.44 +        if (host.getDeployOnStartup()) {
    2.45 +            deployApps();
    2.46 +        }
    2.47 +    }
    2.48 +
    2.49 +    /**
    2.50 +     * Process a stop event.
    2.51 +     */
    2.52 +    @Override
    2.53 +    public void stop() {
    2.54 +        if (log.isDebugEnabled()) {
    2.55 +            log.debug("Stopping UserConfig");
    2.56 +        }
    2.57 +
    2.58 +        undeployApps();
    2.59 +    }
    2.60  }