You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Haselbach <ch...@tngtech.com> on 2007/08/02 16:27:33 UTC

[T4] Event for every request to clear data

Hello,

currently, we have a bean that is registered for a lot of pages which
holds some information that is only releveant for the scope of the
request. So I thought it woule be more appropriate to make an ASO out of
it with scope request (which does not exist). The reason behind this is
the fact, that this object realy is used for inter-component and
-service communication.

So I thought about making this an ASO with session scope and registering
a service to a listener that fires at the end of a request to clear the
data. So is there something analogous to ResetEventHub? Or am I looking
in the wrong direction here?

Thanks.

Regards,
Christian

-- 
Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Amtsgericht München, HRB 135082

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Event for every request to clear data

Posted by Jesse Kuhnert <jk...@gmail.com>.
Yep, that's exactly how you should do it.

On 8/3/07, Ben Dotte <be...@gmail.com> wrote:
> Yes, a threaded service is created and bound to the current request
> thread the first time it is requested. There is a more detailed
> explanation here:
>
> http://hivemind.apache.org/hivemind1/services.html#Threaded+Service+Model
>
> They also mention on there how to handle cleanup at the end of the
> request with HiveMind's servlet filter and the Discardable interface
> if needed.
>
> On 8/3/07, Christian Haselbach <ch...@tngtech.com> wrote:
> > On Thu, Aug 02, 2007 at 10:12:14AM -0500, Ben Dotte wrote:
> > > Is there any reason you can't use a threaded HiveMind service? That is
> > > usually the approach I take when I have a shared resource that should
> > > only live for the duration of a request.
> >
> > Thanks for the tip. I'm not quite sure if this works as I think.
> > So the request is done in a new thread, the service is created for this
> > thread and is discarded when the request finishes, right?
> >
> > That would work for me, if this is the way things go.
> >
> > Regards,
> > Christian
> >
> > --
> > Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
> > TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> > Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> > Amtsgericht München, HRB 135082
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Event for every request to clear data

Posted by Ben Dotte <be...@gmail.com>.
Ok, yeah actually Tapestry's ApplicationServlet takes care of the
HiveMind filter so nevermind that part:

http://tapestry.apache.org/tapestry4.1/usersguide/hivemind.html#Bootstrapping%20the%20Registry

On 8/3/07, Ben Dotte <be...@gmail.com> wrote:
> Yes, a threaded service is created and bound to the current request
> thread the first time it is requested. There is a more detailed
> explanation here:
>
> http://hivemind.apache.org/hivemind1/services.html#Threaded+Service+Model
>
> They also mention on there how to handle cleanup at the end of the
> request with HiveMind's servlet filter and the Discardable interface
> if needed.
>
> On 8/3/07, Christian Haselbach <ch...@tngtech.com> wrote:
> > On Thu, Aug 02, 2007 at 10:12:14AM -0500, Ben Dotte wrote:
> > > Is there any reason you can't use a threaded HiveMind service? That is
> > > usually the approach I take when I have a shared resource that should
> > > only live for the duration of a request.
> >
> > Thanks for the tip. I'm not quite sure if this works as I think.
> > So the request is done in a new thread, the service is created for this
> > thread and is discarded when the request finishes, right?
> >
> > That would work for me, if this is the way things go.
> >
> > Regards,
> > Christian
> >
> > --
> > Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
> > TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> > Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> > Amtsgericht München, HRB 135082
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Event for every request to clear data

Posted by Ben Dotte <be...@gmail.com>.
Yes, a threaded service is created and bound to the current request
thread the first time it is requested. There is a more detailed
explanation here:

http://hivemind.apache.org/hivemind1/services.html#Threaded+Service+Model

They also mention on there how to handle cleanup at the end of the
request with HiveMind's servlet filter and the Discardable interface
if needed.

On 8/3/07, Christian Haselbach <ch...@tngtech.com> wrote:
> On Thu, Aug 02, 2007 at 10:12:14AM -0500, Ben Dotte wrote:
> > Is there any reason you can't use a threaded HiveMind service? That is
> > usually the approach I take when I have a shared resource that should
> > only live for the duration of a request.
>
> Thanks for the tip. I'm not quite sure if this works as I think.
> So the request is done in a new thread, the service is created for this
> thread and is discarded when the request finishes, right?
>
> That would work for me, if this is the way things go.
>
> Regards,
> Christian
>
> --
> Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Amtsgericht München, HRB 135082
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Event for every request to clear data

Posted by Christian Haselbach <ch...@tngtech.com>.
On Thu, Aug 02, 2007 at 10:12:14AM -0500, Ben Dotte wrote:
> Is there any reason you can't use a threaded HiveMind service? That is
> usually the approach I take when I have a shared resource that should
> only live for the duration of a request.

Thanks for the tip. I'm not quite sure if this works as I think.
So the request is done in a new thread, the service is created for this
thread and is discarded when the request finishes, right?

That would work for me, if this is the way things go.

Regards,
Christian

-- 
Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Amtsgericht München, HRB 135082

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: [T4] Event for every request to clear data

Posted by Ben Dotte <be...@gmail.com>.
Hi Christian,

Is there any reason you can't use a threaded HiveMind service? That is
usually the approach I take when I have a shared resource that should
only live for the duration of a request.

Ben

On 8/2/07, Christian Haselbach <ch...@tngtech.com> wrote:
> Hello,
>
> currently, we have a bean that is registered for a lot of pages which
> holds some information that is only releveant for the scope of the
> request. So I thought it woule be more appropriate to make an ASO out of
> it with scope request (which does not exist). The reason behind this is
> the fact, that this object realy is used for inter-component and
> -service communication.
>
> So I thought about making this an ASO with session scope and registering
> a service to a listener that fires at the end of a request to clear the
> data. So is there something analogous to ResetEventHub? Or am I looking
> in the wrong direction here?
>
> Thanks.
>
> Regards,
> Christian
>
> --
> Christian Haselbach - christian.haselbach@tngtech.com - +49 176 2082 5804
> TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
> Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
> Amtsgericht München, HRB 135082
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org