1 /* |
1 /* |
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, 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 |
22 * or visit www.oracle.com if you need additional information or have any |
22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package com.sun.xml.internal.ws.api; |
26 package com.sun.xml.internal.ws.api; |
27 |
|
28 |
27 |
29 import com.sun.istack.internal.Nullable; |
28 import com.sun.istack.internal.Nullable; |
30 |
29 |
31 import javax.xml.ws.WebServiceException; |
30 import javax.xml.ws.WebServiceException; |
32 import java.io.IOException; |
31 import java.io.IOException; |
153 |
152 |
154 private Proxy chooseProxy() { |
153 private Proxy chooseProxy() { |
155 ProxySelector sel = |
154 ProxySelector sel = |
156 java.security.AccessController.doPrivileged( |
155 java.security.AccessController.doPrivileged( |
157 new java.security.PrivilegedAction<ProxySelector>() { |
156 new java.security.PrivilegedAction<ProxySelector>() { |
|
157 @Override |
158 public ProxySelector run() { |
158 public ProxySelector run() { |
159 return ProxySelector.getDefault(); |
159 return ProxySelector.getDefault(); |
160 } |
160 } |
161 }); |
161 }); |
162 |
162 |
207 * @throws AssertionError |
207 * @throws AssertionError |
208 * if this endpoint doesn't have an associated URL. |
208 * if this endpoint doesn't have an associated URL. |
209 * if the code is written correctly this shall never happen. |
209 * if the code is written correctly this shall never happen. |
210 */ |
210 */ |
211 public URLConnection openConnection() throws IOException { |
211 public URLConnection openConnection() throws IOException { |
212 assert url!=null : uri+" doesn't have the corresponding URL"; |
|
213 if (url == null) { |
212 if (url == null) { |
214 throw new WebServiceException("URI="+uri+" doesn't have the corresponding URL"); |
213 throw new WebServiceException("URI="+uri+" doesn't have the corresponding URL"); |
215 } |
214 } |
216 if(proxy!=null && !dontUseProxyMethod) { |
215 if(proxy!=null && !dontUseProxyMethod) { |
217 try { |
216 try { |