I've attached an example ticketRegistry.xml that worked for us on CAS 3.5.1. 
The ehCache configuration file is externalized to /etc/cas in this case (line 
39).

Benjamin Mosior 

-----Original Message-----
From: Andres [mailto:afolg...@gmail.com] 
Sent: Tuesday, October 16, 2012 8:02 AM
To: cas-user@lists.jasig.org
Subject: [cas-user] EhCache configuration in 3.5.1 with EhCache 2.6

Hi all,

The documentation about EhCache 
(https://wiki.jasig.org/display/CASUM/EhcacheTicketRegistry) won't work, as is 
for the 2.5 version of EhCache. CAS 3.5.1 comes with EhCache 2.6.

Anybody has managed to update ticketRegistry.xml to the newer version?

Thanks!
--
You are currently subscribed to cas-user@lists.jasig.org as: bemos...@ship.edu 
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to cas-user@lists.jasig.org as: 
arch...@mail-archive.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Jasig under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Jasig licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:

      http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:p="http://www.springframework.org/schema/p";
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd";>
  <description>
        Configuration for the Ehcache TicketRegistry which stores the tickets in a distributed Ehcache and cleans
        them out as specified intervals.
  </description>

     <!-- Ticket Registry -->
  <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.EhCacheTicketRegistry">
    <property name="ticketGrantingTicketsCache" ref="ticketGrantingTicketsCache"/>
    <property name="serviceTicketsCache" ref="serviceTicketsCache"/>
  </bean>
 
  <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
    <property name="cacheManagerName" value="CAS.cacheManager" />
    <property name="configLocation" value="file:/etc/cas/ehcache.xml" />
  </bean>
 
  <bean id="serviceTicketsCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    <property name="cacheManager" ref="cacheManager" />
    <property name="cacheName" value="org.jasig.cas.ticket.ServiceTicket" />
    <property name="diskExpiryThreadIntervalSeconds" value="0" />
    <property name="diskPersistent" value="false" />
    <property name="eternal" value="false" />
    <property name="maxElementsInMemory" value="10000" />
    <property name="maxElementsOnDisk" value="0" />
    <property name="memoryStoreEvictionPolicy" value="LRU" />
    <property name="overflowToDisk" value="false" />
    <!-- 300 seconds before service tickets are expired automatically -->
    <property name="timeToLive" value="300" />
    <property name="timeToIdle" value="0" />
    <property name="cacheEventListeners">
      <bean id="serviceTicketReplicator" class="net.sf.ehcache.distribution.RMISynchronousCacheReplicator">
        <constructor-arg index="0" value="true"/> <!-- replicatePuts -->
        <constructor-arg index="1" value="true"/> <!-- replicatePutsViaCopy -->
        <constructor-arg index="2" value="true"/> <!-- replicateUpdates -->
        <constructor-arg index="3" value="true"/> <!-- replicateUpdatesViaCopy -->
        <constructor-arg index="4" value="true"/> <!-- replicateRemovals -->
      </bean>
    </property>
    <property name="bootstrapCacheLoader">
      <bean id="serviceTicketCacheBootstrapCacheLoader" class="net.sf.ehcache.distribution.RMIBootstrapCacheLoader">
        <constructor-arg index="0" value="false"/> <!-- asynchronous -->
        <constructor-arg index="1" value="5000000"/> <!-- maximumChunkSize -->
      </bean>
    </property>
  </bean>
  <bean id="ticketGrantingTicketsCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    <property name="cacheManager" ref="cacheManager" />
    <property name="cacheName" value="org.jasig.cas.ticket.TicketGrantingTicket" />
    <property name="diskExpiryThreadIntervalSeconds" value="0" />
    <property name="diskPersistent" value="false" />
    <property name="eternal" value="false" />
    <property name="maxElementsInMemory" value="10000" />
    <property name="maxElementsOnDisk" value="0" />
    <property name="memoryStoreEvictionPolicy" value="LRU" />
    <property name="overflowToDisk" value="true" />
    <property name="timeToLive" value="0" />
    <!-- 2 hours of inactivity before ticket granting tickets are expired automatically -->
    <property name="timeToIdle" value="7201" />
    <property name="cacheEventListeners">
      <bean id="ticketGrantingTicketReplicator" class="net.sf.ehcache.distribution.RMIAsynchronousCacheReplicator">
        <constructor-arg index="0" value="true"/> <!-- replicatePuts -->
        <constructor-arg index="1" value="true"/> <!-- replicatePutsViaCopy -->
        <constructor-arg index="2" value="true"/> <!-- replicateUpdates -->
        <constructor-arg index="3" value="true"/> <!-- replicateUpdatesViaCopy -->
        <constructor-arg index="4" value="true"/> <!-- replicateRemovals -->
        <constructor-arg index="5" value="1000"/> <!-- asynchronousReplicationInterval (default=1000)-->
      </bean>
    </property>
    <property name="bootstrapCacheLoader">
      <bean id="ticketGrantingTicketCacheBootstrapCacheLoader" class="net.sf.ehcache.distribution.RMIBootstrapCacheLoader">
        <constructor-arg index="0" value="false"/> <!-- asynchronous -->
        <constructor-arg index="1" value="5000000"/> <!-- maximumChunkSize -->
      </bean>
    </property>
  </bean>
 
</beans>

Reply via email to