org.jboss.aspects.security
Class RunAsSecurityInterceptor

java.lang.Object
  extended by org.jboss.aspects.security.RunAsSecurityInterceptor
All Implemented Interfaces:
org.jboss.aop.advice.Interceptor

public class RunAsSecurityInterceptor
extends Object
implements org.jboss.aop.advice.Interceptor

An interceptor that enforces the run-as identity declared by a bean.

Version:
$Revision: 65273 $
Author:
Scott Stark., Dain Sundstrom.

Field Summary
protected  org.jboss.security.RealmMapping realmMapping
           
protected  org.jboss.security.AuthenticationManager securityManager
           
 
Constructor Summary
RunAsSecurityInterceptor()
           Creates an instance of RunAsSecurityInterceptor.
RunAsSecurityInterceptor(org.jboss.security.AuthenticationManager manager, org.jboss.security.RealmMapping realmMapping)
          Deprecated. use #RunAsSecurityInterceptor() instead.
 
Method Summary
protected  org.jboss.security.RunAsIdentity getAnnotationRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)
           Obtains the run-as identity that have been specified through annotations.
 String getName()
           
protected  org.jboss.security.RunAsIdentity getRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)
           Obtains the run-as identity to be used when running the method represented by the Invocation.
 Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityManager

protected org.jboss.security.AuthenticationManager securityManager

realmMapping

protected org.jboss.security.RealmMapping realmMapping
Constructor Detail

RunAsSecurityInterceptor

public RunAsSecurityInterceptor()

Creates an instance of RunAsSecurityInterceptor.


RunAsSecurityInterceptor

@Deprecated
public RunAsSecurityInterceptor(org.jboss.security.AuthenticationManager manager,
                                           org.jboss.security.RealmMapping realmMapping)
Deprecated. use #RunAsSecurityInterceptor() instead.

Creates an instance of RunAsSecurityInterceptor using the specified AuthenticationManager and RealmMapping implementations.

Parameters:
manager - the AuthenticationManager instance to be used when the caller hasn't been previously authenticated.
realmMapping - the RealmMapping instance to be used to determine if the caller has or has not the required roles.
Method Detail

getName

public String getName()
Specified by:
getName in interface org.jboss.aop.advice.Interceptor

getRunAsIdentity

protected org.jboss.security.RunAsIdentity getRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)

Obtains the run-as identity to be used when running the method represented by the Invocation.

Parameters:
invocation - the object that contains the metadata of the method being called.
Returns:
the RunAsIdentity to be used, or null if no run-as identity can be found.

getAnnotationRunAsIdentity

protected org.jboss.security.RunAsIdentity getAnnotationRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)

Obtains the run-as identity that have been specified through annotations.

Parameters:
invocation - the object that contains the metadata of the method being called.
Returns:
the RunAsIdentity to be used, or null if no run-as identity has been specified..

invoke

public Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
              throws Throwable
Specified by:
invoke in interface org.jboss.aop.advice.Interceptor
Throws:
Throwable


Copyright © 2009 JBoss Inc.. All Rights Reserved.