View Javadoc
1   package org.codehaus.plexus.classworlds.realm;
2   
3   import org.codehaus.plexus.classworlds.ClassWorld;
4   import org.codehaus.plexus.classworlds.ClassWorldException;
5   
6   /*
7    * Copyright 2001-2006 Codehaus Foundation.
8    *
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   *
13   *      http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   */
21  
22  /**
23   * Indicates an attempt to add a <code>ClassRealm</code> to a
24   * <code>ClassWorld</code> with a duplicate id.
25   *
26   * @author <a href="mailto:bob@eng.werken.com">bob mcwhirter</a>
27   */
28  public class DuplicateRealmException
29      extends ClassWorldException
30  {
31      // ------------------------------------------------------------
32      //     Instance members
33      // ------------------------------------------------------------
34  
35      /**
36       * The realm id.
37       */
38      private String id;
39  
40      // ------------------------------------------------------------
41      //     Constructors
42      // ------------------------------------------------------------
43  
44      /**
45       * Construct.
46       *
47       * @param world The world.
48       * @param id    The realm id.
49       */
50      public DuplicateRealmException( ClassWorld world, String id )
51      {
52          super( world, id );
53          this.id = id;
54      }
55  
56      // ------------------------------------------------------------
57      //     Instance methods
58      // ------------------------------------------------------------
59  
60      /**
61       * Retrieve the duplicate realm id.
62       *
63       * @return The id.
64       */
65      public String getId()
66      {
67          return this.id;
68      }
69  }