You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Anthony Mutiso 2 <an...@utilitynet.net> on 2002/10/22 21:45:13 UTC

adding a resource loader dynamically

Is there a way to add a resource loader programatically, rather then via the
property configurator.

I want to create a resource loader that supports dynamic runtimestate and
found the that there is no way to pass state to a resources loader after it
has been configured and loaded. The default ResourceManagerImpl does export
an API to access the resource loaders so that I could call an init method on
my new loader to initialize it.

Thanks for the help

Anthony

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: adding a resource loader dynamically

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 10/22/02 3:45 PM, "Anthony Mutiso 2" <an...@utilitynet.net> wrote:

> Is there a way to add a resource loader programatically, rather then via the
> property configurator.

Sure - anything can be added programmatically before calling init().  The
properties configuration is just a convenience for the lazy, a group of
which I am a proud member. :)

> 
> I want to create a resource loader that supports dynamic runtimestate and
> found the that there is no way to pass state to a resources loader after it
> has been configured and loaded. The default ResourceManagerImpl does export
> an API to access the resource loaders so that I could call an init method on
> my new loader to initialize it.

You can just roll or wrap your own loader, and load it at runtime.  Because
we donĀ¹t let you hand a living resource loader (for some reason... Need to
see if we can change that...) to velocity, you can use the application
attribute to pass an object to the loader through which you can communicate
between application level and core level.

See the dev guide.  Remember, v1.3 or newer.

-- 
Geir Magnusson Jr. 
geirm@adeptra.com                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>