[ 
https://issues.apache.org/jira/browse/SHIRO-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860568#action_12860568
 ] 

Nariman edited comment on SHIRO-95 at 4/24/10 5:21 PM:
-------------------------------------------------------

my solution to set cache name for securityManager is

<bean id="securityManager" class="my.pakage.SecurityManager">
        <!-- Single realm app.  If you have multiple realms, use the 'realms' 
property instead. -->
        <property name="realm" ref="jdbcRealm"/>
        <property name="sessionMode" value="native"/>
        <!-- property name="sessionMode" value="http"/-->
        <property name="enterpriseCacheSessionDAO" 
ref="enterpriseCacheSessionDAO"/>
    </bean>

    <bean id="enterpriseCacheSessionDAO" 
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
         <property name="activeSessionsCacheName" value="activeDataCache"/>
    </bean>

and source file 

/**
 *
 * @author Nariman
 */
public class SecurityManager extends 
org.apache.shiro.web.DefaultWebSecurityManager{

    public SecurityManager(){
        super();
    }

    public void setEnterpriseCacheSessionDAO(EnterpriseCacheSessionDAO 
enterpriseCacheSessionDAO) {
        SessionManager sessionManager = this.getSessionManager();
        
((DefaultSessionManager)sessionManager).setSessionDAO(enterpriseCacheSessionDAO);
        }

}

      was (Author: nariman):
    my solution to set cache name for securityManager is

<bean id="securityManager" class="my.pakage.SecurityManager">
        <!-- Single realm app.  If you have multiple realms, use the 'realms' 
property instead. -->
        <property name="realm" ref="jdbcRealm"/>
        <property name="sessionMode" value="native"/>
        <!-- property name="sessionMode" value="http"/-->
        <property name="enterpriseCacheSessionDAO" 
ref="enterpriseCacheSessionDAO"/>
        <property name="sessionListener">
            <bean class="cmy.pakage.ShiroSessionListener"/>
        </property>
    </bean>

    <bean id="enterpriseCacheSessionDAO" 
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
         <property name="activeSessionsCacheName" value="activeDataCache"/>
    </bean>

and source file 

/**
 *
 * @author Nariman
 */
public class SecurityManager extends 
org.apache.shiro.web.DefaultWebSecurityManager{

    public SecurityManager(){
        super();
    }

    public void setEnterpriseCacheSessionDAO(EnterpriseCacheSessionDAO 
enterpriseCacheSessionDAO) {
        SessionManager sessionManager = this.getSessionManager();
        
((DefaultSessionManager)sessionManager).setSessionDAO(enterpriseCacheSessionDAO);
        }

    public void setSessionListener(SessionListener sessionListener){
        SessionManager sessionManager = this.getSessionManager();
        Collection<SessionListener> sessionListeners = new 
HashSet<SessionListener>();
        sessionListeners.add(sessionListener);
        
((DefaultSessionManager)sessionManager).setSessionListeners(sessionListeners);
    }

}
  
> Specifying my own Cache in ShiroFilter not working
> --------------------------------------------------
>
>                 Key: SHIRO-95
>                 URL: https://issues.apache.org/jira/browse/SHIRO-95
>             Project: Shiro
>          Issue Type: Bug
>          Components: Configuration
>    Affects Versions: 1.0.0
>            Reporter: Andy Tripp
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> When I specify my own CacheManager and Cache object in my ShiroFilter, the 
> default Cache manager is being used anyway. See thread "need help pluggin in 
> my own session cache" in August and September 2009 archives of the Shiro 
> mailing list for details.
> This is another order-of-operations issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to