org.nanocontainer
Class DefaultNanoContainer

java.lang.Object
  extended by org.nanocontainer.DefaultNanoContainer
All Implemented Interfaces:
NanoContainer

public class DefaultNanoContainer
extends java.lang.Object
implements NanoContainer

The default implementation of NanoContainer.

Author:
Paul Hammant, Aslak Hellesøy

Constructor Summary
DefaultNanoContainer()
          Beware - no parent container and no parent classloader.
DefaultNanoContainer(java.lang.ClassLoader parentClassLoader)
           
DefaultNanoContainer(java.lang.ClassLoader parentClassLoader, org.picocontainer.MutablePicoContainer picoContainer)
           
DefaultNanoContainer(org.picocontainer.MutablePicoContainer picoContainer)
           
DefaultNanoContainer(NanoContainer parent)
           
 
Method Summary
 ClassPathElement addClassLoaderURL(java.net.URL url)
          Adds a new URL that will be used in classloading
 org.picocontainer.MutablePicoContainer addDecoratingPicoContainer(java.lang.Class picoContainerClass)
           
 java.lang.ClassLoader getComponentClassLoader()
           
 java.lang.Object getComponentInstanceOfType(java.lang.String componentType)
          Find a component instance matching the specified type.
 org.picocontainer.MutablePicoContainer getPico()
          Returns the wrapped PicoContainer instance (russian doll concept).
 org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key, java.lang.String componentImplementationClassName)
           
 org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key, java.lang.String componentImplementationClassName, org.picocontainer.Parameter[] parameters)
           
 org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key, java.lang.String componentImplementationClassName, java.lang.String[] parameterTypesAsString, java.lang.String[] parameterValuesAsString)
           
 org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.String componentImplementationClassName)
           
 org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.String componentImplementationClassName, java.lang.String[] parameterTypesAsString, java.lang.String[] parameterValuesAsString)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNanoContainer

public DefaultNanoContainer(java.lang.ClassLoader parentClassLoader,
                            org.picocontainer.MutablePicoContainer picoContainer)

DefaultNanoContainer

public DefaultNanoContainer(java.lang.ClassLoader parentClassLoader)

DefaultNanoContainer

public DefaultNanoContainer(org.picocontainer.MutablePicoContainer picoContainer)

DefaultNanoContainer

public DefaultNanoContainer(NanoContainer parent)

DefaultNanoContainer

public DefaultNanoContainer()
Beware - no parent container and no parent classloader.

Method Detail

registerComponentImplementation

public org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.String componentImplementationClassName)
                                                                   throws org.picocontainer.PicoRegistrationException,
                                                                          java.lang.ClassNotFoundException,
                                                                          org.picocontainer.PicoIntrospectionException
Specified by:
registerComponentImplementation in interface NanoContainer
Throws:
org.picocontainer.PicoRegistrationException
java.lang.ClassNotFoundException
org.picocontainer.PicoIntrospectionException

registerComponentImplementation

public org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key,
                                                                          java.lang.String componentImplementationClassName)
                                                                   throws java.lang.ClassNotFoundException
Specified by:
registerComponentImplementation in interface NanoContainer
Throws:
java.lang.ClassNotFoundException

registerComponentImplementation

public org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key,
                                                                          java.lang.String componentImplementationClassName,
                                                                          org.picocontainer.Parameter[] parameters)
                                                                   throws java.lang.ClassNotFoundException
Specified by:
registerComponentImplementation in interface NanoContainer
Throws:
java.lang.ClassNotFoundException

registerComponentImplementation

public org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.Object key,
                                                                          java.lang.String componentImplementationClassName,
                                                                          java.lang.String[] parameterTypesAsString,
                                                                          java.lang.String[] parameterValuesAsString)
                                                                   throws org.picocontainer.PicoRegistrationException,
                                                                          java.lang.ClassNotFoundException,
                                                                          org.picocontainer.PicoIntrospectionException
Specified by:
registerComponentImplementation in interface NanoContainer
Throws:
org.picocontainer.PicoRegistrationException
java.lang.ClassNotFoundException
org.picocontainer.PicoIntrospectionException

registerComponentImplementation

public org.picocontainer.ComponentAdapter registerComponentImplementation(java.lang.String componentImplementationClassName,
                                                                          java.lang.String[] parameterTypesAsString,
                                                                          java.lang.String[] parameterValuesAsString)
                                                                   throws org.picocontainer.PicoRegistrationException,
                                                                          java.lang.ClassNotFoundException,
                                                                          org.picocontainer.PicoIntrospectionException
Specified by:
registerComponentImplementation in interface NanoContainer
Throws:
org.picocontainer.PicoRegistrationException
java.lang.ClassNotFoundException
org.picocontainer.PicoIntrospectionException

addClassLoaderURL

public ClassPathElement addClassLoaderURL(java.net.URL url)
Description copied from interface: NanoContainer
Adds a new URL that will be used in classloading

Specified by:
addClassLoaderURL in interface NanoContainer

getComponentClassLoader

public java.lang.ClassLoader getComponentClassLoader()
Specified by:
getComponentClassLoader in interface NanoContainer

getPico

public org.picocontainer.MutablePicoContainer getPico()
Description copied from interface: NanoContainer
Returns the wrapped PicoContainer instance (russian doll concept). The method name is short in order to favour the use of nano.pico from Groovy.

Specified by:
getPico in interface NanoContainer
Returns:
the wrapped PicoContainer instance.

getComponentInstanceOfType

public java.lang.Object getComponentInstanceOfType(java.lang.String componentType)
Description copied from interface: NanoContainer
Find a component instance matching the specified type.

Specified by:
getComponentInstanceOfType in interface NanoContainer
Parameters:
componentType - the type of the component.
Returns:
the adapter matching the class.

addDecoratingPicoContainer

public org.picocontainer.MutablePicoContainer addDecoratingPicoContainer(java.lang.Class picoContainerClass)
Specified by:
addDecoratingPicoContainer in interface NanoContainer


Copyright © 2003-2010 Codehaus. All Rights Reserved.