1 17 18 package org.apache.geronimo.security.jacc; 19 20 import javax.security.jacc.PolicyContextException ; 21 import javax.security.jacc.PolicyContextHandler ; 22 23 import org.apache.geronimo.security.ContextManager; 24 25 26 32 public class PolicyContextHandlerContainerSubject implements PolicyContextHandler { 33 34 public static final String HANDLER_KEY = "javax.security.auth.Subject.container"; 35 36 public boolean supports(String key) throws PolicyContextException { 37 return key.equals(HANDLER_KEY); 38 } 39 40 public String [] getKeys() throws PolicyContextException { 41 return new String []{HANDLER_KEY}; 42 } 43 44 public Object getContext(String key, Object data) throws PolicyContextException { 45 try { 46 return ContextManager.getCurrentCaller(); 47 } catch (Exception e) { 48 throw new PolicyContextException (e); 49 } 50 } 51 } 52 | Popular Tags |