public interface ComponentManager
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the component manager and all the components.
|
<T> T |
getComponent(Class<T> requiredType)
Returns the registered container component by the specified type if any.
|
<T> T |
getComponent(Class<T> requiredType,
String... addonModuleNames)
Returns the registered component from a child context by the specified type.
|
<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
|
javax.servlet.ServletConfig |
getServletConfig()
Deprecated.
deprecated since since 3.2.0 : ServletConfig cannot be available when HST container loaded by a listener.
|
javax.servlet.ServletContext |
getServletContext() |
void |
initialize()
Initializes the component manager and container components.
|
void |
publishEvent(EventObject event)
Publish the given event to all components which wants to listen to.
|
void |
registerEventSubscriber(Object subscriber)
Registers event subscriber object to receive events.
|
void |
setConfigurationResources(String[] configurationResources)
Sets configuration resources for components assembly
|
void |
setServletConfig(javax.servlet.ServletConfig servletConfig)
Deprecated.
deprecated since since 3.2.0 : ServletConfig cannot be available when HST container loaded by a listener.
|
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.
|
void |
unregisterEventSubscriber(Object subscriber)
Unregisters event subscriber object.
|
void setConfigurationResources(String[] configurationResources)
configurationResources
- String[] getConfigurationResources()
@Deprecated void setServletConfig(javax.servlet.ServletConfig servletConfig)
servletConfig
- @Deprecated javax.servlet.ServletConfig getServletConfig()
void setServletContext(javax.servlet.ServletContext servletContext)
servletContext
- javax.servlet.ServletContext getServletContext()
void initialize()
void start()
<T> T getComponent(String name)
T
- component typename
- the name of the component<T> T getComponent(Class<T> requiredType) throws ComponentsException
ComponentsException
.requiredType
- type the bean must match; can be an interface or superclass.ComponentsException
<T> Map<String,T> getComponentsOfType(Class<T> requiredType)
T
- component typerequiredType
- the required type of the component<T> T getComponent(String name, String... addonModuleNames)
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.T
- name
- addonModuleNames
- ModuleNotFoundException
- thrown when module is not found by the addonModuleNames<T> T getComponent(Class<T> requiredType, String... addonModuleNames) throws ComponentsException
ComponentsException
.
If addonModuleNames
consists of multiple items, then
each addonModuleNames
item is regarded as child addon module name
in the descendant hierarchy, as ordered.requiredType
- type the bean must match; can be an interface or superclass.addonModuleNames
- ComponentsException
<T> Map<String,T> getComponentsOfType(Class<T> requiredType, String... addonModuleNames)
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.T
- requiredType
- addonModuleNames
- ModuleNotFoundException
- thrown when module is not found by the addonModuleNamesvoid publishEvent(EventObject event)
event
- the event to publish (may be an application-specific or built-in HST-2 event)void registerEventSubscriber(Object subscriber)
subscriber
- void unregisterEventSubscriber(Object subscriber)
subscriber
- void stop()
void close()
ContainerConfiguration getContainerConfiguration()
Copyright © 2008–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.