org.nanocontainer.reflection
Class AbstractNanoPicoContainer

java.lang.Object
  extended by org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
      extended by org.nanocontainer.reflection.AbstractNanoPicoContainer
All Implemented Interfaces:
java.io.Serializable, NanoContainer, NanoPicoContainer, org.picocontainer.Disposable, org.picocontainer.MutablePicoContainer, org.picocontainer.PicoContainer, org.picocontainer.Startable
Direct Known Subclasses:
DefaultNanoPicoContainer, ImplementationHidingNanoPicoContainer

public abstract class AbstractNanoPicoContainer
extends org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
implements NanoPicoContainer, java.io.Serializable

A base class for NanoPicoContainers. As well as the functionality indicated by the interface it implements, extenders of this class will have named child component capability.

Version:
$Revision: 2964 $
Author:
Paul Hammant
See Also:
Serialized Form

Field Summary
protected  NanoContainer container
           
protected  java.util.Map namedChildContainers
           
 
Constructor Summary
protected AbstractNanoPicoContainer(org.picocontainer.MutablePicoContainer delegate, java.lang.ClassLoader classLoader)
           
 
Method Summary
 boolean addChildContainer(org.picocontainer.PicoContainer child)
           
 void addChildContainer(java.lang.String name, org.picocontainer.PicoContainer child)
           
 ClassPathElement addClassLoaderURL(java.net.URL url)
          Adds a new URL that will be used in classloading
 org.picocontainer.MutablePicoContainer addDecoratingPicoContainer(java.lang.Class picoContainerClass)
           
protected abstract  AbstractNanoPicoContainer createChildContainer()
           
 java.lang.ClassLoader getComponentClassLoader()
           
 java.lang.Object getComponentInstance(java.lang.Object componentKey)
           
 java.lang.Object getComponentInstanceOfType(java.lang.String componentType)
          Find a component instance matching the specified type.
protected  java.util.Map getNamedContainers()
           
 org.picocontainer.MutablePicoContainer getPico()
          Returns the wrapped PicoContainer instance (russian doll concept).
 org.picocontainer.MutablePicoContainer makeChildContainer()
           
 org.picocontainer.MutablePicoContainer makeChildContainer(java.lang.String name)
          Makes a child container with the same basic characteristics of this object (ComponentAdapterFactory, PicoContainer type, LifecycleManager, etc)
 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)
           
 boolean removeChildContainer(org.picocontainer.PicoContainer child)
           
 
Methods inherited from class org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
accept, dispose, equals, getComponentAdapter, getComponentAdapterOfType, getComponentAdapters, getComponentAdaptersOfType, getComponentInstanceOfType, getComponentInstances, getComponentInstancesOfType, getDelegate, getParent, registerComponent, registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentInstance, registerComponentInstance, start, stop, unregisterComponent, unregisterComponentByInstance, verify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.picocontainer.MutablePicoContainer
registerComponent, registerComponentImplementation, registerComponentImplementation, registerComponentImplementation, registerComponentInstance, registerComponentInstance, unregisterComponent, unregisterComponentByInstance
 
Methods inherited from interface org.picocontainer.PicoContainer
accept, getComponentAdapter, getComponentAdapterOfType, getComponentAdapters, getComponentAdaptersOfType, getComponentInstanceOfType, getComponentInstances, getComponentInstancesOfType, getParent, verify
 
Methods inherited from interface org.picocontainer.Startable
start, stop
 
Methods inherited from interface org.picocontainer.Disposable
dispose
 

Field Detail

namedChildContainers

protected java.util.Map namedChildContainers

container

protected transient NanoContainer container
Constructor Detail

AbstractNanoPicoContainer

protected AbstractNanoPicoContainer(org.picocontainer.MutablePicoContainer delegate,
                                    java.lang.ClassLoader classLoader)
Method Detail

getComponentInstance

public final java.lang.Object getComponentInstance(java.lang.Object componentKey)
                                            throws org.picocontainer.PicoException
Specified by:
getComponentInstance in interface org.picocontainer.PicoContainer
Overrides:
getComponentInstance in class org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
Throws:
org.picocontainer.PicoException

makeChildContainer

public final org.picocontainer.MutablePicoContainer makeChildContainer()
Specified by:
makeChildContainer in interface org.picocontainer.MutablePicoContainer

makeChildContainer

public org.picocontainer.MutablePicoContainer makeChildContainer(java.lang.String name)
Makes a child container with the same basic characteristics of this object (ComponentAdapterFactory, PicoContainer type, LifecycleManager, etc)

Specified by:
makeChildContainer in interface NanoPicoContainer
Parameters:
name - the name of the child container
Returns:
The child MutablePicoContainer

createChildContainer

protected abstract AbstractNanoPicoContainer createChildContainer()

removeChildContainer

public boolean removeChildContainer(org.picocontainer.PicoContainer child)
Specified by:
removeChildContainer in interface org.picocontainer.MutablePicoContainer
Overrides:
removeChildContainer in class org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer

getNamedContainers

protected final java.util.Map getNamedContainers()

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

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

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

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.

getComponentClassLoader

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

addChildContainer

public boolean addChildContainer(org.picocontainer.PicoContainer child)
Specified by:
addChildContainer in interface org.picocontainer.MutablePicoContainer
Overrides:
addChildContainer in class org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer

addChildContainer

public void addChildContainer(java.lang.String name,
                              org.picocontainer.PicoContainer child)
Specified by:
addChildContainer in interface NanoPicoContainer


Copyright © 2003-2009 Codehaus. All Rights Reserved.