org.apache.maven.classrealm
Class DefaultClassRealmManager

java.lang.Object
  extended by org.apache.maven.classrealm.DefaultClassRealmManager
All Implemented Interfaces:
ClassRealmManager

@Component(role=ClassRealmManager.class)
public class DefaultClassRealmManager
extends Object
implements ClassRealmManager

Manages the class realms used by Maven. Warning: This is an internal utility class that is only public for technical reasons, it is not part of the public API. In particular, this class can be changed or deleted without prior notice.

Author:
Benjamin Bentmann

Field Summary
protected  PlexusContainer container
           
 
Constructor Summary
DefaultClassRealmManager()
           
 
Method Summary
 ClassRealm createExtensionRealm(Plugin plugin, List<org.sonatype.aether.artifact.Artifact> artifacts)
          Creates a new class realm for the specified build extension.
 ClassRealm createPluginRealm(Plugin plugin, ClassLoader parent, List<String> imports, List<org.sonatype.aether.artifact.Artifact> artifacts)
          Creates a new class realm for the specified plugin.
 ClassRealm createProjectRealm(Model model, List<org.sonatype.aether.artifact.Artifact> artifacts)
          Creates a new class realm for the specified project and its build extensions.
 ClassRealm getCoreRealm()
          Gets the class realm hosting the Maven core.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

@Requirement
protected PlexusContainer container
Constructor Detail

DefaultClassRealmManager

public DefaultClassRealmManager()
Method Detail

getCoreRealm

public ClassRealm getCoreRealm()
Description copied from interface: ClassRealmManager
Gets the class realm hosting the Maven core.

Specified by:
getCoreRealm in interface ClassRealmManager
Returns:
The class realm hosting the Maven core, never null.

createProjectRealm

public ClassRealm createProjectRealm(Model model,
                                     List<org.sonatype.aether.artifact.Artifact> artifacts)
Description copied from interface: ClassRealmManager
Creates a new class realm for the specified project and its build extensions.

Specified by:
createProjectRealm in interface ClassRealmManager
Parameters:
model - The model of the project for which to create a realm, must not be null.
artifacts - The artifacts to add to the class realm, may be null. Unresolved artifacts (i.e. with a missing file) will automatically be excluded from the realm.
Returns:
The new project realm, never null.

createExtensionRealm

public ClassRealm createExtensionRealm(Plugin plugin,
                                       List<org.sonatype.aether.artifact.Artifact> artifacts)
Description copied from interface: ClassRealmManager
Creates a new class realm for the specified build extension.

Specified by:
createExtensionRealm in interface ClassRealmManager
artifacts - The artifacts to add to the class realm, may be null. Unresolved artifacts (i.e. with a missing file) will automatically be excluded from the realm.
Returns:
The new extension realm, never null.

createPluginRealm

public ClassRealm createPluginRealm(Plugin plugin,
                                    ClassLoader parent,
                                    List<String> imports,
                                    List<org.sonatype.aether.artifact.Artifact> artifacts)
Description copied from interface: ClassRealmManager
Creates a new class realm for the specified plugin.

Specified by:
createPluginRealm in interface ClassRealmManager
Parameters:
plugin - The plugin for which to create a realm, must not be null.
parent - The parent realm for the new realm, may be null to use the Maven core realm.
imports - The packages/types to import from the parent realm, may be null.
artifacts - The artifacts to add to the class realm, may be null. Unresolved artifacts (i.e. with a missing file) will automatically be excluded from the realm.
Returns:
The new plugin realm, never null.


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.