javax.xml.ws.spi.FactoryFinder Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package javax.xml.ws.spi;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.PrivilegedAction;
import java.util.Properties;
import org.apache.geronimo.osgi.locator.ProviderLocator;
/**
* This code is designed to implement the pluggability
* feature and is designed to both compile and run on JDK version 1.1 and
* later. The code also runs both as part of an unbundled jar file and
* when bundled as part of the JDK.
*
* This class is duplicated for each subpackage so keep it in sync.
* It is package private and therefore is not exposed as part of the JAXWS
* API.
*/
class FactoryFinder {
/**
* Set to true for debugging.
*/
private static final boolean debug = false;
private static void debugPrintln(String msg) {
if (debug) {
System.err.println("Factory Finder:" + msg);
}
}
/**
* Figure out which ClassLoader to use. For JDK 1.2 and later use
* the context ClassLoader.
*
* @return the ClassLoader
* @throws ConfigurationError if this class is unable to work with the
* host JDK
*/
private static ClassLoader findClassLoader()
throws ConfigurationError {
// REVIEW This doPriv block may be unnecessary because this method is private and
// the caller already has a doPriv. I added the doPriv in case someone changes the
// visibility of this method to non-private.
ClassLoader cl = (ClassLoader)
doPrivileged( new PrivilegedAction
© 2015 - 2024 Weber Informatics LLC | Privacy Policy