Hi Jack!

I wonder what kind of page data you want to cache which is not provideable by a service?

a) why not using a spring singleton or a plain java static?

b) You can bind a service implementation (without interface) in your app module and inject it to your page if you're not using a spring service layer, for example.

c) in case your data is considerably volatile you can try something like OSCache?

d) Hopefully I am correct, but in case you write something like this in your page class:

    private final YourType _var = whatEverService.getData();

the call to getData() is only excuted once (first time your page is ever used).


Sorry I did not exactly answer your question, but maybe moving the code to a service (away from the page class itself) will also solve your problem without advising the PageLoader and a chance for a cache related unit test?

Jens






Am 05.09.11 11:58, schrieb jack:
Hi All,
I'm trying to advise the PageLoader service because we have some custom page caching requirements. I've tried the following but it doesn't seem to get invoked. Is it even possible to advise this service? If so can anyone tell me what I'm doing wrong?

    @Advise(serviceInterface = ComponentAssemblerSource.class)
    @Match("PageLoader")
    public static void siteKeyPageCache(MethodAdviceReceiver receiver) {
        MethodAdvice advice = new MethodAdvice() {
            public void advise(Invocation invocation) {
                ...
            }
        };
    }

Many thanks,

Jack

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



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

Reply via email to