01: /*
02: * Javux - Java Component Set
03: * Copyright (c) 2005-2007 Krzysztof A. Sadlocha
04: * e-mail: ksadlocha@programics.com
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: package com.javujavu.javux.app.compat;
22:
23: import com.javujavu.javux.app.JavuPlugClassLoader;
24: import com.javujavu.javux.app.JavuPlugJarClassLoader;
25:
26: public class PlugLoader12 extends PlugLoader {
27: ///////////////////////////////////////////////////
28: // implementation
29:
30: protected ClassLoader createLoaderImpl(ClassLoader parent) {
31: return new JavuPlugClassLoader(parent);
32: }
33:
34: protected ClassLoader getJarLoaderImpl(ClassLoader cl, String file) {
35: return ((JavuPlugClassLoader) cl).getJarLoader(file);
36: }
37:
38: protected ClassLoader loadJarImpl(ClassLoader cl, String file) {
39: return ((JavuPlugClassLoader) cl).loadJar(file);
40: }
41:
42: protected void unloadJarImpl(ClassLoader cl, String file) {
43: ((JavuPlugClassLoader) cl).unloadJar(file);
44: }
45:
46: protected void unloadAllJarsImpl(ClassLoader cl) {
47: ((JavuPlugClassLoader) cl).unloadAllJars();
48: }
49:
50: protected ClassLoader[] listPluginLoadersImpl(ClassLoader cl,
51: String key) {
52: return ((JavuPlugClassLoader) cl).listPluginLoaders(key);
53: }
54:
55: protected ClassLoader[] listResourceLoadersImpl(ClassLoader cl,
56: String name) {
57: return ((JavuPlugClassLoader) cl).listResourceLoaders(name);
58: }
59:
60: ///////////////////////////////////////////////////
61:
62: protected String getFileNameImpl(ClassLoader cl) {
63: return ((JavuPlugJarClassLoader) cl).getFileName();
64: }
65:
66: protected ClassLoader getPlugLoaderImpl(ClassLoader cl) {
67: return ((JavuPlugJarClassLoader) cl).getParent();
68: }
69:
70: protected Class getPluginClassImpl(ClassLoader cl, String key) {
71: return ((JavuPlugJarClassLoader) cl).getPluginClass(key);
72: }
73:
74: protected Object createPluginImpl(ClassLoader cl, String key,
75: Class requiredClass) {
76: return ((JavuPlugJarClassLoader) cl).createPlugin(key,
77: requiredClass);
78: }
79: }
|