info.magnolia.objectfactory
Class DefaultComponentProvider

java.lang.Object
  extended by info.magnolia.objectfactory.DefaultComponentProvider
All Implemented Interfaces:
ComponentProvider

Deprecated. since 4.5, use IoC, i.e another implementation of ComponentProvider.

public class DefaultComponentProvider
extends Object
implements ComponentProvider

This ComponentProvider is using the configuration provided by SystemProperty. 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.

Version:
$Id$

Constructor Summary
DefaultComponentProvider(MagnoliaConfigurationProperties mappings)
          Deprecated.  
DefaultComponentProvider(Properties mappings)
          Deprecated.  
 
Method Summary
 void clear()
          Deprecated. Used only in tests.
<T> T
getComponent(Class<T> type)
          Deprecated. Returns the component mapped for a given type.
<C> Class<? extends C>
getImplementation(Class<C> type)
          Deprecated. Returns the implementation type mapped for a given type.
protected  String getImplementationName(Class<?> type)
          Deprecated.  
 ComponentProvider getParent()
          Deprecated.  
<T> T
getSingleton(Class<T> type)
          Deprecated. 
protected  boolean isConcrete(Class<?> clazz)
          Deprecated. since 4.5, use Classes.isConcrete(Class)
<T> T
newInstance(Class<T> type, Object... parameters)
          Deprecated. Creates a new instance of the passed interface / class by using the registered implementation.
<T> T
newInstanceWithParameterResolvers(Class<T> type, ParameterResolver... parameters)
          Deprecated.  
 void setImplementation(Class<?> type, String impl)
          Deprecated. Used only in tests.
 void setInstance(Class<?> type, Object instance)
          Deprecated. Used only in tests.
 void setInstanceFactory(Class<?> type, ComponentFactory<?> factory)
          Deprecated. Used only in tests.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultComponentProvider

public DefaultComponentProvider(MagnoliaConfigurationProperties mappings)
Deprecated. 

DefaultComponentProvider

public DefaultComponentProvider(Properties mappings)
Deprecated. 
Method Detail

getSingleton

@Deprecated
public <T> T getSingleton(Class<T> type)
Deprecated. 

Description copied from interface: ComponentProvider
Returns the component mapped for a given type.

Specified by:
getSingleton in interface ComponentProvider
See Also:
ComponentProvider.getComponent(Class)

getComponent

public <T> T getComponent(Class<T> type)
Deprecated. 
Description copied from interface: ComponentProvider
Returns the component mapped for a given type.

Specified by:
getComponent in interface ComponentProvider
Returns:
the component that is mapped for this type or null if there is none

newInstance

public <T> T newInstance(Class<T> type,
                         Object... parameters)
Deprecated. 
Description copied from interface: ComponentProvider
Creates a new instance of the passed interface / class by using the registered implementation. The parameters are used to build the object. Most likely they are passed to the constructor. If this fails a MgnlInstantiationException is thrown.

Specified by:
newInstance in interface ComponentProvider

newInstanceWithParameterResolvers

public <T> T newInstanceWithParameterResolvers(Class<T> type,
                                               ParameterResolver... parameters)
Deprecated. 
Specified by:
newInstanceWithParameterResolvers in interface ComponentProvider

isConcrete

protected boolean isConcrete(Class<?> clazz)
Deprecated. since 4.5, use Classes.isConcrete(Class)


getImplementation

public <C> Class<? extends C> getImplementation(Class<C> type)
                                     throws ClassNotFoundException
Deprecated. 
Description copied from interface: ComponentProvider
Returns the implementation type mapped for a given type. This is primarily used by Content2Bean.

Specified by:
getImplementation in interface ComponentProvider
Throws:
ClassNotFoundException - in case there's no implementation for the provided type

getImplementationName

protected String getImplementationName(Class<?> type)
Deprecated. 

getParent

public ComponentProvider getParent()
Deprecated. 
Specified by:
getParent in interface ComponentProvider

setImplementation

public void setImplementation(Class<?> type,
                              String impl)
Deprecated. 
Used only in tests.

See Also:
info.magnolia.test.ComponentsTestUtil}

setInstance

public void setInstance(Class<?> type,
                        Object instance)
Deprecated. 
Used only in tests.

See Also:
info.magnolia.test.ComponentsTestUtil}

setInstanceFactory

public void setInstanceFactory(Class<?> type,
                               ComponentFactory<?> factory)
Deprecated. 
Used only in tests.

See Also:
info.magnolia.test.ComponentsTestUtil}

clear

public void clear()
Deprecated. 
Used only in tests. Warning: this does NOT clear the *mappings*. With the current/default implementation, this means tests also have to call SystemProperty.clearr()

See Also:
info.magnolia.test.ComponentsTestUtil}


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