org.picocontainer.gems.adapters
Class StaticFactoryComponentAdapter

java.lang.Object
  extended byorg.picocontainer.defaults.MonitoringComponentAdapter
      extended byorg.picocontainer.defaults.AbstractComponentAdapter
          extended byorg.picocontainer.gems.adapters.StaticFactoryComponentAdapter
All Implemented Interfaces:
org.picocontainer.ComponentAdapter, org.picocontainer.defaults.ComponentMonitorStrategy, Serializable

public class StaticFactoryComponentAdapter
extends org.picocontainer.defaults.AbstractComponentAdapter

Component adapter that wrapps a static factory with the help of StaticFactory.

Since:
1.1
Author:
Jörg Schaible, Leo Simmons
See Also:
Serialized Form

Constructor Summary
StaticFactoryComponentAdapter(Class type, StaticFactory staticFactory)
          Construct a ComponentAdapter accessing a static factory creating the component.
StaticFactoryComponentAdapter(Object componentKey, Class type, StaticFactory staticFactory)
          Construct a ComponentAdapter accessing a static factory creating the component using a special key for component registration.
 
Method Summary
 Object getComponentInstance(org.picocontainer.PicoContainer container)
           
 void verify(org.picocontainer.PicoContainer container)
          
 
Methods inherited from class org.picocontainer.defaults.AbstractComponentAdapter
accept, checkTypeCompatibility, getComponentImplementation, getComponentKey, toString
 
Methods inherited from class org.picocontainer.defaults.MonitoringComponentAdapter
changeMonitor, currentMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StaticFactoryComponentAdapter

public StaticFactoryComponentAdapter(Class type,
                                     StaticFactory staticFactory)
Construct a ComponentAdapter accessing a static factory creating the component.

Parameters:
type - The type of the created component.
staticFactory - Wrapper instance for the static factory.

StaticFactoryComponentAdapter

public StaticFactoryComponentAdapter(Object componentKey,
                                     Class type,
                                     StaticFactory staticFactory)
Construct a ComponentAdapter accessing a static factory creating the component using a special key for component registration.

Parameters:
componentKey - The key of the created component.
type - The type of the created component.
staticFactory - Wrapper instance for the static factory.
Method Detail

getComponentInstance

public Object getComponentInstance(org.picocontainer.PicoContainer container)
                            throws org.picocontainer.PicoInitializationException,
                                   org.picocontainer.PicoIntrospectionException
Returns:
Returns the component created by the static factory.
Throws:
org.picocontainer.PicoInitializationException
org.picocontainer.PicoIntrospectionException
See Also:
ComponentAdapter.getComponentInstance(org.picocontainer.PicoContainer)

verify

public void verify(org.picocontainer.PicoContainer container)
            throws org.picocontainer.PicoVerificationException

Throws:
org.picocontainer.PicoVerificationException
See Also:
ComponentAdapter.verify(org.picocontainer.PicoContainer)


Copyright © 2003-2007 Codehaus. All Rights Reserved.