>
Hi,
In addition to trying to simplify the Runtime initialization API, I would
also try to make the standard velocity properties and little more
meaningful, and easier to work with. In particular I would like
to deal with the way resource loaders are specified.
Right now we have a bit of a hack where we have a
loop that goes from 1 to 10 which attempts to initialize
a resource loader based on a numbering scheme. I would
like to change it so that you strictly specify resource loaders
you want to use by name, and then use that name to specify
additional properties for the resource loader.
This is what I had in mind:
# Specify the resource loaders you wish to use. If you
# are debugging resource loaders, simply comment out
# the line for a resource loader to prevent its use in the
# Runtime. The search order to find a resource is
# the order you list your resource loaders here. If you
# wish to change the search order, simply move the
# lines around to suit your situation.
resource.loader = file
resource.loader = classpath
# Configuration for the 'file' resource loader
file.resource.loader.class = o.a.v.r.r.l.FileResourceLoader
file.resource.loader.description = File Resource Loader
file.resource.loader.cache = true
file.resource.loader.modificationIntervalCheck = 2
file.resource.loader.path = path1
file.resource.loader.path = path2
# Configuration for the 'classpath' resource loader
classpath.resource.loader.class = o.a.v.r.r.l.ClasspathResourceLoader
classpath.resource.loader.description = Classpath Resource Loader
classpath.resource.loader.cache = true
This makes it very simple to turn on/off resource loaders because you
only have to comment out single lines and you don't have to touch the
configuration for the resource loader itself. And you specify the loaders
you want which is more clear and the action inside the runtime to
be taken is specific. Above it is clear that we want to load the the
configuration for the resource loaders for the names 'file' and
'classpath'.
I think this also makes the configuration much easier to work with
and makes them more readable. And this allows a determined path
of execution in the Runtime WRT which resource loaders are going
to be used. It would no longer be cycling through a list of numbers
trying to process loaders, but using a specific list.
The work needed to be done could be done in conjuction with
the previous proposal.
Any thoughts?
--
jvz.
Jason van Zyl
[EMAIL PROTECTED]
http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine