org.sakaiproject.util
Class ComponentsLoader

java.lang.Object
  extended byorg.sakaiproject.util.ComponentsLoader
All Implemented Interfaces:
ComponentsLoader

public class ComponentsLoader
extends Object
implements ComponentsLoader

Load the available Sakai components into the shared component manager's Spring ApplicationContext

Version:
$Revision: 632 $
Author:
University of Michigan, Sakai Software Development Team

Constructor Summary
ComponentsLoader()
           
 
Method Summary
 void load(ComponentManager mgr, String componentsRoot)
          Load components into this manager.
protected  void loadComponentPackage(File dir, ConfigurableApplicationContext ac)
          Load one component package into the AC
protected  ClassLoader newPackageClassLoader(File dir)
          Create the class loader for this component package
protected  boolean validComponentsPackage(File dir)
          Test if this File is a valid components package directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentsLoader

public ComponentsLoader()
Method Detail

load

public void load(ComponentManager mgr,
                 String componentsRoot)
Description copied from interface: ComponentsLoader
Load components into this manager.

Specified by:
load in interface ComponentsLoader
Parameters:
mgr - The component manager instance.
componentsRoot - The file system canonical path to the directory where components packages are found.

loadComponentPackage

protected void loadComponentPackage(File dir,
                                    ConfigurableApplicationContext ac)
Load one component package into the AC

Parameters:
ac - The ApplicationContext to load into

validComponentsPackage

protected boolean validComponentsPackage(File dir)
Test if this File is a valid components package directory.

Parameters:
dir - The file to test
Returns:
true if it is a valid components package directory, false if not.

newPackageClassLoader

protected ClassLoader newPackageClassLoader(File dir)
Create the class loader for this component package

Parameters:
dir - The package's root directory.
Returns:
A class loader, whose parent is this class's loader, which has the classes/ and jars for this component.