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

HandlerData

public class HandlerData extends Object
This class implements a thread scoped data used for PolicyContext.
author
Harry Singh
author
Jyri Virkki
author
Shing Wai Chan

Fields Summary
private HttpServletRequest
httpReq
private com.sun.ejb.Invocation
inv
Constructors Summary
private HandlerData()


     
Methods Summary
public java.lang.Objectget(java.lang.String key)

	if (PolicyContextHandlerImpl.HTTP_SERVLET_REQUEST.equalsIgnoreCase(key)){
	    return httpReq;
	} else if (PolicyContextHandlerImpl.SUBJECT.equalsIgnoreCase(key)){
	    return SecurityContext.getCurrent().getSubject();
	} else if (PolicyContextHandlerImpl.REUSE.equalsIgnoreCase(key)) {
            PermissionCacheFactory.resetCaches();
            return new Integer(0);
        }

        if (inv == null) {
            return null;
        }

	if (PolicyContextHandlerImpl.SOAP_MESSAGE.equalsIgnoreCase(key)){
            SOAPMessage soapMessage = null;
	    MessageContext msgContext = inv.messageContext;

            if (msgContext != null) {
                if (msgContext instanceof SOAPMessageContext) {
		    SOAPMessageContext smc =
                            (SOAPMessageContext) msgContext;
		    soapMessage = smc.getMessage();
                }
	    } else {
                soapMessage = inv.getSOAPMessage();
            }

	    return soapMessage;
	} else if (PolicyContextHandlerImpl.ENTERPRISE_BEAN.equalsIgnoreCase(key)){
	    return inv.getJaccEjb();
	} else if (PolicyContextHandlerImpl.EJB_ARGUMENTS.equalsIgnoreCase(key)){
            if (inv.isWebService) {
                return null;
            } else {
                return (inv.methodParams != null) ?
                    inv.methodParams : new Object[0];
            }
	}
	return null;
    
public static com.sun.enterprise.security.authorize.HandlerDatagetInstance()

	return new HandlerData();
    
public voidsetHttpServletRequest(javax.servlet.http.HttpServletRequest httpReq)

	this.httpReq = httpReq;
    
public voidsetInvocation(com.sun.ejb.Invocation inv)

        this.inv = inv;