| Introduction | How to use | ClassLoader | Serialization | Reflection | Attributes | Mechanism |
Through the build in Metainformation of ACDK classes can be loacated
and loaded by name.
Content of this chapter: |
static acdk::lang::Class::forName(IN(RString) className);
a class can be located.RObject acdk::lang::Class::newInstance();
a new Instance
of this object can be created as long there is a public default constructor or the
class implements the method static RObject create_instance()
.Class::forName
look if class already loaded. In this case returns the Class.acdk_security_SHAMessageDigest.dll/.so
.acdk_security.dll/.so
.acdk_security.dll/.so
can be found in $ACDKHOME/bin
the library
will be loaded. At load time all ACDK classes are registered into
the local ACDK class registry.
RClass digestclass = Class::forName("acdk/security/SHAMessageDigest"); /* With the Class instance a new object instance can be created, and can be casted to a known interface (here MessageDigest). */ RMessageDigest digest = (RMessageDigest)digestclass->newInstance(); |
acdk.cfg
(located at $ACDKHOME/cfg
) as a map
# define an alias for a given namespace to a library name # used by the classloader to find the shared library for # a given class. This sample load the libary org_xml if searching # for mapped org.w3c.* acdk.lang.ClassLoader.libalias.org_w3c=org_xml