irssibot.core
Class ModuleLoader

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--irssibot.core.ModuleLoader

class ModuleLoader
extends java.lang.ClassLoader

A custom ClassLoader to load and unload modules.

Version:
$Name: $ $Revision: 1.7 $
Author:
Matti Dahlbom

Nested Class Summary
 
Nested classes inherited from class java.lang.ClassLoader
 
Field Summary
private static java.lang.String info
          Component info string to be returned by toString()
private  java.lang.String moduleBaseDir
          Module base dir.
 
Fields inherited from class java.lang.ClassLoader
 
Constructor Summary
ModuleLoader(java.lang.String moduleBaseDir)
          Constructs.
 
Method Summary
 java.lang.Class loadClass(java.lang.String name)
          Loads an IrssiBot module from disk.
private  byte[] loadClassData(java.lang.String fileName)
          Loads binary class data from disk.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

info

private static java.lang.String info
Component info string to be returned by toString()


moduleBaseDir

private java.lang.String moduleBaseDir
Module base dir.

Constructor Detail

ModuleLoader

public ModuleLoader(java.lang.String moduleBaseDir)
Constructs.

Parameters:
moduleBaseDir - module base dir
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

loadClass

public java.lang.Class loadClass(java.lang.String name)
                          throws java.lang.ClassNotFoundException
Loads an IrssiBot module from disk.

Overrides:
loadClass in class java.lang.ClassLoader
Parameters:
name - module class name to load
Returns:
module class
java.lang.ClassNotFoundException

loadClassData

private byte[] loadClassData(java.lang.String fileName)
                      throws java.io.IOException
Loads binary class data from disk.

Parameters:
fileName - file name
Returns:
bytecodes
java.io.IOException


IrssiBot (c) 2000-2002 Matti Dahlbom