org.hippoecm.hst.site.container
Class SpringComponentManager

java.lang.Object
  extended by org.hippoecm.hst.site.container.SpringComponentManager
All Implemented Interfaces:
ComponentManager

public class SpringComponentManager
extends Object
implements ComponentManager

SpringComponentManager

Version:
$Id: SpringComponentManager.java 35453 2012-07-28 22:31:37Z wko $

Field Summary
protected  org.springframework.context.support.AbstractRefreshableConfigApplicationContext applicationContext
           
static String BEAN_REGISTER_CONDITION
           
protected  org.apache.commons.configuration.Configuration configuration
           
protected  String[] configurationResources
           
protected  ContainerConfiguration containerConfiguration
           
static String IGNORE_UNRESOLVABLE_PLACE_HOLDERS
           
static String SYSTEM_PROPERTIES_MODE
           
 
Constructor Summary
SpringComponentManager()
           
SpringComponentManager(org.apache.commons.configuration.Configuration configuration)
           
 
Method Summary
 void close()
          Closes the component manager and all the components.
<T> T
getComponent(String name)
          Returns the registered container component by name.
<T> T
getComponent(String name, String... addonModuleNames)
          Returns the registered component from a child context.
<T> Map<String,T>
getComponentsOfType(Class<T> requiredType)
          Returns the registered container components that match the given object type (including subclasses).
<T> Map<String,T>
getComponentsOfType(Class<T> requiredType, String... addonModuleNames)
          Returns the registered container component that match the given object type (including subclasses) from a child context.
 String[] getConfigurationResources()
          Returns configuration resources for components assembly
 ContainerConfiguration getContainerConfiguration()
          Returns the container configuration
 void initialize()
          Initializes the component manager and container components.
 void setAddonModuleDefinitions(List<ModuleDefinition> addonModuleDefinitions)
           
 void setConfigurationResources(String[] configurationResources)
          Sets configuration resources for components assembly
 void start()
          Starts the component manager to serve container components.
 void stop()
          Stop the component manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IGNORE_UNRESOLVABLE_PLACE_HOLDERS

public static final String IGNORE_UNRESOLVABLE_PLACE_HOLDERS

SYSTEM_PROPERTIES_MODE

public static final String SYSTEM_PROPERTIES_MODE

BEAN_REGISTER_CONDITION

public static final String BEAN_REGISTER_CONDITION

applicationContext

protected org.springframework.context.support.AbstractRefreshableConfigApplicationContext applicationContext

configuration

protected org.apache.commons.configuration.Configuration configuration

containerConfiguration

protected ContainerConfiguration containerConfiguration

configurationResources

protected String[] configurationResources
Constructor Detail

SpringComponentManager

public SpringComponentManager()

SpringComponentManager

public SpringComponentManager(org.apache.commons.configuration.Configuration configuration)
Method Detail

initialize

public void initialize()
Description copied from interface: ComponentManager
Initializes the component manager and container components.

Specified by:
initialize in interface ComponentManager

start

public void start()
Description copied from interface: ComponentManager
Starts the component manager to serve container components.

Specified by:
start in interface ComponentManager

stop

public void stop()
Description copied from interface: ComponentManager
Stop the component manager.

Specified by:
stop in interface ComponentManager

close

public void close()
Description copied from interface: ComponentManager
Closes the component manager and all the components.

Specified by:
close in interface ComponentManager

getComponent

public <T> T getComponent(String name)
Description copied from interface: ComponentManager
Returns the registered container component by name. Returns null if a component is not found by the specified name.

Specified by:
getComponent in interface ComponentManager
Type Parameters:
T - component type
Parameters:
name - the name of the component
Returns:
component

getComponent

public <T> T getComponent(String name,
                          String... addonModuleNames)
Description copied from interface: ComponentManager
Returns the registered component from a child context. If addonModuleNames consists of multiple items, then each addonModuleNames item is regarded as child addon module name in the descendant hierarchy, as ordered. Returns null if a component is not found by the specified name.

Specified by:
getComponent in interface ComponentManager
Returns:

getComponentsOfType

public <T> Map<String,T> getComponentsOfType(Class<T> requiredType)
Description copied from interface: ComponentManager
Returns the registered container components that match the given object type (including subclasses). Returns empty map if a component is not found by the specified required type.

Specified by:
getComponentsOfType in interface ComponentManager
Type Parameters:
T - component type
Parameters:
requiredType - the required type of the component
Returns:
component map

getComponentsOfType

public <T> Map<String,T> getComponentsOfType(Class<T> requiredType,
                                             String... addonModuleNames)
Description copied from interface: ComponentManager
Returns the registered container component that match the given object type (including subclasses) from a child context. Returns empty map if a component is not found from a child context by the specified required type. If addonModuleNames consists of multiple items, then each addonModuleNames item is regarded as child addon module name in the descendant hierarchy, as ordered. Returns empty map if a component is not found by the specified type.

Specified by:
getComponentsOfType in interface ComponentManager
Returns:
component map

getContainerConfiguration

public ContainerConfiguration getContainerConfiguration()
Description copied from interface: ComponentManager
Returns the container configuration

Specified by:
getContainerConfiguration in interface ComponentManager
Returns:

getConfigurationResources

public String[] getConfigurationResources()
Description copied from interface: ComponentManager
Returns configuration resources for components assembly

Specified by:
getConfigurationResources in interface ComponentManager

setConfigurationResources

public void setConfigurationResources(String[] configurationResources)
Description copied from interface: ComponentManager
Sets configuration resources for components assembly

Specified by:
setConfigurationResources in interface ComponentManager

setAddonModuleDefinitions

public void setAddonModuleDefinitions(List<ModuleDefinition> addonModuleDefinitions)


Copyright © 2008-2012 Hippo. All Rights Reserved.