Tapestry-security CacheManager

Charlouze <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAD0m3OJWOD0JM0nfdnuSt32EqOc7-JdZoUb5hMwDW2Wf=vSAPA@mail.gmail.com>
Hello tapestry users,

I wanted to get rid of the log message that says "*No cache or cacheManager
properties have been set. Authorization cache cannot be obtained.*".

I read that shiro offers an implementation of their CacheManager using
EhCache so I tried to set it up.

In order to set the CacheManager I had to override
TapestryRealmSecurityManager with one of my own (see below) using a
ServiceOverride contribution. I don't really like using ServiceOverride as
it feels i'm hacking something. Is there a better way to achieve what I
want tot do ?

Regards,
Charles

import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.mgt.RememberMeManager;
import org.apache.shiro.mgt.SubjectFactory;
import org.apache.shiro.realm.Realm;
import org.tynamo.security.Authenticator;
import org.tynamo.security.services.TapestryRealmSecurityManager;

import java.util.Collection;

public class MySecurityManager extends TapestryRealmSecurityManager {
    public MySecurityManager(final Authenticator authenticator, final
SubjectFactory subjectFactory,
                                    final RememberMeManager
rememberMeManager, final Collection<Realm> realms,
                                    final CacheManager cacheManager) {
        super(authenticator, subjectFactory, rememberMeManager, realms);
        setCacheManager(cacheManager);
    }
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.