1 //======================================================================== 2 //$Id: Configuration.java,v 1.2 2005/10/26 20:48:48 gregwilkins Exp $ 3 //Copyright 2004-2005 Mort Bay Consulting Pty. Ltd. 4 //------------------------------------------------------------------------ 5 //Licensed under the Apache License, Version 2.0 (the "License"); 6 //you may not use this file except in compliance with the License. 7 //You may obtain a copy of the License at 8 //http://www.apache.org/licenses/LICENSE-2.0 9 //Unless required by applicable law or agreed to in writing, software 10 //distributed under the License is distributed on an "AS IS" BASIS, 11 //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 //See the License for the specific language governing permissions and 13 //limitations under the License. 14 //======================================================================== 15 16 package org.mortbay.jetty.webapp; 17 18 import java.io.Serializable; 19 20 /* ------------------------------------------------------------------------------- */ 21 /** Base Class for WebApplicationContext Configuration. 22 * This class can be extended to customize or extend the configuration 23 * of the WebApplicationContext. If WebApplicationContext.setConfiguration is not 24 * called, then an XMLConfiguration instance is created. 25 * 26 * @author gregw 27 */ 28 public interface Configuration extends Serializable 29 { 30 /* ------------------------------------------------------------------------------- */ 31 /** Set up a context on which to perform the configuration. 32 * @param context 33 */ 34 public void setWebAppContext (WebAppContext context); 35 36 /* ------------------------------------------------------------------------------- */ 37 /** Get the context on which the configuration is performed. 38 */ 39 public WebAppContext getWebAppContext(); 40 41 /* ------------------------------------------------------------------------------- */ 42 /** Configure ClassPath. 43 * This method is called to configure the context ClassLoader. It is called just 44 * after a new WebAppClassLoader is constructed and before it has been used. 45 * Class paths may be added, options changed or the loader totally replaced. 46 * @throws Exception 47 */ 48 public void configureClassLoader() 49 throws Exception; 50 51 /* ------------------------------------------------------------------------------- */ 52 /** Configure Defaults. 53 * This method is called to intialize the context to the containers default configuration. 54 * Typically this would mean application of the webdefault.xml file. 55 * @throws Exception 56 */ 57 public void configureDefaults() 58 throws Exception; 59 60 61 /* ------------------------------------------------------------------------------- */ 62 /** Configure WebApp. 63 * This method is called to apply the standard and vendor deployment descriptors. 64 * Typically this is web.xml and jetty-web.xml. 65 * @throws Exception 66 */ 67 public void configureWebApp() 68 throws Exception; 69 70 /* ------------------------------------------------------------------------------- */ 71 /** DeConfigure WebApp. 72 * This method is called to undo all configuration done to this webapphandler. This is 73 * called to allow the context to work correctly over a stop/start cycle 74 * @throws Exception 75 */ 76 public void deconfigureWebApp() 77 throws Exception; 78 79 80 }