artefaktur
software engineer &        architecture

 
 
 
 

class ClassLoader

Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::lang::ClassLoader Class Reference

#include <ClassLoader.h>

Inheritance diagram for acdk::lang::ClassLoader:

acdk::lang::Object acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch acdk::cfgscript::ScriptClassLoader List of all members.

Detailed Description

ClassLoader find and loads new classes.

API: Java Modified Note Will be used with SharedLibrary and/or the common type library.

Author:
Roger Rene Kommer
Version:
Revision
1.25
Date:
Date
2005/04/09 19:26:48
See also:
 ClassLoader

ResourceBundle

Package

Class

Bug:
some function, which enables loaded Java-Classes from remote are not implemented


Public Member Functions

 ClassLoader ()
 ClassLoader (IN(RClassLoader) parent)
virtual RClass defineClass (IN(RString) name, IN(RbyteArray) b, int off, int len)
 This method is not implemented.

virtual RClass findClass (IN(RString) name, bool nothrow=false) throw ( RClassNotFoundException )
 Try to find a class by name.

virtual bool loadClassLibrary (IN(RString) classname)
virtual RString findLibrary (IN(RString) libname)
 Try to find and load a library corresponding the package name.

virtual RString findLibrary2 (IN(RString) libname)
virtual RClass findLoadedClass (IN(RString) name, bool nothrow=true) throw ( RClassNotFoundException )
 find a class, which is already loaded

virtual RClass findSystemClass (IN(RString) name) throw ( RClassNotFoundException )
 just return findClass(name)

virtual RPackage getPackage (IN(RString) name)
 Method is not implemented.

virtual RPackageArray getPackages ()
 Method is not implemented.

virtual RClassLoader getParent ()
virtual acdk::io::RFile findResource (IN(RString) name)
 return a ressource located by name otherwise Nil

virtual acdk::util::RIterator findResources (IN(RString) name)
 return iterator to acdk::io::RFile

virtual acdk::io::RFile getResource (IN(RString) name)
 Different to Java this method returns a File (which may also contain URL).

virtual acdk::io::RReader getResourceAsStream (IN(RString) name)
 is equaly to getResource(name)->getReader()

virtual acdk::util::RIterator getResources (IN(RString) name)
 return iterator to acdk::io::RFile

virtual RClass loadClass (IN(RString) name) throw ( RClassNotFoundException )
virtual RClass loadClass (IN(RString) name, bool resolve) throw ( RClassNotFoundException )
virtual acdk::lang::reflect::RUnit loadUnit (IN(RString) name) throw ( RClassNotFoundException )
 try to load Unit.

virtual bool loadMetaInfoLibrary (IN(RString) classname)
 try to load metainfo library of given class

virtual bool loadDmiProxyLibrary (IN(RString) classname)
 try to load dmi proxy library of given class

virtual void resolveClass (IN(RClass) c)
 Method has no functionality.

virtual void setSigners (IN(RClass) c, IN(RObjectArray) signers)
 Method is not implemented.

void registerClassLoader (IN(RClassLoader) classLoader)

Static Public Member Functions

acdk::io::RFile getSystemResource (IN(RString) name)
acdk::io::RReader getSystemResourceAsStream (IN(RString) name)
 returns getSystemClassLoader()->getResourceAsStream()

acdk::util::RIterator getSystemResources (IN(RString) name)
 return getSystemClassLoader()->getSystemResources(name)

RClassLoader getSystemClassLoader ()
 The normal ClassLoader which loads native ACDK classes and libraries.


Protected Member Functions

bool loadExtInfoLibrary (IN(RString) classname, IN(RString) sufix)

Static Protected Member Functions

 OUT (RClassLoader) _getSystemClassLoader()

Protected Attributes

RClassLoader _parent
RClassLoaderArray _registeredClassLoader

Constructor & Destructor Documentation

acdk::lang::ClassLoader::ClassLoader  ) 
 

acdk::lang::ClassLoader::ClassLoader IN(RClassLoader parent  ) 
 


Member Function Documentation

