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