src/share/jaxws_classes/com/sun/xml/internal/ws/client/SCAnnotations.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
equal deleted inserted replaced
366:8c0b6bccfe47 368:0989ad8c0860
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
32 import javax.xml.ws.WebEndpoint; 32 import javax.xml.ws.WebEndpoint;
33 import javax.xml.ws.WebServiceClient; 33 import javax.xml.ws.WebServiceClient;
34 import javax.xml.ws.WebServiceException; 34 import javax.xml.ws.WebServiceException;
35 import java.io.IOException; 35 import java.io.IOException;
36 import java.lang.reflect.Method; 36 import java.lang.reflect.Method;
37 import java.net.URL;
38 import java.security.AccessController; 37 import java.security.AccessController;
39 import java.security.PrivilegedAction; 38 import java.security.PrivilegedAction;
40 import java.util.ArrayList; 39 import java.util.ArrayList;
41 40
42 /** 41 /**
46 * @author Kohsuke Kawaguchi 45 * @author Kohsuke Kawaguchi
47 */ 46 */
48 final class SCAnnotations { 47 final class SCAnnotations {
49 SCAnnotations(final Class<?> sc) { 48 SCAnnotations(final Class<?> sc) {
50 AccessController.doPrivileged(new PrivilegedAction<Void>() { 49 AccessController.doPrivileged(new PrivilegedAction<Void>() {
50 @Override
51 public Void run() { 51 public Void run() {
52 WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class); 52 WebServiceClient wsc =sc.getAnnotation(WebServiceClient.class);
53 if(wsc==null) 53 if(wsc==null) {
54 throw new WebServiceException("Service Interface Annotations required, exiting..."); 54 throw new WebServiceException("Service Interface Annotations required, exiting...");
55 }
55 56
56 String name = wsc.name();
57 String tns = wsc.targetNamespace(); 57 String tns = wsc.targetNamespace();
58 serviceQName = new QName(tns, name);
59 try { 58 try {
60 wsdlLocation = JAXWSUtils.getFileOrURL(wsc.wsdlLocation()); 59 JAXWSUtils.getFileOrURL(wsc.wsdlLocation());
61 } catch (IOException e) { 60 } catch (IOException e) {
62 // TODO: report a reasonable error message 61 // TODO: report a reasonable error message
63 throw new WebServiceException(e); 62 throw new WebServiceException(e);
64 } 63 }
65 64
79 return null; 78 return null;
80 } 79 }
81 }); 80 });
82 } 81 }
83 82
84 QName serviceQName;
85 final ArrayList<QName> portQNames = new ArrayList<QName>(); 83 final ArrayList<QName> portQNames = new ArrayList<QName>();
86 final ArrayList<Class> classes = new ArrayList<Class>(); 84 final ArrayList<Class> classes = new ArrayList<Class>();
87 URL wsdlLocation;
88 } 85 }

mercurial