org.jasig.cas.services.support
Class SpringApplicationContextServiceRegistryReloader

java.lang.Object
  extended byorg.jasig.cas.services.support.SpringApplicationContextServiceRegistryReloader
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, ServiceRegistryReloader

public final class SpringApplicationContextServiceRegistryReloader
extends java.lang.Object
implements ServiceRegistryReloader, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware

Implementation of the ServiceRegistryReloader that will refresh a Spring context if the underlying file changes.

The algorithm is as follows. Check the last recorded lastModified time against the current lastModified time. If they differ, reload the registry by re-reading the context, deleting all of the current services and replacing them with fresh copies from the file. This class locks on the ServiceRegistry.

Since:
3.0
Version:
$Revision$ $Date$
Author:
Scott Battaglia, Dmitriy Kopylenko
See Also:
ServiceRegistryReloader

Constructor Summary
SpringApplicationContextServiceRegistryReloader()
           
 
Method Summary
 void afterPropertiesSet()
           
 void reloadServiceRegistry()
          Method to call to reload the service registry.
 void setFileName(java.lang.String fileName)
          Method to set the file name.
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
           
 void setServiceRegistryManager(ServiceRegistryManager serviceRegistryManager)
          Method to set the Service Registry Manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringApplicationContextServiceRegistryReloader

public SpringApplicationContextServiceRegistryReloader()
Method Detail

reloadServiceRegistry

public void reloadServiceRegistry()
Description copied from interface: ServiceRegistryReloader
Method to call to reload the service registry.

Specified by:
reloadServiceRegistry in interface ServiceRegistryReloader

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

setFileName

public void setFileName(java.lang.String fileName)
Method to set the file name.

Parameters:
fileName - the File name to set.

setServiceRegistryManager

public void setServiceRegistryManager(ServiceRegistryManager serviceRegistryManager)
Method to set the Service Registry Manager.

Parameters:
serviceRegistryManager - the serviceRegistryManager to set.

setResourceLoader

public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
Specified by:
setResourceLoader in interface org.springframework.context.ResourceLoaderAware
Parameters:
resourceLoader - The resourceLoader to set.


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