info.magnolia.objectfactory.configuration
Class LegacyComponentsConfigurer

java.lang.Object
  extended by info.magnolia.objectfactory.configuration.LegacyComponentsConfigurer
All Implemented Interfaces:
ComponentConfigurer

public class LegacyComponentsConfigurer
extends Object
implements ComponentConfigurer

This ComponentConfigurer configures components from properties. Each property key is the interface/base-class, and the value is either the implementation-to-use class name, an implementation of ComponentFactory which is used to instantiate the desired implementation, or the path to a node in the repository (in the form of repository:/path/to/node or /path/to/node, which defaults to the config repository). In the latter case, the component is constructed via ObservedComponentFactory and reflects (through observation) the contents of the given path.

This behaviour exists for backwards compatibility reasons, prefer configuring your components in a module descriptor instead, inside a components tag.

In order to remain backwards compatible implementations are added both as type mappings and as components and then always scoped as lazy singletons.

Version:
$Id$

Field Summary
protected static String[] EXCLUDED_BY_DEFAULT
           
static String EXCLUDED_KEYS_PROPERTY
           
 
Constructor Summary
LegacyComponentsConfigurer()
           
 
Method Summary
protected
<T> void
addComponent(ComponentProviderConfiguration componentProviderConfiguration, String key, String value)
           
protected  Class<?> classForName(String value)
           
 void doWithConfiguration(ComponentProvider parentComponentProvider, ComponentProviderConfiguration configuration)
           
protected
<T> ProviderConfiguration<T>
getComponentFactory(Class<T> type, Class<? extends ComponentFactory<T>> factoryClass)
           
protected
<T> ImplementationConfiguration
getImplementation(Class<T> type, Class<? extends T> implementation)
           
protected
<T> ConfiguredComponentConfiguration<T>
getObserved(Class<T> type, String workspaceAndPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCLUDED_KEYS_PROPERTY

public static final String EXCLUDED_KEYS_PROPERTY
See Also:
Constant Field Values

EXCLUDED_BY_DEFAULT

protected static final String[] EXCLUDED_BY_DEFAULT
Constructor Detail

LegacyComponentsConfigurer

public LegacyComponentsConfigurer()
Method Detail

doWithConfiguration

public void doWithConfiguration(ComponentProvider parentComponentProvider,
                                ComponentProviderConfiguration configuration)
Specified by:
doWithConfiguration in interface ComponentConfigurer

addComponent

protected <T> void addComponent(ComponentProviderConfiguration componentProviderConfiguration,
                                String key,
                                String value)

getImplementation

protected <T> ImplementationConfiguration getImplementation(Class<T> type,
                                                            Class<? extends T> implementation)

getComponentFactory

protected <T> ProviderConfiguration<T> getComponentFactory(Class<T> type,
                                                           Class<? extends ComponentFactory<T>> factoryClass)

getObserved

protected <T> ConfiguredComponentConfiguration<T> getObserved(Class<T> type,
                                                              String workspaceAndPath)

classForName

protected Class<?> classForName(String value)


Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.