Unfortunately, my current "platform" is Weblogic 6.1. So, not only am I
stuck using Java 1.3, but also a pre-2.4 servlet engine. Therefore servlet
filters and servlet listeners are not viable :(

What I *think* I'd like to do is something like this:

    <service-point id="ConnectionProxy">
        <invoke-factory model="threaded">
            <construct class="MyConnectionProxy"/>
        </invoke-factory>
    </service-point>

then...

    <service-point id="SomeDAO" >
        <construct class="com.foo.SomeDAOImpl">
            <set-service id="ConnectionProxy" property="connection" />
        </construct>
     </service>

But I'm not sure how to "wire" all this up... By the way, I found this
example in the "Injecting registry services to POJOs" thread.**

RMC

On 12/12/05, Bryan Lewis <[EMAIL PROTECTED]> wrote:
>
> I'm dealing with some of the same questions and I'm also feeling
> somewhat under-enlightened by the answers I've gotten, even though I'm
> sure they'll make great sense some day.  So the following answer might
> not be the best practice.
>
> I moved my setupForRequest() code to a requestInitialized() method in my
> custom Engine. It gets called at the beginning of each request because I
> registered my Engine class as a ServletRequestListener.
>
> In web.xml:
>
>     <listener>
>         <listener-class>package.path.Engine</listener-class>
>     </listener>
>
> In Engine.java:
>
>     public class Engine extends AbstractEngine
>                         implements ... ServletRequestListener
>     {
>         ....
>         public void requestInitialized(ServletRequestEvent sre) ...
>
>
>
> Ralph Churchill wrote:
>
> >In Tapestry3, I overrode BaseEngine's setupForRequest to retrieve a
> >DataSource from JNDI, open a Connection from it and make the Connection
> >accessible via static methods to my DAO classes. I closed Connection via
> >overriding BaseEngine's cleanupAfterRequest. I'm doing straight JDBC --
> no
> >Hibernate, Spring, etc.
> >
> >This simple scheme has worked very well so far.
> >
> >I'm looking for an equivalent in Tapestry4. I have seen this sort of
> >question posed numerous times, but not sufficiently answered. I'm
> wondering,
> >what is the best way to implement functionality similar to this? I have
> some
> >ideas: using RequestGlobals, injecting a service with a "request" or
> >"thread" scope, etc.
> >
> >Please note: for my configuration, a servlet filter is not a viable
> option.
> >Thanks.
> >
> >RMC
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to