1 package org.apache.maven.extension.internal;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.LinkedHashMap;
23 import java.util.Map;
24 import java.util.Set;
25
26 import org.codehaus.plexus.classworlds.realm.ClassRealm;
27
28 import com.google.common.collect.ImmutableMap;
29 import com.google.common.collect.ImmutableSet;
30
31
32
33
34
35
36
37 public class CoreExports
38 {
39 private final Set<String> artifacts;
40
41 private final Map<String, ClassLoader> packages;
42
43 public CoreExports( CoreExtensionEntry entry )
44 {
45 this( entry.getClassRealm(), entry.getExportedArtifacts(), entry.getExportedPackages() );
46 }
47
48 public CoreExports( ClassRealm realm, Set<String> exportedArtifacts, Set<String> exportedPackages )
49 {
50 Map<String, ClassLoader> packages = new LinkedHashMap<String, ClassLoader>();
51 for ( String pkg : exportedPackages )
52 {
53 packages.put( pkg, realm );
54 }
55 this.artifacts = ImmutableSet.copyOf( exportedArtifacts );
56 this.packages = ImmutableMap.copyOf( packages );
57 }
58
59
60
61
62
63 public Set<String> getExportedArtifacts()
64 {
65 return artifacts;
66 }
67
68
69
70
71 public Map<String, ClassLoader> getExportedPackages()
72 {
73 return packages;
74 }
75 }