1 22 package org.jboss.aspects.security; 23 24 import java.security.Principal ; 25 import java.io.ObjectStreamException ; 26 27 33 public final class SecurityClientInterceptor implements org.jboss.aop.advice.Interceptor, java.io.Serializable 34 { 35 private static final long serialVersionUID = -6366165968174741107L; 36 37 public static final SecurityClientInterceptor singleton = new SecurityClientInterceptor(); 38 public String getName() { return "SecurityClientInterceptor"; } 39 40 44 public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable 45 { 46 Principal principal = SecurityActions.getPrincipal(); 48 if (principal != null) invocation.getMetaData().addMetaData("security", "principal", principal); 49 50 Object credential = SecurityActions.getCredential(); 51 if (credential != null) invocation.getMetaData().addMetaData("security", "credential", credential); 52 53 return invocation.invokeNext(); 54 } 55 56 Object readResolve() throws ObjectStreamException { 57 return singleton; 58 } 59 } 60 | Popular Tags |