View Javadoc

1   // ========================================================================
2   // Copyright (c) Webtide LLC
3   // ------------------------------------------------------------------------
4   // All rights reserved. This program and the accompanying materials
5   // are made available under the terms of the Eclipse Public License v1.0
6   // and Apache License v2.0 which accompanies this distribution.
7   //
8   // The Eclipse Public License is available at 
9   // http://www.eclipse.org/legal/epl-v10.html
10  //
11  // The Apache License v2.0 is available at
12  // http://www.apache.org/licenses/LICENSE-2.0.txt
13  //
14  // You may elect to redistribute this code under either of these licenses. 
15  // ========================================================================
16  package org.eclipse.jetty.deploy;
17  
18  import java.io.IOException;
19  
20  import org.eclipse.jetty.server.handler.ContextHandler;
21  import org.eclipse.jetty.util.component.LifeCycle;
22  
23  /**
24   * Object responsible for providing {@link App}s to the {@link DeploymentManager}
25   */
26  public interface AppProvider extends LifeCycle
27  {
28      /**
29       * Set the Deployment Manager
30       * 
31       * @param deploymentManager
32       * @throws IllegalStateException
33       *             if the provider {@link #isRunning()}.
34       */
35      void setDeploymentManager(DeploymentManager deploymentManager);
36      
37      /* ------------------------------------------------------------ */
38      /** Create a ContextHandler for an App
39       * @param app The App
40       * @return A ContextHandler
41       * @throws IOException
42       * @throws Exception 
43       */
44      ContextHandler createContextHandler(App app) throws Exception;
45  }