View Javadoc
1   package org.codehaus.plexus.classworlds.launcher;
2   
3   /*
4    * Copyright 2001-2006 Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import java.io.File;
20  import java.net.URL;
21  
22  import org.codehaus.plexus.classworlds.realm.DuplicateRealmException;
23  import org.codehaus.plexus.classworlds.realm.NoSuchRealmException;
24  
25  /**
26   * Receive notification of the logical content of launcher configuration, independently from parsing.
27   *
28   * @author Igor Fedorenko
29   */
30  public interface ConfigurationHandler {
31  
32      /**
33       * Define the main class name
34       * @param mainClassName the main class name
35       * @param mainRealmName the main realm from which the main class is loaded
36       */
37      void setAppMain(String mainClassName, String mainRealmName);
38  
39      /**
40       * Define a new realm
41       * @param realmName the new realm name
42       * @throws DuplicateRealmException when realm with name already exists
43       */
44      void addRealm(String realmName) throws DuplicateRealmException;
45  
46      /**
47       * Add an import specification from a realm
48       * @param realmName the realm name
49       * @param importSpec the import specification
50       * @throws NoSuchRealmException if realm doesn't exist
51       */
52      void addImportFrom(String realmName, String importSpec) throws NoSuchRealmException;
53  
54      /**
55       * Add a file to the realm
56       * @param file the file to load content from
57       */
58      void addLoadFile(File file);
59  
60      /**
61       * Add an URL to the realm
62       * @param url the url to load content from
63       */
64      void addLoadURL(URL url);
65  }