|
SAP NetWeaver 7.40 SP 07 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
com.sapportals.wcm.crt.CrtClassLoaderRegistry
public final class CrtClassLoaderRegistry
Provides a registry for class loaders.
getClassLoader() provides a class loader that aggregates all registered class loaders to find
and load classes and resources.
The following code shows an example how to use this registry:
// register your personal class loader (this should be done only once)
CrtClassLoaderRegistry.addClassLoader( MyPrettyCoolClass.class.getClassLoader() );
...
// load another class with this class loader
MyOtherClass myOtherInstance = null;
try {
Class myOtherClass = CrtClassLoaderRegistry.forName( "com.company.prg.MyOtherClass" );
myOtherInstance = (MyOtherClass)myOtherClass.newInstance();
}
catch( .... x ) {
....
}
Copyright (c) SAP AG 2001-2006
| Method Summary | |
|---|---|
static void |
addClassLoader(ClassLoader newLoader)
Register a class loader to the component runtime. |
static void |
addClassLoader(String id,
ClassLoader newLoader)
Register a class loader with an optional id to the component runtime. |
static void |
addClassLoader(String id,
ClassLoader newLoader,
Set hints)
Register a class loader with an optional id to the component runtime. |
static void |
addClassLoaderRegistryListener(IClassLoaderRegistryListener l)
|
static boolean |
allPluginsRegistered()
|
static void |
cleanUp()
Do some cleanups to minimize effects of a leaking CrtClassLoaderRegistry class definition |
static void |
defineRegistrationPhaseAsFinished()
|
static void |
disableNewClassLoaders()
|
protected Class |
findClass(String name)
|
protected URL |
findResource(String name)
|
protected Enumeration |
findResources(String name)
|
static Class |
forName(String className)
Returns the Class object associated with the class or interface with the given string name, using
this registry. |
static ClassLoader |
getClassLoader()
Returns the component runtime default class loader. |
static String |
getHotDeploymentOccurredMessage()
|
static boolean |
isServerStartup()
|
static void |
removeClassLoaderRegistryListener(IClassLoaderRegistryListener l)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
protected Class findClass(String name)
throws ClassNotFoundException
findClass in class ClassLoaderClassNotFoundException
protected Enumeration findResources(String name)
throws IOException
findResources in class ClassLoaderIOExceptionprotected URL findResource(String name)
findResource in class ClassLoaderpublic static void addClassLoader(ClassLoader newLoader)
newLoader - The new class loader instance to be added.
public static void addClassLoader(String id,
ClassLoader newLoader)
newLoader .
If newLoader is null the class loader with
id is removed.
If id is null the class loader is added anonymous and cannot be removed.
id - The optional id of this class loadernewLoader - The new class loader instance to be added.
public static void addClassLoader(String id,
ClassLoader newLoader,
Set hints)
newLoader .
This method is meant as a hook for improved class loading speed. Each class loader newLoader
registered comes bundled with a set of Java package names that are in this loaders scope.
id - The id of this class loader (if no id is provided, an automatically generated one will be used)newLoader - The new class loader instance to be addedhints - A set of package names in the loader's scopepublic static ClassLoader getClassLoader()
public static Class forName(String className)
throws ClassNotFoundException
Class object associated with the class or interface with the given string name, using
this registry.
className -
ClassNotFoundExceptionpublic static String getHotDeploymentOccurredMessage()
public static boolean isServerStartup()
true if the current startup is caused by a server restart, false if this startup is caused bypublic static void defineRegistrationPhaseAsFinished()
public static boolean allPluginsRegistered()
public static void addClassLoaderRegistryListener(IClassLoaderRegistryListener l)
public static void removeClassLoaderRegistryListener(IClassLoaderRegistryListener l)
public static void disableNewClassLoaders()
public static void cleanUp()
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
|
SAP NetWeaver 7.40 SP 07 KMC | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||