jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java
changeset 43852 93a527059d8a
parent 25871 b80b84e87032
equal deleted inserted replaced
43752:3c68ef249093 43852:93a527059d8a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    40 import javax.xml.ws.WebServiceFeature;
    40 import javax.xml.ws.WebServiceFeature;
    41 import javax.xml.ws.handler.Handler;
    41 import javax.xml.ws.handler.Handler;
    42 import javax.xml.ws.soap.MTOMFeature;
    42 import javax.xml.ws.soap.MTOMFeature;
    43 import javax.xml.ws.soap.SOAPBinding;
    43 import javax.xml.ws.soap.SOAPBinding;
    44 import java.util.*;
    44 import java.util.*;
       
    45 import java.util.concurrent.locks.Lock;
       
    46 import java.util.concurrent.locks.ReentrantLock;
    45 
    47 
    46 /**
    48 /**
    47  * @author WS Development Team
    49  * @author WS Development Team
    48  */
    50  */
    49 public final class SOAPBindingImpl extends BindingImpl implements SOAPBinding {
    51 public final class SOAPBindingImpl extends BindingImpl implements SOAPBinding {
    55     //protected boolean enableMtom;
    57     //protected boolean enableMtom;
    56     protected final SOAPVersion soapVersion;
    58     protected final SOAPVersion soapVersion;
    57 
    59 
    58     private Set<QName> portKnownHeaders = Collections.emptySet();
    60     private Set<QName> portKnownHeaders = Collections.emptySet();
    59     private Set<QName> bindingUnderstoodHeaders = new HashSet<QName>();
    61     private Set<QName> bindingUnderstoodHeaders = new HashSet<QName>();
       
    62     private final Lock lock = new ReentrantLock();
    60 
    63 
    61     /**
    64     /**
    62      * Use {@link BindingImpl#create(BindingID)} to create this.
    65      * Use {@link BindingImpl#create(BindingID)} to create this.
    63      *
    66      *
    64      * @param bindingId SOAP binding ID
    67      * @param bindingId SOAP binding ID
    93      *  processing.
    96      *  processing.
    94      *
    97      *
    95      * @param headers SOAP header names
    98      * @param headers SOAP header names
    96      */
    99      */
    97     public void setPortKnownHeaders(@NotNull Set<QName> headers) {
   100     public void setPortKnownHeaders(@NotNull Set<QName> headers) {
    98         this.portKnownHeaders = headers;
   101 
       
   102         try{
       
   103           lock.lock();
       
   104           this.portKnownHeaders = headers;
       
   105                 } finally {
       
   106                 lock.unlock();
       
   107         }
    99     }
   108     }
   100 
   109 
   101     /**
   110     /**
   102      * TODO A feature should be created to configure processing of MU headers.
   111      * TODO A feature should be created to configure processing of MU headers.
   103      * @param header
   112      * @param header