FileDocCategorySizeDatePackage
WebServiceContextImpl.javaAPI DocGlassfish v2 API4687Fri May 04 22:36:12 BST 2007com.sun.enterprise.webservice

WebServiceContextImpl

public final class WebServiceContextImpl extends Object implements com.sun.xml.ws.api.server.WSWebServiceContext

NOT THREAD SAFE: mutable instance variables

Fields Summary
public static final ThreadLocal
msgContext
public static final ThreadLocal
principal
private com.sun.xml.ws.api.server.WSWebServiceContext
jaxwsContextDelegate
Constructors Summary
Methods Summary
public javax.xml.ws.EndpointReferencegetEndpointReference(java.lang.Class clazz, org.w3c.dom.Element params)

        return this.jaxwsContextDelegate.getEndpointReference(clazz, params);
    
public javax.xml.ws.EndpointReferencegetEndpointReference(org.w3c.dom.Element params)

        return this.jaxwsContextDelegate.getEndpointReference(params);
    
public javax.xml.ws.handler.MessageContextgetMessageContext()

        return this.jaxwsContextDelegate.getMessageContext();
    
public com.sun.xml.ws.api.message.PacketgetRequestPacket()

        return this.jaxwsContextDelegate.getRequestPacket();
    
public java.security.PrincipalgetUserPrincipal()

        // This could be an EJB endpoint; check the threadlocal variable
        WebPrincipal p = (WebPrincipal) principal.get();
        if (p != null) {
            return p;
        }
        // This is a servlet endpoint
        return this.jaxwsContextDelegate.getUserPrincipal();
    
public booleanisUserInRole(java.lang.String role)

        Switch sw = Switch.getSwitch();
        InvocationManager mgr = sw.getInvocationManager();
        Object o = mgr.getCurrentInvocation().getContainerContext();
        if(o instanceof StatelessSessionContainer) {
            StatelessSessionContainer cont = (StatelessSessionContainer) o;
            boolean res = cont.getSecurityManager().isCallerInRole(role);
            return res;
        }
        // This is a servlet endpoint
        return this.jaxwsContextDelegate.isUserInRole(role);
    
public voidsetContextDelegate(com.sun.xml.ws.api.server.WSWebServiceContext wsc)

    
        
        this.jaxwsContextDelegate = wsc;
    
public voidsetMessageContext(javax.xml.ws.handler.MessageContext ctxt)

        msgContext.set(ctxt);
    
public voidsetUserPrincipal(com.sun.web.security.WebPrincipal p)

        principal.set(p);