FileDocCategorySizeDatePackage
SOAPMessageContextImpl.javaAPI DocGlassfish v2 API6111Mon Jul 30 08:28:46 BST 2007com.sun.enterprise.webservice

SOAPMessageContextImpl

public class SOAPMessageContextImpl extends Object implements com.sun.enterprise.webservice.SOAPMessageContext
Implementation of SOAPMessageContext

Fields Summary
private com.sun.xml.ws.api.message.Packet
packet
private SOAPMessage
message
Constructors Summary
public SOAPMessageContextImpl(com.sun.xml.ws.api.message.Packet pkt)


       
        this.packet = pkt;
    
Methods Summary
public voidclear()

        // We just clear whatever we set; we do not clear jaxws's properties'
        packet.invocationProperties.clear();
    
public booleancontainsKey(java.lang.Object obj)

        // First check our property bag
        if(packet.supports(obj)) {
            return packet.containsKey(obj);
        }
        return packet.invocationProperties.containsKey(obj);
    
public booleancontainsValue(java.lang.Object obj)

        return packet.invocationProperties.containsValue(obj);
    
public java.util.SetentrySet()

        return packet.invocationProperties.entrySet();
    
public java.lang.Objectget(java.lang.Object obj)

        if(packet.supports(obj)) {
            return packet.get(obj);
        }
        return packet.invocationProperties.get(obj);
    
public java.lang.Object[]getHeaders(javax.xml.namespace.QName header, javax.xml.bind.JAXBContext jaxbContext, boolean allRoles)

        // this is a dummy impl; we do not use it at all
        return null;
    
public javax.xml.soap.SOAPMessagegetMessage()

        
        if (message != null) {
            return message;
        }
        
        SOAPMessage soapMsg = null;
        try {
            //before converting to SOAPMessage, make a copy.  We don't want to consume
            //the original message
            Message mutable = packet.getMessage().copy();
            soapMsg = mutable.readAsSOAPMessage();
                       
        } catch (Exception e) {
            e.printStackTrace();
        }
       
 	//store the message so we don't have to convert again
	message = soapMsg; 

        return soapMsg;
    
public java.util.SetgetRoles()

        // this is a dummy impl; we do not use it at all
        return null;
    
public javax.xml.ws.handler.MessageContext.ScopegetScope(java.lang.String name)

        // this is a dummy impl; we do not use it at all
        return null;
    
public booleanisAlreadySoap()

        // In jaxws-rearch, only SOAP messages come here
        // So always return true
        return true;
    
public booleanisEmpty()

        return packet.invocationProperties.isEmpty();
    
public java.util.SetkeySet()

        return packet.invocationProperties.keySet();
    
public java.lang.Objectput(java.lang.String str, java.lang.Object obj)

        return packet.invocationProperties.put(str, obj);
    
public voidputAll(java.util.Map map)

        packet.invocationProperties.putAll(map);
    
public java.lang.Objectremove(java.lang.Object obj)

        return packet.invocationProperties.remove(obj);
    
public voidsetMessage(javax.xml.soap.SOAPMessage newMsg)

        message = newMsg;
        
        //keep the com.sun.xml.ws.api.message.Message in the packet consistent with the
        //SOAPMessage we are storing here.
        packet.setMessage(Messages.create(newMsg));
    
public voidsetPacket(com.sun.xml.ws.api.message.Packet packet)

        this.packet = packet;
        this.message = null;
    
public voidsetScope(java.lang.String name, javax.xml.ws.handler.MessageContext.Scope scope)

        // this is a dummy impl; we do not use it at all
        return;
    
public intsize()

        return packet.invocationProperties.size();
    
public java.util.Collectionvalues()

        return packet.invocationProperties.values();