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      /**
34       * Define the main class name
35       * @param mainClassName the main class name
36       * @param mainRealmName the main realm from which the main class is loaded
37       */
38      void setAppMain( String mainClassName, String mainRealmName );
39  
40      /**
41       * Define a new realm
42       * @param realmName the new realm name
43       * @throws DuplicateRealmException
44       */
45      void addRealm( String realmName )
46          throws DuplicateRealmException;
47  
48      /**
49       * Add an import specification from a realm
50       * @param relamName the realm name
51       * @param importSpec the import specification
52       * @throws NoSuchRealmException
53       */
54      void addImportFrom( String relamName, String importSpec )
55          throws NoSuchRealmException;
56  
57      /**
58       * Add a file to the realm
59       * @param file the file to load content from
60       */
61      void addLoadFile( File file );
62  
63      /**
64       * Add an URL to the realm
65       * @param url the url to load content from
66       */
67      void addLoadURL( URL url );
68  
69  }