james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norman Maurer <nor...@apache.org>
Subject [PROPOSAL] Remove mailetpackages configuration directive
Date Fri, 17 Dec 2010 07:13:28 GMT
Hi there,

I know many proposal this week but its time to "break" stuff now ;)

I would like to propose that we remove the "mailetpackages" and
"matcherpackages" configuration option from the mailetcontainer.xml
file. This would force the users to use the full classname ( with
package) on every matcher/mailet configuration.

So something like this:

<mailet match="org.apache.james.transport.matchers.All"
class="org.apache.james.transport.mailets.ToProcessor">


I think how we do it at the moment just is an ugly hack and give use
not really anything back (except that we don't need to write the
packagename everytime). Its also error-phrone as its possible that two
packages contain the same classname. As mailets and matchers are
pluggable by the users/dev this could happen really easy. Also the
implementation is just a hack (IMHO).

Just a snipped:

            for (final String packageName:packages) {
                final String className = packageName + mailetName;
                try {
                    final Mailet mailet =
(Mailet)factory.newInstance(Thread.currentThread().getContextClassLoader().loadClass(className));

                    final MailetConfigImpl configImpl = new MailetConfigImpl();
                    configImpl.setMailetName(mailetName);
                    configImpl.setConfiguration(configuration);
                    configImpl.setMailetContext(mailetContext);
                    mailet.init(configImpl);

                    return mailet;
                } catch (ClassNotFoundException cnfe) {
                    //do this so we loop through all the packages
                }
            }

I know the change is somewhat heavy but I think if we want todo it now
is the time before a final 3.0 will get cut.

Wdyt ?
Norman

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message