Package com.mossle.auth.component

Source Code of com.mossle.auth.component.PermEventListener

package com.mossle.auth.component;

import javax.annotation.Resource;

import com.mossle.auth.domain.Perm;

import com.mossle.core.hibernate.EntityEvent;

import org.springframework.context.ApplicationListener;

import org.springframework.stereotype.Component;

@Component
public class PermEventListener implements ApplicationListener<EntityEvent> {
    private AuthCache authCache;

    public void onApplicationEvent(EntityEvent event) {
        if (!event.supportsEntityType(Perm.class)) {
            return;
        }

        Perm perm = event.getEntity();
        authCache.evictPerm(perm);
    }

    @Resource
    public void setAuthCache(AuthCache authCache) {
        this.authCache = authCache;
    }
}
TOP

Related Classes of com.mossle.auth.component.PermEventListener

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.