RE: [Barracuda-commit] CVS Update: Barracuda

"Christian Cryder" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Jake!

(Once again, I'm going to move this conversation back to the Barracuda list,
just because I think people will benefit from it.)

Ok, I need to take the time here to understand exactly what your change does
here, so be patient with me if I'm a little slow on the uptake ;-)

I read your description of what you did, but I'm still a bit confused...

> concept of a "delegate runtime value". What this means is that
> the value of the parameter to be set is a runtime object rather
> than something that can be provided as a literal value in the
> configuration file. Currently, the only supported delegate

Do you mean by this that all you are doing is invoking a method on an
object? (rather than setting a static variable?)

Looking at your example in the Barracuda event-gateway.xml file, I see this:

    <dom-loader
factory="org.enhydra.barracuda.core.util.dom.XMLCDeferredParsingDOMFactory">
        <set-property name="servletContext" delegateRuntimeValue="true" />
    </dom-loader>

What exactly is this doing (ie. in terms of psuedo-code)? I'm guessing it
involves instantiating the XMLCDeferredParsingDOMFactory and then calling
setServletContext() on it, but I'm probably wrong about some of the
specifics.

To step back a level, what is the high level objective of this? It looks
like you are trying to
a) specify a pluggable implementation of the DOMLoader
b) make it possible for that DOMLoader to get a reference to the servlet
context

Can you confirm/correct my understanding of that? If I understand it
correctly, then I think there may be an easier way to do this, but I'll wait
to hear from you first before commenting further...

Christian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"


> -----Original Message-----
> From: Jacob Kjome [mailto:[email protected]]
> Sent: Wednesday, June 18, 2003 10:37 PM
> To: Christian Cryder
> Subject: Re: [Barracuda-commit] CVS Update: Barracuda
>
>
> Hi Christian,
>
>
>
> Log message:
>         <b>csc_061803.1</b> - Modified ObjectRepositoryAssembler
> to support the setting of
>         Shorts, Longs, Doubles and Floats in addition to the
> String, Boolean, and Integer
>         support that was already there. While I was at it I
> discovered that the previous
>         implementation only supported the setting of primitives,
> so I modified things so that
>         you can set both primitives and their first class counterparts.
>
>
>
> Might we want to add the notion of the "delegate runtime value"
> which I added to the DefaultApplicationAssembler?  Here is my
> comment from A_Changes_History about that....
>
> <quote>
> jrk_20030529.1 - Updated handling of <set-property> and
> <constant> in DefaultApplicationAssembler to recognize the
> concept of a "delegate runtime value". What this means is that
> the value of the parameter to be set is a runtime object rather
> than something that can be provided as a literal value in the
> configuration file. Currently, the only supported delegate
> runtime value is a ServletContext object. The syntax of this new
> configuration option is...
>
>
>    <set-property name="servletContext"
> delegateRuntimeValue="true"/>
>
>
>
> Obviously this assumes that the class this property is to act
> upon have either a public "setServletContext()" method or a
> public "servletContext" field.
>
> Also updated XMLCDeferredParsingDOMFactory to take advantage of
> this feature, the reason being that it needs to read context init
> parameters to provide extra optional information to the
> DeferredParsingFactory which the DeferredParsingDOMFactory backs.
> Also modified it to create the DeferredParsingFactory once
> instead of every time DOMFactory#getInstance() is called. This
> should provide a slight performance improvement.
> </quote>
>
>
> So, this just says "I, the configuration file writer, delegate
> the responsibility of the setting of a runtime object to a method
> that I specify because I cannot possibly script this value in a
> configuration file."
>
> does that make sense?  Of course, only certain specified
> "delegate runtime values" would be supported, but you can look at
> DefaultApplicationAssembler to see how I implemented this for
> methods taking the current runtime ServletContext object.  It
> works perfectly and allowed me to duplicate the web.xml
> configuration functionality of XMLCContext in the
> XMLCDeferredParsingDOMFactory.
>
>
> Jake
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.