View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.classrealm;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  /**
25   * @author Benjamin Bentmann
26   */
27  class DefaultClassRealmRequest implements ClassRealmRequest {
28  
29      private final RealmType type;
30  
31      private final ClassLoader parent;
32  
33      private final List<String> parentImports;
34  
35      private final Map<String, ClassLoader> foreignImports;
36  
37      private final List<ClassRealmConstituent> constituents;
38  
39      DefaultClassRealmRequest(
40              RealmType type,
41              ClassLoader parent,
42              List<String> parentImports,
43              Map<String, ClassLoader> foreignImports,
44              List<ClassRealmConstituent> constituents) {
45          this.type = type;
46          this.parent = parent;
47          this.parentImports = parentImports;
48          this.foreignImports = foreignImports;
49          this.constituents = constituents;
50      }
51  
52      public RealmType getType() {
53          return type;
54      }
55  
56      public ClassLoader getParent() {
57          return parent;
58      }
59  
60      public List<String> getImports() {
61          return getParentImports();
62      }
63  
64      public List<String> getParentImports() {
65          return parentImports;
66      }
67  
68      public Map<String, ClassLoader> getForeignImports() {
69          return foreignImports;
70      }
71  
72      public List<ClassRealmConstituent> getConstituents() {
73          return constituents;
74      }
75  }