src/share/jaxws_classes/com/sun/tools/internal/ws/Invoker.java

changeset 368
0989ad8c0860
parent 286
f50545b5e2f1
child 637
9c07ef4934dd
     1.1 --- a/src/share/jaxws_classes/com/sun/tools/internal/ws/Invoker.java	Thu Apr 04 19:05:24 2013 -0700
     1.2 +++ b/src/share/jaxws_classes/com/sun/tools/internal/ws/Invoker.java	Tue Apr 09 14:51:13 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -55,6 +55,45 @@
    1.11   * @author Kohsuke Kawaguchi
    1.12   */
    1.13  public final class Invoker {
    1.14 +
    1.15 +    /**
    1.16 +     * The list of package prefixes we want the
    1.17 +     * {@link MaskingClassLoader} to prevent the parent
    1.18 +     * classLoader from loading
    1.19 +     */
    1.20 +    static final String[] maskedPackages = new String[]{
    1.21 +            "com.sun.istack.internal.tools.",
    1.22 +            "com.sun.tools.internal.jxc.",
    1.23 +            "com.sun.tools.internal.xjc.",
    1.24 +            "com.sun.tools.internal.ws.",
    1.25 +            "com.sun.codemodel.internal.",
    1.26 +            "com.sun.relaxng.",
    1.27 +            "com.sun.xml.internal.xsom.",
    1.28 +            "com.sun.xml.internal.bind.",
    1.29 +            "com.ctc.wstx.", //wsimport, wsgen ant task
    1.30 +            "org.codehaus.stax2.", //wsimport, wsgen ant task
    1.31 +            "com.sun.xml.internal.messaging.saaj.", //wsgen ant task
    1.32 +            "com.sun.xml.internal.ws.",
    1.33 +            "com.oracle.webservices.internal.api." //wsgen
    1.34 +    };
    1.35 +
    1.36 +    /**
    1.37 +     * Escape hatch to work around IBM JDK problem.
    1.38 +     * See http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?nav=false&forum=367&thread=164718&cat=10
    1.39 +     */
    1.40 +    public static final boolean noSystemProxies;
    1.41 +
    1.42 +    static {
    1.43 +        boolean noSysProxiesProperty = false;
    1.44 +        try {
    1.45 +            noSysProxiesProperty = Boolean.getBoolean(Invoker.class.getName()+".noSystemProxies");
    1.46 +        } catch(SecurityException e) {
    1.47 +            // ignore
    1.48 +        } finally {
    1.49 +            noSystemProxies = noSysProxiesProperty;
    1.50 +        }
    1.51 +    }
    1.52 +
    1.53      static int invoke(String mainClass, String[] args) throws Throwable {
    1.54          // use the platform default proxy if available.
    1.55          // see sun.net.spi.DefaultProxySelector for details.
    1.56 @@ -107,7 +146,7 @@
    1.57  
    1.58                      // finally load the rest of the RI. The actual class files are loaded from ancestors
    1.59                      cl = new ParallelWorldClassLoader(cl,"");
    1.60 -                }
    1.61 +                        }
    1.62  
    1.63              }
    1.64  
    1.65 @@ -194,29 +233,6 @@
    1.66      }
    1.67  
    1.68      /**
    1.69 -     * Creates a classloader for loading JAXB/WS 2.1 jar and tools.jar
    1.70 -     */
    1.71 -    private static URL[] findIstack21APIs(ClassLoader cl) throws ClassNotFoundException, MalformedURLException, ToolsJarNotFoundException {
    1.72 -        List<URL> urls = new ArrayList<URL>();
    1.73 -
    1.74 -        if(Service.class.getClassLoader()==null) {
    1.75 -            // JAX-WS API is loaded from bootstrap classloader
    1.76 -            URL res = cl.getResource("javax/xml/ws/EndpointReference.class");
    1.77 -            if(res==null)
    1.78 -                throw new ClassNotFoundException("There's no JAX-WS 2.1 API in the classpath");
    1.79 -            urls.add(ParallelWorldClassLoader.toJarUrl(res));
    1.80 -
    1.81 -            res = cl.getResource("javax/xml/bind/annotation/XmlSeeAlso.class");
    1.82 -            if(res==null)
    1.83 -                throw new ClassNotFoundException("There's no JAXB 2.1 API in the classpath");
    1.84 -            urls.add(ParallelWorldClassLoader.toJarUrl(res));
    1.85 -        }
    1.86 -
    1.87 -        findToolsJar(cl, urls);
    1.88 -
    1.89 -        return urls.toArray(new URL[urls.size()]);
    1.90 -    }
    1.91 -    /**
    1.92       * Creates a classloader for loading JAXB/WS 2.2 jar and tools.jar
    1.93       */
    1.94      private static URL[] findIstack22APIs(ClassLoader cl) throws ClassNotFoundException, IOException, ToolsJarNotFoundException {
    1.95 @@ -258,37 +274,4 @@
    1.96          }
    1.97      }
    1.98  
    1.99 -    /**
   1.100 -     * The list of package prefixes we want the
   1.101 -     * {@link MaskingClassLoader} to prevent the parent
   1.102 -     * classLoader from loading
   1.103 -     */
   1.104 -    public static String[] maskedPackages = new String[]{
   1.105 -        "com.sun.istack.internal.tools.",
   1.106 -        "com.sun.tools.internal.jxc.",
   1.107 -        "com.sun.tools.internal.xjc.",
   1.108 -        "com.sun.tools.internal.ws.",
   1.109 -        "com.sun.codemodel.internal.",
   1.110 -        "com.sun.relaxng.",
   1.111 -        "com.sun.xml.internal.xsom.",
   1.112 -        "com.sun.xml.internal.bind.",
   1.113 -        "com.ctc.wstx.", //wsimport, wsgen ant task
   1.114 -        "org.codehaus.stax2.", //wsimport, wsgen ant task
   1.115 -        "com.sun.xml.internal.messaging.saaj.", //wsgen ant task
   1.116 -        "com.sun.xml.internal.ws."
   1.117 -    };
   1.118 -
   1.119 -    /**
   1.120 -     * Escape hatch to work around IBM JDK problem.
   1.121 -     * See http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?nav=false&forum=367&thread=164718&cat=10
   1.122 -     */
   1.123 -    public static boolean noSystemProxies = false;
   1.124 -
   1.125 -    static {
   1.126 -        try {
   1.127 -            noSystemProxies = Boolean.getBoolean(Invoker.class.getName()+".noSystemProxies");
   1.128 -        } catch(SecurityException e) {
   1.129 -            // ignore
   1.130 -        }
   1.131 -    }
   1.132  }

mercurial