Farr, Aaron wrote:

[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?


Everything exception the inclusion of <extension/> inside an entry is in place. There are demonstration of this in the tutorial somewhere.



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>


Eveything is in place for the above. In your example the InitialContextFactory class must have a zero argument constructor (or you wouold need to include some more nested <param> statements.


In your example you should change you <parameter> to <param>.

Steve.

--

Stephen J. McConnell
mailto:[EMAIL PROTECTED]
http://www.osm.net

Sent via James running under Merlin as an NT service.
http://avalon.apache.org/sandbox/merlin




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



Reply via email to