|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.fortress.impl.AbstractContainer
org.apache.avalon.fortress.impl.DefaultContainer
public class DefaultContainer
This is the default implementation of Container
,
adding configuration markup semantics to the AbstractContainer
.
Field Summary | |
---|---|
private java.lang.String |
m_defaultActivationPolicy
Default activation policy for components, ie. |
Fields inherited from class org.apache.avalon.fortress.impl.AbstractContainer |
---|
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 |
Fields inherited from interface org.apache.avalon.fortress.Container |
---|
ROLE |
Constructor Summary | |
---|---|
DefaultContainer()
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.avalon.fortress.impl.AbstractContainer |
---|
addComponent, contextualize, createHintMap, createObjectFactory, dispose, get, getProxyManager, getRoleKey, has, initialize, provideComponentContext, provideServiceManager, service, setProxyManager |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String m_defaultActivationPolicy
Constructor Detail |
---|
public DefaultContainer()
Method Detail |
---|
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.Configurable
config
- 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 examine
protected void interpretProxy(java.lang.String proxyType) throws org.apache.avalon.framework.configuration.ConfigurationException
proxyType
-
org.apache.avalon.framework.configuration.ConfigurationException
private java.lang.String getClassname(org.apache.avalon.framework.configuration.Configuration config) throws org.apache.avalon.framework.configuration.ConfigurationException
config
- the component configuration
org.apache.avalon.framework.configuration.ConfigurationException
private int getActivation(org.apache.avalon.framework.configuration.Configuration component) throws org.apache.avalon.framework.configuration.ConfigurationException
component
- Configuration
org.apache.avalon.framework.configuration.ConfigurationException
- if the handler specifies an unknown
activation policypublic org.apache.avalon.framework.service.ServiceManager getServiceManager()
getServiceManager
in class AbstractContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |