com.pentagaia.tb.start
Interface IPdsClassLoaderExtension

All Known Implementing Classes:
ClassLoaderExtension_0_9_5_1, ClassLoaderExtension_0_9_6, KernelProvider

public interface IPdsClassLoaderExtension

An interface to utilize kernel classes.

Since:
0.1.0
Version:
0.1.0
Author:
mepeisen

Method Summary
 String[] getGlobalClassSet()
          Returns a list of strings that are used to define a global set of classes that are not redefined by child class loaders.
 URL getResource(String name)
          Returns an url of the first resource found by this class loader extension after the class loader tries to resolve the resource by itself.
 URL getResourceFirst(String name)
          Returns an url of the first resource found by this class loader extension before the class loader will try to resolve the resource by itself.
 Enumeration<URL> getResources(String name)
          Returns an enumeration of resources found by this class loader extension
 byte[] loadClass(String className)
          Resolves a new class and tries to load it by this class loader extension.
 Class<?> loadClassExternal(String className)
          Resolves a new class and tries to load it by this class loader extension.
 byte[] loadClassFirst(String className)
          Resolves a new class and tries to load it by this class loader extension.
 byte[] refactorClass(String className, byte[] source)
          Replaces class implementations
 

Method Detail

getGlobalClassSet

String[] getGlobalClassSet()
Returns a list of strings that are used to define a global set of classes that are not redefined by child class loaders. To define a package use syntax some.package.*. To define a class use syntax some.package.SomeClass. To define a package that includes every subsequent packages use syntax some.package.**

Returns:
a global list of packages and classes.

loadClassFirst

byte[] loadClassFirst(String className)
Resolves a new class and tries to load it by this class loader extension. This method will be called before the kernel tries to resolve the class by itself or by the bootstrap classpath.

Parameters:
className - Full qualified class name of the loaded class
Returns:
The byte code usable by class loaders to define the class or null if this extension does not find the class.

loadClass

byte[] loadClass(String className)
Resolves a new class and tries to load it by this class loader extension. This method will be called after the kernel tries to resolve the class and failed.

Parameters:
className - Full qualified class name of the loaded class
Returns:
The byte code usable by class loaders to define the class or null if this extension does not find the class.

refactorClass

byte[] refactorClass(String className,
                     byte[] source)
Replaces class implementations

Parameters:
className - Full qualified class name of the hacked class
source - the source byte code that needs to be replaced.
Returns:
the new byte code usable by class loaders or null if this extension does not support byte code manipulation

loadClassExternal

Class<?> loadClassExternal(String className)
Resolves a new class and tries to load it by this class loader extension. This method will be called after the kernel tries to resolve the class and failed.

Parameters:
className - Full qualified class name of the loaded class
Returns:
The class instance or null if this extension does not find the class.
See Also:
ClassLoader.loadClass(String)

getResources

Enumeration<URL> getResources(String name)
Returns an enumeration of resources found by this class loader extension

Parameters:
name - name of the resource
Returns:
enumeration
See Also:
ClassLoader.getResources(String)

getResource

URL getResource(String name)
Returns an url of the first resource found by this class loader extension after the class loader tries to resolve the resource by itself.

Parameters:
name - name of the resource
Returns:
url to read the resource or null if the resource was not found
See Also:
ClassLoader.getResource(String)

getResourceFirst

URL getResourceFirst(String name)
Returns an url of the first resource found by this class loader extension before the class loader will try to resolve the resource by itself.

Parameters:
name - name of the resource
Returns:
url to read the resource or null if the resource was not found
See Also:
ClassLoader.getResource(String)


Copyright © 2008. All Rights Reserved.