📄 userchangedlistener.java
字号:
/*
* Copyright 2005-2010 the original author or authors.
*
* http://www.skyon.com.cn
*
* Project cardAssistant
*/
package com.skyon.um.security.acegi.intercept.event;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.util.Assert;
import com.skyon.um.security.acegi.providers.dao.FlushableUserCache;
/**
* @since 2005-11-4
* @author 王政
* @version $Id: UserChangedListener.java,v 1.1 2005/11/04 15:55:06 wangzheng Exp $
*/
public class UserChangedListener implements ApplicationListener,
InitializingBean {
private static final Log logger = LogFactory.getLog(UserChangedListener.class);
private FlushableUserCache userCache;
public void onApplicationEvent(ApplicationEvent event) {
if (! UserChangedEvent.class.isInstance(event)) {
return;
}
logger.info(" 监听到 " + UserChangedListener.class + " , 开始重新读取用户数据... ");
getUserCache().flushCache();
logger.info(" 成功重新读取用户数据 ! ");
}
public void afterPropertiesSet() throws Exception {
Assert.notNull(getUserCache(), " userCache is required. ");
}
/**
* @return Returns the userCache.
*/
public FlushableUserCache getUserCache() {
return userCache;
}
/**
* @param userCache The userCache to set.
*/
public void setUserCache(FlushableUserCache flushableUserCache) {
this.userCache = flushableUserCache;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -