6382N/A * Licensed to the Apache Software Foundation (ASF) under one 6382N/A * or more contributor license agreements. See the NOTICE file 6382N/A * distributed with this work for additional information 6382N/A * regarding copyright ownership. The ASF licenses this file 6382N/A * to you under the Apache License, Version 2.0 (the 6382N/A * "License"); you may not use this file except in compliance 6382N/A * with the License. You may obtain a copy of the License at 6382N/A * Unless required by applicable law or agreed to in writing, 6382N/A * software distributed under the License is distributed on an 6382N/A * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 6382N/A * KIND, either express or implied. See the License for the 6382N/A * specific language governing permissions and limitations 6382N/A * This class is extremely useful for loading resources and classes in a fault 6382N/A * tolerant manner that works across different applications servers. Do not 6382N/A * touch this unless you're a grizzled classloading guru veteran who is going to 6382N/A * verify any change on 6 different application servers. 6382N/A// NOTE! This is a duplicate of utils.ClassLoaderUtils with public 6382N/A// modifiers changed to package-private. Make sure to integrate any future 6382N/A// changes to utils.ClassLoaderUtils to this file. 6382N/A /** {@link org.apache.commons.logging} logging facility */ 6382N/A * Load a given resource. <p/> This method will try to load the resource 6382N/A * using the following methods (in order): 6382N/A * <li>From Thread.currentThread().getContextClassLoader() 6382N/A * <li>From ClassLoaderUtil.class.getClassLoader() 6382N/A * <li>callingClass.getClassLoader() 6382N/A * @param resourceName The name of the resource to load 6382N/A * @param callingClass The Class object of the calling object 6382N/A //certain classloaders need it without the leading / 6382N/A //certain classloaders need it without the leading / 6382N/A * Load a given resources. <p/> This method will try to load the resources 6382N/A * using the following methods (in order): 6382N/A * <li>From Thread.currentThread().getContextClassLoader() 6382N/A * <li>From ClassLoaderUtil.class.getClassLoader() 6382N/A * <li>callingClass.getClassLoader() 6382N/A * @param resourceName The name of the resource to load 6382N/A * @param callingClass The Class object of the calling object 6382N/A //certain classloaders need it without the leading / 6382N/A //certain classloaders need it without the leading / 6382N/A * This is a convenience method to load a resource as a stream. <p/> The 6382N/A * algorithm used to find the resource is given in getResource() 6382N/A * @param resourceName The name of the resource to load 6382N/A * @param callingClass The Class object of the calling object 6382N/A * Load a class with a given name. <p/> It will try to load the class in the 6382N/A * <li>From Thread.currentThread().getContextClassLoader() 6382N/A * <li>Using the basic Class.forName() 6382N/A * <li>From ClassLoaderUtil.class.getClassLoader() 6382N/A * <li>From the callingClass.getClassLoader() 6382N/A * @param className The name of the class to load 6382N/A * @param callingClass The Class object of the calling object 6382N/A * @throws ClassNotFoundException If the class cannot be found anywhere.