org.objectledge.container
Class LedgeContainer

java.lang.Object
  extended by org.objectledge.container.LedgeContainer

public class LedgeContainer
extends Object

LedgeContainer is a NanoContainer flawor, that uses the FileSystem component for loading the composition file. The composition file is parsed using Ledge XmlFrontEnd. LedgeContainer also pre-feeds the internal PicoContainer with objects required by various container subsystems, including a FileSystem, ClassLoader and confiuration directory path.

Version:
$Id: LedgeContainer.java,v 1.14 2005/07/07 08:30:02 zwierzem Exp $
Author:
rafal@caltha.pl

Field Summary
private static org.picocontainer.Parameter COMPONENT
           
static String COMPOSITION_FILE
          Location of the container composition file.
static String CONFIG_BASE_KEY
          Config base path key.
protected  org.nanocontainer.integrationkit.ContainerBuilder containerBuilder
          The embedded container builder.
protected  org.picocontainer.defaults.ObjectReference containerRef
          The embedded container.
static String FRONT_END_CLASS
          Default xml front end implementation.
 
Constructor Summary
LedgeContainer(FileSystem fs, String configBase, ClassLoader classLoader)
          Creates an instance of the LedgeContainer.
 
Method Summary
private static org.picocontainer.Parameter component(Object key)
           
private static org.picocontainer.Parameter constant(Object value)
           
protected static org.picocontainer.PicoContainer getBootContainer(FileSystem fs, String configBase, ClassLoader classLoader)
          Returns the boot component container.
protected static URL getCompositionFile(FileSystem fs, String configBase)
          Verifies and returns the composition file.
 org.picocontainer.MutablePicoContainer getContainer()
          Returns the embedded container.
 void killContainer()
          Kills the embedded container.
private static org.picocontainer.Parameter[] params(org.picocontainer.Parameter... parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPOSITION_FILE

public static final String COMPOSITION_FILE
Location of the container composition file.

See Also:
Constant Field Values

FRONT_END_CLASS

public static final String FRONT_END_CLASS
Default xml front end implementation.

See Also:
Constant Field Values

CONFIG_BASE_KEY

public static final String CONFIG_BASE_KEY
Config base path key.

See Also:
Constant Field Values

containerRef

protected org.picocontainer.defaults.ObjectReference containerRef
The embedded container.


containerBuilder

protected org.nanocontainer.integrationkit.ContainerBuilder containerBuilder
The embedded container builder.


COMPONENT

private static final org.picocontainer.Parameter COMPONENT
Constructor Detail

LedgeContainer

public LedgeContainer(FileSystem fs,
                      String configBase,
                      ClassLoader classLoader)
               throws IOException,
                      ClassNotFoundException,
                      org.nanocontainer.integrationkit.PicoCompositionException
Creates an instance of the LedgeContainer.

Parameters:
fs - the FileSystem
configBase - configuration directory.
classLoader - the classload to load classes with.
Throws:
IOException - if the composition file could not be read.
ClassNotFoundException - if the container builder class could not be instantiated.
org.nanocontainer.integrationkit.PicoCompositionException - if the composition file is invalid, or could not be verified due to system failure.
Method Detail

getContainer

public org.picocontainer.MutablePicoContainer getContainer()
Returns the embedded container.

Returns:
the embedded container.

killContainer

public void killContainer()
Kills the embedded container.


getCompositionFile

protected static URL getCompositionFile(FileSystem fs,
                                        String configBase)
                                 throws IOException,
                                        org.nanocontainer.integrationkit.PicoCompositionException
Verifies and returns the composition file.

Parameters:
fs - the FileSystem to load compositoin file from.
configBase - configuration directory.
Returns:
the composition file.
Throws:
IOException - if the file could not be read.
org.nanocontainer.integrationkit.PicoCompositionException - if the composition file is invalid, or could not be verified due to system failure.

getBootContainer

protected static org.picocontainer.PicoContainer getBootContainer(FileSystem fs,
                                                                  String configBase,
                                                                  ClassLoader classLoader)
Returns the boot component container.

Parameters:
fs - the FileSystem
configBase - configuration directory.
classLoader - the classload to load classes with.
Returns:
the boot component container.

params

private static org.picocontainer.Parameter[] params(org.picocontainer.Parameter... parameters)

constant

private static org.picocontainer.Parameter constant(Object value)

component

private static org.picocontainer.Parameter component(Object key)


Copyright © 2003-2006 objectledge.org. All Rights Reserved.