org.hippoecm.hst.component.support
Class ClientComponentManager

java.lang.Object
  extended by org.hippoecm.hst.component.support.ClientComponentManager
All Implemented Interfaces:
ComponentManager, ServletContextAware, org.springframework.beans.factory.config.BeanPostProcessor

public class ClientComponentManager
extends Object
implements ComponentManager, ServletContextAware, org.springframework.beans.factory.config.BeanPostProcessor


Field Summary
protected  org.springframework.context.support.AbstractRefreshableConfigApplicationContext applicationContext
           
protected  org.apache.commons.configuration.Configuration configuration
           
protected  String[] configurationResources
           
static String IGNORE_UNRESOLVABLE_PLACE_HOLDERS
           
protected  javax.servlet.ServletContext servletContext
           
static String SYSTEM_PROPERTIES_MODE
           
 
Constructor Summary
ClientComponentManager()
           
ClientComponentManager(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... contextNames)
          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... contextNames)
          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.
 Object postProcessAfterInitialization(Object bean, String beanName)
           
 Object postProcessBeforeInitialization(Object bean, String beanName)
           
 void setConfigurationResources(String[] configurationResources)
          Sets configuration resources for components assembly
 void setServletContext(javax.servlet.ServletContext servletContext)
          Set the ServletContext that this object runs in.
 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

applicationContext

protected org.springframework.context.support.AbstractRefreshableConfigApplicationContext applicationContext

configurationResources

protected String[] configurationResources

configuration

protected org.apache.commons.configuration.Configuration configuration

servletContext

protected javax.servlet.ServletContext servletContext
Constructor Detail

ClientComponentManager

public ClientComponentManager()

ClientComponentManager

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

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Description copied from interface: ServletContextAware
Set the ServletContext that this object runs in.

Specified by:
setServletContext in interface ServletContextAware

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... contextNames)
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... contextNames)
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

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

getContainerConfiguration

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

Specified by:
getContainerConfiguration in interface ComponentManager
Returns:

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws org.springframework.beans.BeansException
Specified by:
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
Throws:
org.springframework.beans.BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws org.springframework.beans.BeansException
Specified by:
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
Throws:
org.springframework.beans.BeansException


Copyright © 2008-2012 Hippo. All Rights Reserved.