commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Kitching" <si...@ecnetwork.co.nz>
Subject Digester: user(ish) question: how to support plugin classes [dynamic rules]
Date Fri, 17 May 2002 06:09:15 GMT
Hi All,
 
I would like to use digester in a framework where I have "plug-in"
classes;  something like ant's optional tasks..
 
Example:
  <top-level>
     <fixed-tag foo="foo">
        <fixed-subtag bar="bar"/>
     </fixed-tag>
 
     <plugin class="com.acme.plugin1">
       <tag-for-plugin1 baz="baz">
     </plugin>
 
     <plugin class="com.acme.plugin2">
       <tag-for-plugin2 yah="yah">
    </plugin>
  </top-level>
 
In this example, any value can be put in the "class" attribute of the
<plugin> tag, and it is this
class that determines the rules for processing any nested tags within
the <plugin> tag. The 
first bit is just plain ObjectCreateRule or FactoryCreateRule stuff, but
the second bit I can't
see any obvious solutions for in digester..
 
I would like plugins to be enabled just by installing one or more new
files and modifying the
configuration file to then *use* the new class. 
 
The xmlrules module is not enough, as the "installer" of the plugin
would need to modify the 
master xmlrules config file; even the <include> feature doesn't remove
this need (though it
does make things more modular hence _easier_ to change).
 
Some kind of xmlrules tag <include plugin-dir="dirname"> might do the
trick; I have been
working on this a bit. I have also been experimenting with requiring the
plugin class to 
define a "void addRules(Digester digester)" method that gets invoked to
add any necessary
rules to the digester. I have this running, but it gets messy trying to
avoid possible tag
name collision.
 
If anyone out there has done this, or tried to do this, I would
appreciate hearing about it
(on this list or directly, as you think appropriate).
 
Thanks,
 
Simon
 
PS: DynaBean: is this implementing dynamically-typed language features
(ruby, perl, etc) in java?
[http://marc.theaimsgroup.com/?l=jakarta-commons-dev
<http://marc.theaimsgroup.com/?l=jakarta-commons-dev&m=100847374827535&w
=2> &m=100847374827535&w=2]

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message