Unicon / cas-addons

Open source CAS customizations, extensions, and configuration aids.
http://unicon.github.io/cas-addons/
Apache License 2.0
54 stars 26 forks source link

Re-implement reloading services manager suppression with BeanFactoryPostProcessor #43

Closed dima767 closed 11 years ago

dima767 commented 11 years ago

Instead of an AspectJ statically compiled Aspect which weaves the aspect into CAS' DefaultServicesManager and might introduce some surprising weird behavior when reordering the jars in the classloader by renaming cas-addons.jar for example, etc.

The proposed solution gets rid of AspectJ magic and instead relies on the standard Spring's BeanFactoryPostProcessor which will simply destroy 2 quartz beans responsible for invoking the reload method. E.G:

...

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        beanFactory.destroyBean("serviceRegistryReloaderJobDetail", beanFactory.getBean("serviceRegistryReloaderJobDetail"));
        beanFactory.destroyBean("periodicServiceRegistryReloaderTrigger", beanFactory.getBean("periodicServiceRegistryReloaderTrigger"));
    }
dima767 commented 11 years ago

Done: https://github.com/Unicon/cas-addons/compare/9c3ea2e5a4...master