| java.lang.Object org.jicarilla.container.DefaultContainer
All known Subclasses: org.jicarilla.container.integration.pico.JicarillaBasedPicoContainer, org.jicarilla.container.integration.spring.JicarillaBasedSpringFactory, org.jicarilla.container.integration.avalon.JicarillaBasedFortressContainer, org.jicarilla.container.DefaultKeyRelayingContainer,
DefaultContainer | public class DefaultContainer implements Container(Code) | | A straightforward implementation of the
Container interface that
is backed by a
Switch . This implementation is not threadsafe, and
will use a
SelectorSwitch and a
DefaultResolver if no
alternatives are provided.
You will normally not want to use this implementation directly, as the
DefaultKeyRelayingContainer provides commonly needed additional
functionality.
author: Leo Simons version: $Id: DefaultContainer.java,v 1.12 2004/03/23 14:34:48 lsimons Exp $ |
Inner Class :protected class DefaultResolverCallback implements ResolverCallback | |
m_instanceToAdapterMap | protected Map m_instanceToAdapterMap(Code) | | A reverse mapping that's used to implement release() .
|
m_resolver | protected Resolver m_resolver(Code) | | The main client interface into the container.
|
m_switch | protected Switch m_switch(Code) | | The core of the container that maps keys to adapters.
|
DefaultContainer | public DefaultContainer(Resolver resolver)(Code) | | Create a new instance using a
SelectorSwitch and the provided
resolver as the backend. Providing a resolver yourself is quite an
advanced construct and may lead to improper or unexpected behaviour if
the resolver does not adhere to the expected contracts. In particular,
the resolver is expected to defer back to the container or its internal
Switch for most funcitonality.
Parameters: resolver - |
DefaultContainer | public DefaultContainer(Resolver resolver, Switch switcher)(Code) | | Create a new instance using the provided resolver and switch as the
backend. Providing these yourself is quite an advanced construct and may
lead to improper or unexpected results if the resolver does not adhere
to the specified contracts.
Parameters: resolver - Parameters: switcher - |
doAddAdapter | protected void doAddAdapter(Object key, Object adapter)(Code) | | Add a new adapter. If you are providing an
Adapter instance,
use the public
DefaultContainer.registerAdapter(Object,Adapter) instead.
Implements some special handling for some key types (ie classes and some
kinds of strings).
Parameters: key - Parameters: adapter - the new adapter. The m_resolver current resolvershould know how to use this adapter. |
getInstanceToAdapterMap | protected Map getInstanceToAdapterMap()(Code) | | Returns
m_instanceToAdapterMap . Overriding is not recommended.
m_instanceToAdapterMap |
getSwitch | protected Switch getSwitch()(Code) | | Returns
m_switch . Overriding is not recommended.
m_switch |
setInstanceToAdapterMap | protected void setInstanceToAdapterMap(Map instanceToAdapterMap)(Code) | | Sets
m_instanceToAdapterMap . Direct usage is not recommended.
Parameters: instanceToAdapterMap - the new m_instanceToAdapterMapvalue. |
setResolver | protected void setResolver(Resolver resolver)(Code) | | Sets
m_resolver . Direct usage is not recommended.
Parameters: resolver - the new m_resolver value, or null to set it toa new default implementation |
setSwitch | protected void setSwitch(Switch switcher)(Code) | | Sets
m_switch . Direct usage is not recommended.
Parameters: switcher - the new m_switch value, or null to set it toa new default implementation |
|
|