There are various proposals for changing the Mailet Configuration. A few are summarized here to make it easier to discuss them.


Proposal #1

Moves matchers into their own elements. Parameters are named strings. This is a change from v2 both for matchers and mailets.

<mailet .............>
        <matcher class="...">
                <condition>...</condition>
                <parameters>            
                        <parameter name="..."></parameter>
                        <parameter name="..."></parameter>
                </parameters>
        </matcher>
        <matcher class="...">
                <condition>...</condition>
                <parameters>
                        <parameter name="..."></parameter>
                        <parameter name="..."></parameter>
                </parameters>
        </matcher>
        <parameters>
                <parameter name="..."></parameter>
                <parameter name="..."></parameter>
        </parameters>
</mailet>


Proposal #2

Full support for XML configuration. Supports both simple and complex XML representations.

<processor name="root"
   xmlns='http://james.apache.org/config/' 
   xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
   xsi:schemaLocation='http://james.apache.org/config/ james-config.xsd' 
   xmlns:nvp="http://james.apache.org/config/NameValuePairs/"> 

     <config-parsers> 
         <parser namespace="http://james.apache.org/config/NameValuePairs" 
                 class="NameValuePairConfigParser"/> 
         <parser namespace="http://mydomain.org/mycustomconfig"  
                 class="MyCustomConfigParser"/> 
     </config-parsers> 

     <!-- In the simplest case, name value pairs would be used for configuration 
         of both matchers and mailets. 
      --> 
     <mailet class="Whatever"> 
         <matcher class="UserIs"> 
             <config> 
                 <nvp:param name="p1" value="x"/> 
                 <nvp:param name="p2" value="y"/> 
             </config> 
         </matcher> 
         <config> 
             <nvp:param name="p1" value="x"/> 
             <nvp:param name="p2" value="y"/> 
         </config> 
     </mailet> 

     <!-- In more complex cases, arbitrary XML from another namespace is used --> 
     <mailet class="Whatever"> 
         <matcher class="UserIs"> 
             <config> 
                 <nvp:param name="p1" value="x"/> 
                 <nvp:param name="p2" value="y"/> 
             </config> 
         </matcher> 
         <config xmlns:mycfg="http://mydomain.org/mycustomconfig"> 
             <mycfg:foo> 
                 <mycfg:bar attr="value"/> 
             </mycfg:foo> 
         </config> 
     </mailet> 
</processor>


Proposal #3

Parameters are named by the element, not a name attribute.

<mailet class="Foo">
        <config>
                <name type="String">Kenny</name>
                <something type="int">3</something>
        </config>
</mailet>


JamesV3/MailetConfiguration (last edited 2010-11-18 16:31:30 by ChanochWiggers)