org.apache.avalon.repository.main
Class DefaultBuilder

java.lang.Object
  extended byorg.apache.avalon.repository.main.AbstractBuilder
      extended byorg.apache.avalon.repository.main.DefaultBuilder
All Implemented Interfaces:
Builder

public class DefaultBuilder
extends AbstractBuilder
implements Builder

Application and component bootstrapper used to instantiate, and or invoke Classes and their methods within newly constructed Repository ClassLoaders.

Version:
$Revision: 1.10 $
Author:
Alex Karasulu, $Author: mcconnell $

Constructor Summary
DefaultBuilder(InitialContext context, Artifact artifact)
          Creates a DefaultBuilder for a specific target application.
DefaultBuilder(InitialContext context, ClassLoader classloader, Artifact artifact)
          Creates a DefaultBuilder for a specific target application.
 
Method Summary
static Artifact createImplementationArtifact(ClassLoader classloader, File system, File base, String resource, String key)
          Resolve the default implementation taking into account local and home properties, and application defaults.
static Artifact createImplementationArtifact(ClassLoader classloader, File base, String resource, String key)
          Resolve the default implementation taking into account local and home properties, and application defaults.
 ClassLoader getClassLoader()
          Gets the ClassLoader used by this Bootstrapper.
 Factory getFactory()
          Return the factory established by the loader.
 
Methods inherited from class org.apache.avalon.repository.main.AbstractBuilder
createDelegate, loadFactoryClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuilder

public DefaultBuilder(InitialContext context,
                      Artifact artifact)
               throws Exception
Creates a DefaultBuilder for a specific target application.

Parameters:
context - the initial repository context
artifact - the reference to the application
Throws:
RepositoryException - if a app factory creation error occurs
Exception

DefaultBuilder

public DefaultBuilder(InitialContext context,
                      ClassLoader classloader,
                      Artifact artifact)
               throws Exception
Creates a DefaultBuilder for a specific target application.

Parameters:
context - the initial repository context
classloader - the parent classloader
artifact - the reference to the application
Throws:
Exception - if a app factory creation error occurs
Method Detail

createImplementationArtifact

public static Artifact createImplementationArtifact(ClassLoader classloader,
                                                    File base,
                                                    String resource,
                                                    String key)
                                             throws Exception
Resolve the default implementation taking into account local and home properties, and application defaults.

Parameters:
classloader - the embedding classloader
base - the base directory
resource - a properties filename
key - a property key containing an artifact specification
Returns:
the artifact reference
Throws:
Exception

createImplementationArtifact

public static Artifact createImplementationArtifact(ClassLoader classloader,
                                                    File system,
                                                    File base,
                                                    String resource,
                                                    String key)
                                             throws Exception
Resolve the default implementation taking into account local and home properties, and application defaults.

Parameters:
classloader - the embedding classloader
system - the application system home directory
base - the base directory
resource - a properties filename
key - a property key containing an artifact specification
Returns:
the artifact reference
Throws:
Exception

getFactory

public Factory getFactory()
Return the factory established by the loader.

Specified by:
getFactory in interface Builder
Returns:
the delegate factory

getClassLoader

public ClassLoader getClassLoader()
Gets the ClassLoader used by this Bootstrapper.

Specified by:
getClassLoader in interface Builder
Returns:
the ClassLoader built by the Repository


Copyright © Apache Software Foundation. All Rights Reserved.