org.objectledge.configuration
Class CustomizedConfigurationProvider

java.lang.Object
  extended by org.objectledge.configuration.CustomizedConfigurationProvider
All Implemented Interfaces:
CustomizedComponentProvider

public class CustomizedConfigurationProvider
extends Object
implements CustomizedComponentProvider

Provides Configuration objects to the components being initialized using ConfigurationFactory.

Version:
$Id: CustomizedConfigurationProvider.java,v 1.4 2005/02/04 02:28:03 rafal Exp $
Author:
Rafal Krzewski

Field Summary
private  ConfigurationFactory configurationFactory
           
 
Constructor Summary
CustomizedConfigurationProvider(ConfigurationFactory configurationFactory)
          Creates new CustomizedConfigurationProvider instance.
 
Method Summary
protected  String getComponentName(Object componentKey)
          Returns human readable name of the component.
 Class getCustomizedComponentImplementation()
          Returns the type of the customized components.
 Object getCustomizedComponentInstance(org.picocontainer.PicoContainer container, Object componentKey, Class componentImplementation)
          Returns a customized component instance.
 void verify(org.picocontainer.PicoContainer container)
          Verifies if the customized component can be instantiated using the dependencies present in the associated container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configurationFactory

private ConfigurationFactory configurationFactory
Constructor Detail

CustomizedConfigurationProvider

public CustomizedConfigurationProvider(ConfigurationFactory configurationFactory)
Creates new CustomizedConfigurationProvider instance.

Parameters:
configurationFactory - the configuration factory.
Method Detail

getCustomizedComponentInstance

public Object getCustomizedComponentInstance(org.picocontainer.PicoContainer container,
                                             Object componentKey,
                                             Class componentImplementation)
                                      throws org.picocontainer.PicoInitializationException,
                                             org.picocontainer.PicoIntrospectionException
Returns a customized component instance.

Specified by:
getCustomizedComponentInstance in interface CustomizedComponentProvider
Parameters:
container - the container.
componentKey - requesting component's key.
componentImplementation - requesting component's implmenetation class.
Returns:
customized component.
Throws:
org.picocontainer.PicoInitializationException - if the customized component cannot be initialized.
org.picocontainer.PicoIntrospectionException - if the customized component cannot be initialized.
UnsupportedKeyTypeException - if the componentKey has unsupported type.

getCustomizedComponentImplementation

public Class getCustomizedComponentImplementation()
Returns the type of the customized components.

Specified by:
getCustomizedComponentImplementation in interface CustomizedComponentProvider
Returns:
the type of the customized components.

verify

public void verify(org.picocontainer.PicoContainer container)
            throws org.picocontainer.PicoVerificationException
Verifies if the customized component can be instantiated using the dependencies present in the associated container.

Specified by:
verify in interface CustomizedComponentProvider
Parameters:
container - the container.
Throws:
org.picocontainer.PicoVerificationException - if the container does not contain required dependencies.

getComponentName

protected String getComponentName(Object componentKey)
                           throws UnsupportedKeyTypeException
Returns human readable name of the component.

Parameters:
componentKey - the component key.
Returns:
human readable name of the component.
Throws:
UnsupportedKeyTypeException - if the component key is of unsupported type.


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