magoffin.matt.ma2.aop
Class AbstractSecurityInterceptor

java.lang.Object
  extended by magoffin.matt.ma2.aop.AbstractSecurityInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor
Direct Known Subclasses:
AlbumSecurityInterceptor, MediaItemSecurityInterceptor

public abstract class AbstractSecurityInterceptor
extends java.lang.Object
implements org.aopalliance.intercept.MethodInterceptor

Base AOP interceptor to validate security.

Version:
$Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
Author:
Matt Magoffin (spamsqr@msqr.us)

Constructor Summary
AbstractSecurityInterceptor()
           
 
Method Summary
 net.sf.ehcache.Ehcache getSecurityCache()
           
 UserBiz getUserBiz()
           
 java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
           
protected abstract  boolean isAllowed(org.aopalliance.intercept.MethodInvocation invocation, BizContext context)
          Return true if the method invocation should be allowed.
 void setSecurityCache(net.sf.ehcache.Ehcache securityCache)
           
 void setUserBiz(UserBiz userBiz)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSecurityInterceptor

public AbstractSecurityInterceptor()
Method Detail

invoke

public final java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
                              throws java.lang.Throwable
Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
java.lang.Throwable

isAllowed

protected abstract boolean isAllowed(org.aopalliance.intercept.MethodInvocation invocation,
                                     BizContext context)
Return true if the method invocation should be allowed.

Parameters:
invocation - the invocation
context - the context
Returns:
boolean

getUserBiz

public UserBiz getUserBiz()
Returns:
the userBiz

setUserBiz

public void setUserBiz(UserBiz userBiz)
Parameters:
userBiz - the userBiz to set

getSecurityCache

public net.sf.ehcache.Ehcache getSecurityCache()
Returns:
the securityCache

setSecurityCache

public void setSecurityCache(net.sf.ehcache.Ehcache securityCache)
Parameters:
securityCache - the securityCache to set