103928aee4356845252ac6b662d5c72c29903813eJake Slack//
203928aee4356845252ac6b662d5c72c29903813eJake Slack//  ========================================================================
303928aee4356845252ac6b662d5c72c29903813eJake Slack//  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
403928aee4356845252ac6b662d5c72c29903813eJake Slack//  ------------------------------------------------------------------------
503928aee4356845252ac6b662d5c72c29903813eJake Slack//  All rights reserved. This program and the accompanying materials
603928aee4356845252ac6b662d5c72c29903813eJake Slack//  are made available under the terms of the Eclipse Public License v1.0
703928aee4356845252ac6b662d5c72c29903813eJake Slack//  and Apache License v2.0 which accompanies this distribution.
803928aee4356845252ac6b662d5c72c29903813eJake Slack//
903928aee4356845252ac6b662d5c72c29903813eJake Slack//      The Eclipse Public License is available at
1003928aee4356845252ac6b662d5c72c29903813eJake Slack//      http://www.eclipse.org/legal/epl-v10.html
1103928aee4356845252ac6b662d5c72c29903813eJake Slack//
1203928aee4356845252ac6b662d5c72c29903813eJake Slack//      The Apache License v2.0 is available at
1303928aee4356845252ac6b662d5c72c29903813eJake Slack//      http://www.opensource.org/licenses/apache2.0.php
1403928aee4356845252ac6b662d5c72c29903813eJake Slack//
1503928aee4356845252ac6b662d5c72c29903813eJake Slack//  You may elect to redistribute this code under either of these licenses.
1603928aee4356845252ac6b662d5c72c29903813eJake Slack//  ========================================================================
1703928aee4356845252ac6b662d5c72c29903813eJake Slack//
1803928aee4356845252ac6b662d5c72c29903813eJake Slack
1903928aee4356845252ac6b662d5c72c29903813eJake Slackpackage org.eclipse.jetty.webapp;
2003928aee4356845252ac6b662d5c72c29903813eJake Slack
2103928aee4356845252ac6b662d5c72c29903813eJake Slack
2203928aee4356845252ac6b662d5c72c29903813eJake Slack/* ------------------------------------------------------------------------------- */
2303928aee4356845252ac6b662d5c72c29903813eJake Slack/** Base Class for WebApplicationContext Configuration.
2403928aee4356845252ac6b662d5c72c29903813eJake Slack * This class can be extended to customize or extend the configuration
2503928aee4356845252ac6b662d5c72c29903813eJake Slack * of the WebApplicationContext.
2603928aee4356845252ac6b662d5c72c29903813eJake Slack */
2703928aee4356845252ac6b662d5c72c29903813eJake Slackpublic interface Configuration
2803928aee4356845252ac6b662d5c72c29903813eJake Slack{
2903928aee4356845252ac6b662d5c72c29903813eJake Slack
3003928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
3103928aee4356845252ac6b662d5c72c29903813eJake Slack    /** Set up for configuration.
3203928aee4356845252ac6b662d5c72c29903813eJake Slack     * <p>
3303928aee4356845252ac6b662d5c72c29903813eJake Slack     * Typically this step discovers configuration resources
3403928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
3503928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
3603928aee4356845252ac6b662d5c72c29903813eJake Slack     */
3703928aee4356845252ac6b662d5c72c29903813eJake Slack    public void preConfigure (WebAppContext context) throws Exception;
3803928aee4356845252ac6b662d5c72c29903813eJake Slack
3903928aee4356845252ac6b662d5c72c29903813eJake Slack
4003928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
4103928aee4356845252ac6b662d5c72c29903813eJake Slack    /** Configure WebApp.
4203928aee4356845252ac6b662d5c72c29903813eJake Slack     * <p>
4303928aee4356845252ac6b662d5c72c29903813eJake Slack     * Typically this step applies the discovered configuration resources to
4403928aee4356845252ac6b662d5c72c29903813eJake Slack     * either the {@link WebAppContext} or the associated {@link MetaData}.
4503928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
4603928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
4703928aee4356845252ac6b662d5c72c29903813eJake Slack     */
4803928aee4356845252ac6b662d5c72c29903813eJake Slack    public void configure (WebAppContext context) throws Exception;
4903928aee4356845252ac6b662d5c72c29903813eJake Slack
5003928aee4356845252ac6b662d5c72c29903813eJake Slack
5103928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
5203928aee4356845252ac6b662d5c72c29903813eJake Slack    /** Clear down after configuration.
5303928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
5403928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
5503928aee4356845252ac6b662d5c72c29903813eJake Slack     */
5603928aee4356845252ac6b662d5c72c29903813eJake Slack    public void postConfigure (WebAppContext context) throws Exception;
5703928aee4356845252ac6b662d5c72c29903813eJake Slack
5803928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
5903928aee4356845252ac6b662d5c72c29903813eJake Slack    /** DeConfigure WebApp.
6003928aee4356845252ac6b662d5c72c29903813eJake Slack     * This method is called to undo all configuration done. This is
6103928aee4356845252ac6b662d5c72c29903813eJake Slack     * called to allow the context to work correctly over a stop/start cycle
6203928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
6303928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
6403928aee4356845252ac6b662d5c72c29903813eJake Slack     */
6503928aee4356845252ac6b662d5c72c29903813eJake Slack    public void deconfigure (WebAppContext context) throws Exception;
6603928aee4356845252ac6b662d5c72c29903813eJake Slack
6703928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
6803928aee4356845252ac6b662d5c72c29903813eJake Slack    /** Destroy WebApp.
6903928aee4356845252ac6b662d5c72c29903813eJake Slack     * This method is called to destroy a webappcontext. It is typically called when a context
7003928aee4356845252ac6b662d5c72c29903813eJake Slack     * is removed from a server handler hierarchy by the deployer.
7103928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
7203928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
7303928aee4356845252ac6b662d5c72c29903813eJake Slack     */
7403928aee4356845252ac6b662d5c72c29903813eJake Slack    public void destroy (WebAppContext context) throws Exception;
7503928aee4356845252ac6b662d5c72c29903813eJake Slack
7603928aee4356845252ac6b662d5c72c29903813eJake Slack
7703928aee4356845252ac6b662d5c72c29903813eJake Slack    /* ------------------------------------------------------------------------------- */
7803928aee4356845252ac6b662d5c72c29903813eJake Slack    /** Clone configuration instance.
7903928aee4356845252ac6b662d5c72c29903813eJake Slack     * <p>
8003928aee4356845252ac6b662d5c72c29903813eJake Slack     * Configure an instance of a WebAppContext, based on a template WebAppContext that
8103928aee4356845252ac6b662d5c72c29903813eJake Slack     * has previously been configured by this Configuration.
8203928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param template The template context
8303928aee4356845252ac6b662d5c72c29903813eJake Slack     * @param context The context to configure
8403928aee4356845252ac6b662d5c72c29903813eJake Slack     * @throws Exception
8503928aee4356845252ac6b662d5c72c29903813eJake Slack     */
8603928aee4356845252ac6b662d5c72c29903813eJake Slack    public void cloneConfigure (WebAppContext template, WebAppContext context) throws Exception;
8703928aee4356845252ac6b662d5c72c29903813eJake Slack}
88