KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > baseadaptor > loader > BaseClassLoader


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.osgi.baseadaptor.loader;
13
14 import java.net.URL JavaDoc;
15 import java.security.ProtectionDomain JavaDoc;
16 import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry;
17 import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile;
18 import org.eclipse.osgi.framework.adaptor.BundleClassLoader;
19
20 /**
21  * The actual class loader object used to define classes for a classpath manager.
22  * This interface provides public versions of a few methods on class loader.
23  * @see ClasspathManager
24  * @since 3.2
25  */

26 public interface BaseClassLoader extends BundleClassLoader {
27     /**
28      * Returns the domain for the host bundle of this class loader
29      * @return the domain for the host bundle of this class loader
30      */

31     ProtectionDomain JavaDoc getDomain();
32
33     /**
34      * Creates a classpath entry with the given bundle file and domain
35      * @param bundlefile the source bundle file for a classpath entry
36      * @param cpDomain the source domain for a classpath entry
37      * @return a classpath entry with the given bundle file and domain
38      */

39     ClasspathEntry createClassPathEntry(BundleFile bundlefile, ProtectionDomain JavaDoc cpDomain);
40
41     /**
42      * Defines a Class.
43      * @param name the name of the class to define
44      * @param classbytes the bytes of the class to define
45      * @param classpathEntry the classpath entry used to load the class bytes
46      * @param entry the bundle entry used to load the class bytes
47      * @return a defined Class
48      */

49     Class JavaDoc defineClass(String JavaDoc name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry);
50
51     /**
52      * A public version of the {@link ClassLoader#findLoadedClass(java.lang.String)} method.
53      * @param classname the class name to find.
54      * @return a loaded class
55      */

56     Class JavaDoc publicFindLoaded(String JavaDoc classname);
57
58     /**
59      * A public version of the {@link ClassLoader#getPackage(java.lang.String)} method.
60      * @param pkgname the package name to get.
61      * @return the package or null if it does not exist
62      */

63     Object JavaDoc publicGetPackage(String JavaDoc pkgname);
64
65     /**
66      * A public version of the {@link ClassLoader#definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.net.URL)} method.
67      * @return a defined Package
68      */

69     Object JavaDoc publicDefinePackage(String JavaDoc name, String JavaDoc specTitle, String JavaDoc specVersion, String JavaDoc specVendor, String JavaDoc implTitle, String JavaDoc implVersion, String JavaDoc implVendor, URL JavaDoc sealBase);
70
71     /**
72      * Returns the ClasspathManager for this BaseClassLoader
73      * @return the ClasspathManager
74      */

75     ClasspathManager getClasspathManager();
76 }
77
Popular Tags