org.picocontainer.alternatives
Class ImplementationHidingCachingPicoContainer

java.lang.Object
  extended byorg.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
      extended byorg.picocontainer.alternatives.ImplementationHidingCachingPicoContainer
All Implemented Interfaces:
Disposable, MutablePicoContainer, PicoContainer, Serializable, Startable

public class ImplementationHidingCachingPicoContainer
extends AbstractDelegatingMutablePicoContainer
implements Serializable

This special MutablePicoContainer hides implementations of components if the key is an interface. It's very simple. Instances that are registered directly and components registered without key are not hidden.

Since:
1.1
Version:
$Revision: 1.1 $
Author:
Paul Hammant
See Also:
Serialized Form

Constructor Summary
ImplementationHidingCachingPicoContainer()
          Creates a new container with no parent container.
ImplementationHidingCachingPicoContainer(ComponentAdapterFactory caf, PicoContainer parent)
          Creates a new container with a parent container.
ImplementationHidingCachingPicoContainer(PicoContainer parent)
          Creates a new container with a parent container.
 
Method Summary
 MutablePicoContainer makeChildContainer()
          Make a child container, using the same implementation of MutablePicoContainer as the parent.
 ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation)
          Register a component.
 ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters)
          Register a component.
 
Methods inherited from class org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer
accept, addChildContainer, dispose, equals, getComponentAdapter, getComponentAdapterOfType, getComponentAdapters, getComponentAdaptersOfType, getComponentInstance, getComponentInstanceOfType, getComponentInstances, getComponentInstancesOfType, getDelegate, getParent, registerComponent, registerComponentImplementation, registerComponentInstance, registerComponentInstance, removeChildContainer, start, stop, unregisterComponent, unregisterComponentByInstance, verify
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImplementationHidingCachingPicoContainer

public ImplementationHidingCachingPicoContainer(ComponentAdapterFactory caf,
                                                PicoContainer parent)
Creates a new container with a parent container.


ImplementationHidingCachingPicoContainer

public ImplementationHidingCachingPicoContainer(PicoContainer parent)
Creates a new container with a parent container.


ImplementationHidingCachingPicoContainer

public ImplementationHidingCachingPicoContainer()
Creates a new container with no parent container.

Method Detail

registerComponentImplementation

public ComponentAdapter registerComponentImplementation(Object componentKey,
                                                        Class componentImplementation)
                                                 throws PicoRegistrationException
Description copied from interface: MutablePicoContainer
Register a component.

Specified by:
registerComponentImplementation in interface MutablePicoContainer
Overrides:
registerComponentImplementation in class AbstractDelegatingMutablePicoContainer
Throws:
PicoRegistrationException

registerComponentImplementation

public ComponentAdapter registerComponentImplementation(Object componentKey,
                                                        Class componentImplementation,
                                                        Parameter[] parameters)
                                                 throws PicoRegistrationException
Description copied from interface: MutablePicoContainer
Register a component.

Specified by:
registerComponentImplementation in interface MutablePicoContainer
Overrides:
registerComponentImplementation in class AbstractDelegatingMutablePicoContainer
Throws:
PicoRegistrationException

makeChildContainer

public MutablePicoContainer makeChildContainer()
Description copied from interface: MutablePicoContainer
Make a child container, using the same implementation of MutablePicoContainer as the parent. It will have a reference to this as parent. This will list the resulting MPC as a child. Lifecycle events will be cascaded from parent to child as a consequence of this.

Specified by:
makeChildContainer in interface MutablePicoContainer
Returns:
the new child container.


Copyright © 2003-2004 Codehaus. All Rights Reserved.