You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Henri Dupre <he...@gmail.com> on 2006/06/01 17:40:11 UTC

IMonitor replacement for T4.1?

I was wondering if there is going to be something to replace IMonitor in
Tapestry 4.1 since it is deprecated and I believe will disappear?
The only alternative in T4 I see is WebRequestServicerFilter but that
doesn't provide an interception point after the request is set and before
executing a service.

Right now to do stuff (that requires the cycle, request or ASOs) before
executing a service requires to write an ugly piece of hivemind
configuration to intercept all services and implement an interceptor. It
would be really nice to have a real interception point there. I'm currently
trying to implement a service that connects/disconnects hibernate objects in
the ASOs and there is lot of complex code just to get something similar to
IMonitor.
Also right now this doesn't seem to be enough to implement an authentication
service since redirection is not possible inside that part...
I'd be willing to contribute on an interface like that for T4.1 if there is
any interest.

Thanks,

Henri.

Re: IMonitor replacement for T4.1?

Posted by Henri Dupre <he...@gmail.com>.
On 6/5/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> Sounds like you need a step between the engine and the engine
> service's service() method that you can hook, to apply to all
> services.  I.e.
>
> void executeService(IEngineService service, IRequestCycle cycle);
>
> This could be created as a chain-of-command, allowing you to hook into it.
>
> Alternately, we could define a EngineServiceFilter:
>
> void service(IRequestCycle cycle, IEngineService delegate)
>
> And make it easy to build up filters for specific services, or for all
> services.


Nice to see you back here Howard.

Yes, that is exactly what I would need! I was going to file a request for
that type of interface in the JIRA.
I'm not sure if passing the IEngineService reference is even necessary... it
can be currently retrieved from the requestcycle.


Thanks,

Henri.

Re: IMonitor replacement for T4.1?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Sounds like you need a step between the engine and the engine
service's service() method that you can hook, to apply to all
services.  I.e.

void executeService(IEngineService service, IRequestCycle cycle);

This could be created as a chain-of-command, allowing you to hook into it.

Alternately, we could define a EngineServiceFilter:

void service(IRequestCycle cycle, IEngineService delegate)

And make it easy to build up filters for specific services, or for all services.

On 6/1/06, Henri Dupre <he...@gmail.com> wrote:
> I was wondering if there is going to be something to replace IMonitor in
> Tapestry 4.1 since it is deprecated and I believe will disappear?
> The only alternative in T4 I see is WebRequestServicerFilter but that
> doesn't provide an interception point after the request is set and before
> executing a service.
>
> Right now to do stuff (that requires the cycle, request or ASOs) before
> executing a service requires to write an ugly piece of hivemind
> configuration to intercept all services and implement an interceptor. It
> would be really nice to have a real interception point there. I'm currently
> trying to implement a service that connects/disconnects hibernate objects in
> the ASOs and there is lot of complex code just to get something similar to
> IMonitor.
> Also right now this doesn't seem to be enough to implement an authentication
> service since redirection is not possible inside that part...
> I'd be willing to contribute on an interface like that for T4.1 if there is
> any interest.
>
> Thanks,
>
> Henri.
>
>


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: IMonitor replacement for T4.1?

Posted by Henri Dupre <he...@gmail.com>.
On 6/1/06, Jesse Kuhnert <jk...@gmail.com> wrote:
>
> Yes if it's not gone yet it will definitely be gone soon. Hivemind seems
> like the way to go for everything IMonitor was previously doing.
>
> What were you thinking should be done instead?


I was thinking about a filter point before a service executes but after the
requestcycle has been set and all the request context stuff is ready (with
ways to access the page name, service name and ASOs).
Something around service.service(cycle) in the abstract engine.
And it would be really nice if that filter was able to throw
PageRedirectExceptions and if the redirections could be carried to the
services. I can imagine many usages for such filter: authentication,
hibernate sessions, etc.


Thanks,

Henri.

Re: IMonitor replacement for T4.1?

Posted by Jesse Kuhnert <jk...@gmail.com>.
Yes if it's not gone yet it will definitely be gone soon. Hivemind seems
like the way to go for everything IMonitor was previously doing.

What were you thinking should be done instead?

On 6/1/06, James Carman <ja...@carmanconsulting.com> wrote:
>
> Are you reconnecting session-scoped ASOs which are Hibernate-managed
> entities?  Be careful, because sessions aren't thread-safe.  So, you could
> be reattaching the object in one thread and another request comes in for
> the
> exact same user in another thread.
>
> -----Original Message-----
> From: Henri Dupre [mailto:henri.dupre@gmail.com]
> Sent: Thursday, June 01, 2006 11:40 AM
> To: Tapestry development
> Subject: IMonitor replacement for T4.1?
>
> I was wondering if there is going to be something to replace IMonitor in
> Tapestry 4.1 since it is deprecated and I believe will disappear?
> The only alternative in T4 I see is WebRequestServicerFilter but that
> doesn't provide an interception point after the request is set and before
> executing a service.
>
> Right now to do stuff (that requires the cycle, request or ASOs) before
> executing a service requires to write an ugly piece of hivemind
> configuration to intercept all services and implement an interceptor. It
> would be really nice to have a real interception point there. I'm
> currently
> trying to implement a service that connects/disconnects hibernate objects
> in
> the ASOs and there is lot of complex code just to get something similar to
> IMonitor.
> Also right now this doesn't seem to be enough to implement an
> authentication
> service since redirection is not possible inside that part...
> I'd be willing to contribute on an interface like that for T4.1 if there
> is
> any interest.
>
> Thanks,
>
> Henri.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

