|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.objectfactory.DefaultComponentProvider
public class DefaultComponentProvider
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.
Method Summary | ||
---|---|---|
void |
clear()
Used only in tests. |
|
|
getImplementation(java.lang.Class<C> type)
|
|
protected java.lang.String |
getImplementationName(java.lang.Class<?> type)
|
|
|
getSingleton(java.lang.Class<T> type)
|
|
protected boolean |
isConcrete(java.lang.Class<?> clazz)
|
|
|
newInstance(java.lang.Class<T> type)
Creates a new instance of the passed interface / class by using the registered implementation. |
|
void |
setImplementation(java.lang.Class<?> type,
java.lang.String impl)
Used only in tests. |
|
void |
setInstance(java.lang.Class<?> type,
java.lang.Object instance)
Used only in tests. |
|
void |
setInstanceFactory(java.lang.Class<?> type,
ComponentFactory<?> factory)
Used only in tests. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public <T> T getSingleton(java.lang.Class<T> type)
getSingleton
in interface ComponentProvider
public <T> T newInstance(java.lang.Class<T> type)
MgnlInstantiationException
is thrown.
newInstance
in interface ComponentProvider
MgnlInstantiationException
protected boolean isConcrete(java.lang.Class<?> clazz)
public <C> java.lang.Class<? extends C> getImplementation(java.lang.Class<C> type) throws java.lang.ClassNotFoundException
getImplementation
in interface ComponentProvider
java.lang.ClassNotFoundException
protected java.lang.String getImplementationName(java.lang.Class<?> type)
public void setImplementation(java.lang.Class<?> type, java.lang.String impl)
info.magnolia.test.ComponentsTestUtil}
public void setInstance(java.lang.Class<?> type, java.lang.Object instance)
info.magnolia.test.ComponentsTestUtil}
public void setInstanceFactory(java.lang.Class<?> type, ComponentFactory<?> factory)
info.magnolia.test.ComponentsTestUtil}
public void clear()
info.magnolia.test.ComponentsTestUtil}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |