org.jasig.cas.ticket.registry.support
Class DefaultTicketRegistryCleaner

java.lang.Object
  extended by org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
All Implemented Interfaces:
RegistryCleaner

public final class DefaultTicketRegistryCleaner
extends java.lang.Object
implements RegistryCleaner

The default ticket registry cleaner scans the entire CAS ticket registry for expired tickets and removes them. This process is only required so that the size of the ticket registry will not grow beyond a reasonable size. The functionality of CAS is not dependent on a ticket being removed as soon as it is expired.

NEW in 3.3.6:

Locking strategies may be used to support high availability environments. In a clustered CAS environment with several CAS nodes executing ticket cleanup, it is desirable to execute cleanup from only one CAS node at a time. This dramatically reduces the potential for deadlocks in JpaTicketRegistry, for example. By default this implementation uses NoOpLockingStrategy to preserve the same semantics as previous versions, but JdbcLockingStrategy should be used with JpaTicketRegistry in a clustered CAS environment.

The following property is required.

Since:
3.0
Version:
$Revision: 48180 $
Author:
Scott Battaglia, Marvin S. Addison
See Also:
JdbcLockingStrategy, NoOpLockingStrategy

Constructor Summary
DefaultTicketRegistryCleaner()
           
 
Method Summary
 void clean()
          Method to kick-off the cleaning of a registry.
 void setLock(LockingStrategy strategy)
           
 void setTicketRegistry(TicketRegistry ticketRegistry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTicketRegistryCleaner

public DefaultTicketRegistryCleaner()
Method Detail

clean

public void clean()
Description copied from interface: RegistryCleaner
Method to kick-off the cleaning of a registry.

Specified by:
clean in interface RegistryCleaner
See Also:
RegistryCleaner.clean()

setTicketRegistry

public void setTicketRegistry(TicketRegistry ticketRegistry)
Parameters:
ticketRegistry - The ticketRegistry to set.

setLock

public void setLock(LockingStrategy strategy)
Parameters:
strategy - Ticket cleanup locking strategy. An exclusive locking strategy is preferable if not required for some ticket backing stores, such as JPA, in a clustered CAS environment. Use JdbcLockingStrategy for JpaTicketRegistry in a clustered CAS environment.


Copyright © 2004-2010 Java Architectures Special Interest Group. All Rights Reserved.