RE: IMonitor replacement for T4.1?

Posted by James Carman <ja...@carmanconsulting.com>.
Ahh, you *can* use Tapernate's @Persist("reattach-merge") which should avoid
this problem, I think.

-----Original Message-----
From: Henri Dupre [mailto:henri.dupre@gmail.com] 
Sent: Thursday, June 01, 2006 12:39 PM
To: Tapestry development
Subject: Re: IMonitor replacement for T4.1?

On 6/1/06, James Carman <ja...@carmanconsulting.com> wrote:
>
> Are you reconnecting session-scoped ASOs which are Hibernate-managed
> entities?  Be careful, because sessions aren't thread-safe.  So, you could
> be reattaching the object in one thread and another request comes in for
> the
> exact same user in another thread.


You're very right... I did not think about that... I have a servletfilter
that is supposed to prevent concurrent requests from the same user though.
Does tapernate bring somekind of solution to this session/thread problem? I
saw that there is some nice persistency annotations for hibernate objects.

Thanks,

Henri.



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


RE: IMonitor replacement for T4.1?

Posted by James Carman <ja...@carmanconsulting.com>.
Tapernate doesn't deal with ASOs, though.  It just works with persistent
page properties.  But, now that I think of it, they're stored in the
session, too.  So, I may have the same issues.  Ok, new rule, don't allow
users to submit requests from two different browsers. :-)
 


-----Original Message-----
From: Henri Dupre [mailto:henri.dupre@gmail.com] 
Sent: Thursday, June 01, 2006 12:39 PM
To: Tapestry development
Subject: Re: IMonitor replacement for T4.1?

On 6/1/06, James Carman <ja...@carmanconsulting.com> wrote:
>
> Are you reconnecting session-scoped ASOs which are Hibernate-managed
> entities?  Be careful, because sessions aren't thread-safe.  So, you could
> be reattaching the object in one thread and another request comes in for
> the
> exact same user in another thread.


You're very right... I did not think about that... I have a servletfilter
that is supposed to prevent concurrent requests from the same user though.
Does tapernate bring somekind of solution to this session/thread problem? I
saw that there is some nice persistency annotations for hibernate objects.

Thanks,

Henri.



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


Re: IMonitor replacement for T4.1?

Posted by Henri Dupre <he...@gmail.com>.
On 6/1/06, James Carman <ja...@carmanconsulting.com> wrote:
>
> Are you reconnecting session-scoped ASOs which are Hibernate-managed
> entities?  Be careful, because sessions aren't thread-safe.  So, you could
> be reattaching the object in one thread and another request comes in for
> the
> exact same user in another thread.


You're very right... I did not think about that... I have a servletfilter
that is supposed to prevent concurrent requests from the same user though.
Does tapernate bring somekind of solution to this session/thread problem? I
saw that there is some nice persistency annotations for hibernate objects.

Thanks,

Henri.

RE: IMonitor replacement for T4.1?

Posted by James Carman <ja...@carmanconsulting.com>.
Are you reconnecting session-scoped ASOs which are Hibernate-managed
entities?  Be careful, because sessions aren't thread-safe.  So, you could
be reattaching the object in one thread and another request comes in for the
exact same user in another thread.

-----Original Message-----
From: Henri Dupre [mailto:henri.dupre@gmail.com] 
Sent: Thursday, June 01, 2006 11:40 AM
To: Tapestry development
Subject: IMonitor replacement for T4.1?

I was wondering if there is going to be something to replace IMonitor in
Tapestry 4.1 since it is deprecated and I believe will disappear?
The only alternative in T4 I see is WebRequestServicerFilter but that
doesn't provide an interception point after the request is set and before
executing a service.

Right now to do stuff (that requires the cycle, request or ASOs) before
executing a service requires to write an ugly piece of hivemind
configuration to intercept all services and implement an interceptor. It
would be really nice to have a real interception point there. I'm currently
trying to implement a service that connects/disconnects hibernate objects in
the ASOs and there is lot of complex code just to get something similar to
IMonitor.
Also right now this doesn't seem to be enough to implement an authentication
service since redirection is not possible inside that part...
I'd be willing to contribute on an interface like that for T4.1 if there is
any interest.

Thanks,

Henri.



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