@@ -0,0 +1,2704 @@
+/**%0A *        Licensed to the Apache Software Foundation (ASF) under one%0A *        or more contributor license agreements.  See the NOTICE file%0A *        distributed with this work for additional information%0A *        regarding copyright ownership.  The ASF licenses this file%0A *        to you under the Apache License, Version 2.0 (the%0A *        %22License%22); you may not use this file except in compliance%0A *        with the License.  You may obtain a copy of the License at%0A *%0A *          http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *        Unless required by applicable law or agreed to in writing,%0A *        software distributed under the License is distributed on an%0A *        %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *        KIND, either express or implied.  See the License for the%0A *        specific language governing permissions and limitations%0A *        under the License.%0A *%0A */%0Apackage org.xeustechnologies.jcl;%0A%0Aimport java.io.InputStream;%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0A/**%0A * %0A * CompositeProxyClassLoader implement a composite of delegate class loader.%0A * %0A * @author %3Ca href=%22mailto:jguibert@intelligents-ia.com%22 %3EJerome Guibert%3C/a%3E%0A * %0A */%0Apublic class CompositeProxyClassLoader extends ProxyClassLoader %7B%0A%09private final List%3CProxyClassLoader%3E proxyClassLoaders = new ArrayList%3CProxyClassLoader%3E();%0A%0A%09/**%0A%09 * Build a new instance of CompositeProxyClassLoader.java.%0A%09 */%0A%09public CompositeProxyClassLoader() %7B%0A%09%09super();%0A%09%7D%0A%0A%09@SuppressWarnings(%22rawtypes%22) %0A%09public Class loadClass(String className, boolean resolveIt) %7B%0A%09%09Class result = null;%0A%09%09Iterator%3CProxyClassLoader%3E iterator = proxyClassLoaders.iterator();%0A%09%09while (result == null && iterator.hasNext()) %7B%0A%09%09%09result = iterator.next().loadClass(className, resolveIt);%0A%09%09%7D%0A%09%09return result;%0A%09%7D%0A %0A%09public InputStream loadResource(String name) %7B%0A%09%09InputStream result = null;%0A%09%09Iterator%3CProxyClassLoader%3E iterator = proxyClassLoaders.iterator();%0A%09%09while (result == null && iterator.hasNext()) %7B%0A%09%09%09result = iterator.next().loadResource(name);%0A%09%09%7D%0A%09%09return result;%0A%09%7D%0A%0A%09/**%0A%09 * @return%0A%09 * @see java.util.List#isEmpty()%0A%09 */%0A%09public boolean isEmpty() %7B%0A%09%09return proxyClassLoaders.isEmpty();%0A%09%7D%0A%0A%09public boolean contains(Object o) %7B%0A%09%09return proxyClassLoaders.contains(o);%0A%09%7D%0A%0A%09public boolean add(ProxyClassLoader e) %7B%0A%09%09return proxyClassLoaders.add(e);%0A%09%7D%0A%0A%09public boolean remove(ProxyClassLoader o) %7B%0A%09%09return proxyClassLoaders.remove(o);%0A%09%7D%0A%0A%09public boolean addAll(Collection%3C? extends ProxyClassLoader%3E c) %7B%0A%09%09return proxyClassLoaders.addAll(c);%0A%09%7D%0A%0A%09public List%3CProxyClassLoader%3E getProxyClassLoaders() %7B%0A%09%09return proxyClassLoaders;%0A%09%7D%0A%7D%0A

add composite proxy class loader of proxy class loader