[comments below]

> -----Original Message-----
> From: Stephen McConnell [mailto:[EMAIL PROTECTED]
> 
>  * Current status ...
> 
>    The current meta-data format for context entries in Merlin
>    allows two modes of expression
> 
>    (a) import context entries from container space and mapping
>        these to key in component space
>    (b) creation of new context entries based on the composition
>        of primitive values
> 
>    The existing structure looks like:
> 
>      <context>
>        <import key="my-classloader" name="urn:avalon:classloader"/>
>        <entry key="special-key" class="MySpecialClass">
>          <param>Hello World</param>
>        </entry>
>        <entry key="special-key" class="AnotherSpecialClass">
>          <param>MyDualArgConstructorClass<param>
>            <param>Hello World</param>
>            <param class="java.io.File">../lib</param>
>          </param>
>        </entry>
>      </context>
> 
>   It would be preferable to modify this such that the context element
>   is restricted to <entry> tags and that the semantics of the entry
>   are interpreted based on their content.  For example, applying the
>   same example as above we could imagine an equivalent directive:
> 
>      <context>
>        <entry key="my-classloader>
>          <import key="urn:avalon:classloader"/>
>        </entry>
>        <entry key="special-key" class="MySpecialClass">
>          <param>Hello World</param>
>        </entry>
>        <entry key="special-key" class="AnotherSpecialClass">
>          <param>MyDualArgConstructorClass<param>
>            <param>Hello World</param>
>            <param class="java.io.File">../lib</param>
>          </param>
>        </entry>
>      </context>
> 
>   This approach makes is much similar to expand the model to include
>   new semantics.  The following example incorporates the declaration
>   of an extension component that will acting in the role of context
>   provider for a named entry.
> 
>      <context>
>        <entry key="my-classloader>
>          <extension type="org.apache.wizard.SpellBook"/>
>        </entry>
>      </context>
> 
>   This addresses two concerns, firstly, the introduction of a more
>   flexible approach to context provider association, and secondly,
>   ensures that the association is explicit.
> 

Stephen,

How much of this is currently in place?

I want to add similar context declaration features to my DAOManager
(http://jingdao.sf.net) and I may use this same schema since the DAOManager
acts as a lightweight container for the DAO instances.  I could work out
some of the ideas over there before they end up in merlin (or the other way
around).

Specifically, I'm also looking at something like:

<context>
   <entry key="my-datasource">
     <import type="jndi" key="datasource">
             <parameter name="java.naming.factory.initial"
                        value="org.my.InitialContextFactory "/>
             <parameter name="java.naming.provider.url"
                     value="altrmi://localhost:1099"/>
     <import/>
   </entry>
</context>

I'm also trying to figure out a nice way to map a ServletContext into this
as well.  The thing is in a servlet environment the context is much more
dynamic and I'm not sure if I want to require users to declare every entry
the DAO's may require.  It might be easier to just map the entire servlet
context (or JNDI context) into the DAO/Avalon context.

jaaron

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to