On Jul 29, 2009, at 7/297:00 PM , Thiago H. de Paula Figueiredo wrote:
Hi!
I'm working on a security package for Tapestry (to be open-sourced
soon) and I'm following the typical Dispatcher-based approach. Now I
need to check if the requested page has a given annotation and read
its values. This already works. I also want my dispatcher to get the
annotation presence and values when a page class is live reloaded.
I'm using ComponentClassResolver to map page names (user/edit) to
their page classes names, get the Class instance and then get the
annotation values. But, without an application restart, my
dispatcher doesn't see the new annotation values. I could use
ComponentSource.getPage(), but it checks out a page instance from
the pool and invokes Page.attached(). I suspect this hurt
perfomance, as the page checkout would be too heavy to be executed
twice per request (one in the security dispatcher, other to process
the page render/event itself).
Any suggestions? Am I right in the assumption that using
PageCache.checkout() to do security checks would hurt performance?
Well, if you use ComponentSource, it will take advantage of the
RequestPageCache, so you'll only checkout the page once per request.
Given that it's the page the user is requesting, it shouldn't really
hit performance any more than just returning the page to the user. If
you use the PagePool directly, you run the risk of checking out
multiple copies of the page per request, and that would definitely
have an impact on performance.
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org