1 22 package org.jboss.ejb; 23 24 import javax.security.jacc.PolicyContextException ; 25 import javax.security.jacc.PolicyContextHandler ; 26 import javax.xml.soap.SOAPMessage ; 27 28 32 public class SOAPMsgPolicyContextHandler implements PolicyContextHandler 33 { 34 public static final String SEI_ARGS_KEY = "javax.xml.soap.SOAPMessage"; 35 private static ThreadLocal ejbContext = new ThreadLocal (); 36 37 static void setMessage(SOAPMessage msg) 38 { 39 ejbContext.set(msg); 40 } 41 42 48 public Object getContext(String key, Object data) 49 throws PolicyContextException 50 { 51 Object context = null; 52 if( key.equalsIgnoreCase(SEI_ARGS_KEY) == true ) 53 context = ejbContext.get(); 54 return context; 55 } 56 57 public String [] getKeys() 58 throws PolicyContextException 59 { 60 String [] keys = {SEI_ARGS_KEY}; 61 return keys; 62 } 63 64 public boolean supports(String key) 65 throws PolicyContextException 66 { 67 return key.equalsIgnoreCase(SEI_ARGS_KEY); 68 } 69 70 } 71 | Popular Tags |