org.jboss.proxy
public class: SecurityInterceptor [javadoc |
source]
java.lang.Object
org.jboss.proxy.Interceptor
org.jboss.proxy.SecurityInterceptor
All Implemented Interfaces:
Externalizable
The client-side proxy for an EJB Home object.
- author:
< - a href="mailto:marc.fleury@jboss.org">Marc Fleury
- author:
Anil.Saldhana - @redhat.com
- version:
$ - Revision: 69871 $
| Method from org.jboss.proxy.SecurityInterceptor Summary: |
|---|
|
invoke |
| Method from org.jboss.proxy.SecurityInterceptor Detail: |
public Object invoke(Invocation invocation) throws Throwable {
// Get Principal and credentials
SecurityActions sa = SecurityActions.UTIL.getSecurityActions();
Principal principal = sa.getPrincipal();
if (principal != null)
{
invocation.setPrincipal(principal);
}
Object credential = sa.getCredential();
if (credential != null)
{
invocation.setCredential(credential);
}
SecurityContext sc = sa.getSecurityContext();
RunAs callerRAI = sa.getCallerRunAsIdentity();
SecurityContext newSc = createSecurityContext(invocation);
//Push the caller run-as identity onto the security context
if(callerRAI != null)
{
newSc.setOutgoingRunAs(callerRAI);
newSc.setIncomingRunAs(callerRAI);
}
/**
* Push the security context on the invocation
*/
invocation.setSecurityContext(newSc);
try
{
return getNext().invoke(invocation);
}
finally
{
if(sc != null)
sa.setSecurityContext(sc);
}
}
|