virtual RClass acdk::lang::ClassLoader::defineClass IN(RString name,
IN(RbyteArray b,
int  off,
int  len
[virtual]
 

This method is not implemented.

virtual RClass acdk::lang::ClassLoader::findClass IN(RString name,
bool  nothrow = false
throw ( RClassNotFoundException ) [virtual]
 

Try to find a class by name.

If the class currently is not loaded it uses the acdk::lang::SharedLibrary to find a shared library which mapps the full class name or parts of the namespace. It uses following pattern: findClass(acdk::security::GeneralSecurityException) try to load following librares: Unix: acdk_security_GeneralSecurityException.so acdk_security.so acdk.so Windows (Debug-Release): acdk_security_GeneralSecurityException_d.dll acdk_security_d.dll acdk_d.dll

See also:
also ClassLoader::findLibrary
Parameters:
name of the class in one of following forms: acdk::security::GeneralSecurityException acdk.security.GeneralSecurityException acdk/security/GeneralSecurityException
nothrow,if true method does't throw ex if not found
Returns:
the loaded class if found otherwise Nil

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual RString acdk::lang::ClassLoader::findLibrary IN(RString libname  )  [virtual]
 

Try to find and load a library corresponding the package name.

this method consul the property acdk.lang.ClassLoaderAliase if there are any aliase. It checks param libname starts with a key of an alias. if yes it replaces the beginning of libname with the value defined in the property.

Parameters:
libname name of the library without extends For example acdk_security try to load acdk_security_d.dll (Windows Debug) or acdk_security.so (Unix)
Returns:
the name of the loaded library. Otherwise Nil.

virtual RString acdk::lang::ClassLoader::findLibrary2 IN(RString libname  )  [virtual]
 

Parameters:
libname name of the library without extends For example acdk_security try to load acdk_security_d.dll (Windows Debug) or acdk_security.so (Unix)
Returns:
the name of the loaded library. Otherwise Nil.

virtual RClass acdk::lang::ClassLoader::findLoadedClass IN(RString name,
bool  nothrow = true
throw ( RClassNotFoundException ) [virtual]
 

find a class, which is already loaded

Parameters:
name of the class
Returns:
the Class corresponds to the name. Nil if the class is not loaded

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual acdk::io::RFile acdk::lang::ClassLoader::findResource IN(RString name  )  [virtual]
 

return a ressource located by name otherwise Nil

Parameters:
name identifies a file resource like acdk/locale/LocaleInfo.properties

virtual acdk::util::RIterator acdk::lang::ClassLoader::findResources IN(RString name  )  [virtual]
 

return iterator to acdk::io::RFile

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual RClass acdk::lang::ClassLoader::findSystemClass IN(RString name  )  throw ( RClassNotFoundException ) [virtual]
 

just return findClass(name)

virtual RPackage acdk::lang::ClassLoader::getPackage IN(RString name  )  [virtual]
 

Method is not implemented.

virtual RPackageArray acdk::lang::ClassLoader::getPackages  )  [virtual]
 

Method is not implemented.

virtual RClassLoader acdk::lang::ClassLoader::getParent  )  [inline, virtual]
 

Returns:
the parent Classloader if any otherwise Nil

virtual acdk::io::RFile acdk::lang::ClassLoader::getResource IN(RString name  )  [virtual]
 

Different to Java this method returns a File (which may also contain URL).

virtual acdk::io::RReader acdk::lang::ClassLoader::getResourceAsStream IN(RString name  )  [virtual]
 

is equaly to getResource(name)->getReader()

virtual acdk::util::RIterator acdk::lang::ClassLoader::getResources IN(RString name  )  [virtual]
 

return iterator to acdk::io::RFile

RClassLoader acdk::lang::ClassLoader::getSystemClassLoader  )  [static]
 

The normal ClassLoader which loads native ACDK classes and libraries.

Returns:
the SystemClassLoader

acdk::io::RFile acdk::lang::ClassLoader::getSystemResource IN(RString name  )  [static]
 

acdk::io::RReader acdk::lang::ClassLoader::getSystemResourceAsStream IN(RString name  )  [static]
 

returns getSystemClassLoader()->getResourceAsStream()

acdk::util::RIterator acdk::lang::ClassLoader::getSystemResources IN(RString name  )  [static]
 

return getSystemClassLoader()->getSystemResources(name)

virtual RClass acdk::lang::ClassLoader::loadClass IN(RString name,
bool  resolve
throw ( RClassNotFoundException ) [virtual]
 

Parameters:
resolve has no effect

virtual RClass acdk::lang::ClassLoader::loadClass IN(RString name  )  throw ( RClassNotFoundException ) [virtual]
 

virtual bool acdk::lang::ClassLoader::loadClassLibrary IN(RString classname  )  [virtual]
 

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual bool acdk::lang::ClassLoader::loadDmiProxyLibrary IN(RString classname  )  [virtual]
 

try to load dmi proxy library of given class

Returns:
false if no meta info library can be found

Reimplemented in acdk::cfgscript::ScriptClassLoader.

bool acdk::lang::ClassLoader::loadExtInfoLibrary IN(RString classname,
IN(RString sufix
[protected]
 

virtual bool acdk::lang::ClassLoader::loadMetaInfoLibrary IN(RString classname  )  [virtual]
 

try to load metainfo library of given class

Returns:
false if no meta info library can be found

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual acdk::lang::reflect::RUnit acdk::lang::ClassLoader::loadUnit IN(RString name  )  throw ( RClassNotFoundException ) [virtual]
 

try to load Unit.

Tries to load also shared library

acdk::lang::ClassLoader::OUT RClassLoader   )  [static, protected]
 

void acdk::lang::ClassLoader::registerClassLoader IN(RClassLoader classLoader  )  [inline]
 

virtual void acdk::lang::ClassLoader::resolveClass IN(RClass c  )  [virtual]
 

Method has no functionality.

Reimplemented in acdk::cfgscript::ScriptClassLoader.

virtual void acdk::lang::ClassLoader::setSigners IN(RClass c,
IN(RObjectArray signers
[virtual]
 

Method is not implemented.


Member Data Documentation

RClassLoader acdk::lang::ClassLoader::_parent [protected]
 

RClassLoaderArray acdk::lang::ClassLoader::_registeredClassLoader [protected]
 

 
Last modified 2005-05-08 18:32 by SYSTEM By Artefaktur, Ing. Bureau Kommer