info.magnolia.objectfactory
Class Components

java.lang.Object
  extended by info.magnolia.objectfactory.Components

public class Components
extends Object

Static access utility for the currently set ComponentProvider. The current ComponentProvider is set during start-up and there should be little reason to change it at runtime. Since Magnolia 4.5, you are encouraged to use IoC, only in rare cases should you need to directly use this class.

Version:
$Id$
See Also:
ComponentProvider

Constructor Summary
Components()
           
 
Method Summary
static
<T> T
getComponent(Class<T> type)
          Returns a component from the currently set ComponentProvider.
static ComponentProvider getComponentProvider()
          Returns the currently set ComponentProvider.
static
<T> T
getSingleton(Class<T> type)
          Deprecated. since 4.5, use IoC to inject the component or use #getComponent(Class).
static
<T> T
newInstance(Class<T> type, Object... parameters)
           
static void setComponentProvider(ComponentProvider provider)
          Sets the current ComponentProvider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Components

public Components()
Method Detail

setComponentProvider

public static void setComponentProvider(ComponentProvider provider)
Sets the current ComponentProvider.


getComponentProvider

public static ComponentProvider getComponentProvider()
Returns the currently set ComponentProvider.


getSingleton

public static <T> T getSingleton(Class<T> type)
Deprecated. since 4.5, use IoC to inject the component or use #getComponent(Class).

Returns a component from the currently set ComponentProvider.

See Also:
ComponentProvider.getComponent(Class)

newInstance

public static <T> T newInstance(Class<T> type,
                                Object... parameters)

getComponent

public static <T> T getComponent(Class<T> type)
Returns a component from the currently set ComponentProvider. Consider using IoC to inject the component instead.



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