public class DefaultContainer extends AbstractContainer implements org.apache.avalon.framework.configuration.Configurable
Container,
adding configuration markup semantics to the AbstractContainer.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
m_defaultActivationPolicy
Default activation policy for components, ie.
|
DEFAULT_ENTRY, m_classLoader, m_commandSink, m_componentContext, m_components, m_context, m_extManager, m_instrumentManager, m_loggerManager, m_mapper, m_metaManager, m_poolManager, m_serviceManager, m_shutDownOrder, SELECTOR_ENTRY| Constructor and Description |
|---|
DefaultContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration config)
Process the configuration and set up the components and their
mappings.
|
private int |
getActivation(org.apache.avalon.framework.configuration.Configuration component)
Helper method to determine the activation policy for a given component
handler configuration.
|
private java.lang.String |
getClassname(org.apache.avalon.framework.configuration.Configuration config)
Retrieve the classname for component configuration.
|
private java.lang.String |
getDefaultActivationPolicy(org.apache.avalon.framework.configuration.Configuration config)
Obtains the default activation policy from the component configuration header
|
org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
Return the ServiceManager that exposes all the services in impl.
|
protected void |
interpretProxy(java.lang.String proxyType)
Interpret the ProxyManager type from the configuration element.
|
addComponent, contextualize, createHintMap, createObjectFactory, dispose, get, getProxyManager, getRoleKey, has, initialize, provideComponentContext, provideServiceManager, service, setProxyManagerprivate java.lang.String m_defaultActivationPolicy
public void configure(org.apache.avalon.framework.configuration.Configuration config)
throws org.apache.avalon.framework.configuration.ConfigurationException
Process the configuration and set up the components and their mappings. At this point, all components are prepared and all mappings are made. However, nothing is initialized.
The configuration format follows a specific convention:
Container's
MetaInfoManager or RoleManager
<component> configuration elements
may be used. These elements specify implementation class directly
via the class attribute.
Please note: each configuration element must have a unique id. If a configuration element does not have a unique id, it will not be treated as a component. This id is used later as a hint when there is more than one implementation of a role.
The first component encourted which implements a specific role becomes
the default implemenation of that role. This can be changed by the
default attribute in this configuration.
<my-config>
<component id="default-connection"
class="org.apache.avalon.excalibur.datasource.JdbcDataSourceComponent">
<!-- Component specific configuration -->
</component>
<jdbc-data-source id="another-connection">
<!-- Component specific configuration -->
</jdbc-data-source>
</my-config>
configure in interface org.apache.avalon.framework.configuration.Configurableconfig - The configuration element to translate into the
list of components this impl managers.org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is not validprivate java.lang.String getDefaultActivationPolicy(org.apache.avalon.framework.configuration.Configuration config)
config - Configuration to examineprotected void interpretProxy(java.lang.String proxyType)
throws org.apache.avalon.framework.configuration.ConfigurationException
proxyType - org.apache.avalon.framework.configuration.ConfigurationExceptionprivate java.lang.String getClassname(org.apache.avalon.framework.configuration.Configuration config)
throws org.apache.avalon.framework.configuration.ConfigurationException
config - the component configurationorg.apache.avalon.framework.configuration.ConfigurationExceptionprivate int getActivation(org.apache.avalon.framework.configuration.Configuration component)
throws org.apache.avalon.framework.configuration.ConfigurationException
component - Configurationorg.apache.avalon.framework.configuration.ConfigurationException - if the handler specifies an unknown
activation policypublic org.apache.avalon.framework.service.ServiceManager getServiceManager()
getServiceManager in class AbstractContainer