FileDocCategorySizeDatePackage
PolicyContextHandlerImpl.javaAPI DocGlassfish v2 API4510Fri May 04 22:35:32 BST 2007com.sun.enterprise.security.authorize

PolicyContextHandlerImpl

public class PolicyContextHandlerImpl extends Object implements javax.security.jacc.PolicyContextHandler
This class is created by the container and handed over to the JACC provider. This lets the jacc provider to use the information in making authorization decisions, if it wishes to do so.
author
Harpreet Singh
author
Shing Wai Chan

Fields Summary
public static final String
HTTP_SERVLET_REQUEST
public static final String
SOAP_MESSAGE
public static final String
ENTERPRISE_BEAN
public static final String
EJB_ARGUMENTS
public static final String
SUBJECT
public static final String
REUSE
private static PolicyContextHandlerImpl
pchimpl
private ThreadLocal
thisHandlerData
Constructors Summary
private PolicyContextHandlerImpl()


      
    
Methods Summary
private static synchronized com.sun.enterprise.security.authorize.PolicyContextHandlerImpl_getInstance()

        if (pchimpl == null) {
            pchimpl = new PolicyContextHandlerImpl();
        }
        return pchimpl;
    
public java.lang.ObjectgetContext(java.lang.String key, java.lang.Object data)

        // ignore data Object
        return getHandlerData().get(key);
    
public HandlerDatagetHandlerData()

        HandlerData handlerData = (HandlerData)thisHandlerData.get();
        if (handlerData == null) {
            handlerData = HandlerData.getInstance();
            thisHandlerData.set(handlerData);
        }
        return handlerData;
    
public static javax.security.jacc.PolicyContextHandlergetInstance()

        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new SecurityPermission("setPolicy"));
        }
    
        return _getInstance();
    
public java.lang.String[]getKeys()

	String[] s = {
	    HTTP_SERVLET_REQUEST,
	    SOAP_MESSAGE,
	    ENTERPRISE_BEAN,
	    SUBJECT,
	    EJB_ARGUMENTS,
            REUSE
	};
	return s;
    
public booleansupports(java.lang.String key)

	String[] s = getKeys();
	for (int i = 0; i<s.length; i++) {
	    if (s[i].equalsIgnoreCase(key)) {
		return true;
            }
	}
        return false;