org.huihoo.jfox.ejb.server
Class SafeToolkit

java.lang.Object
  |
  +--org.huihoo.jfox.ejb.server.SafeToolkit

public class SafeToolkit
extends java.lang.Object

Version:
$0.9.0$
Author:
tai_1219@sina.com

Method Summary
 java.lang.Class forName(java.lang.String className)
          Attempts to find and load the specified class.
 java.lang.Class forName(java.lang.String className, java.lang.String codebase)
          Attempts to find and load the specified class, using the specified codebase.
static org.huihoo.jfox.ejb.server.SafeToolkit getToolkit(java.lang.String systemLocation)
          Returns an instance of a SafeToolkit dedicated to the specified system location.
static java.lang.Class loadClass(java.lang.String className, java.lang.String codebase)
          Loads the class using the class loader for the specific codebase.
static java.lang.Object newInstance(java.lang.Class clazz)
          Attempts to instaniate the specified class.
 java.lang.Object newInstance(java.lang.String className)
          Attempts to find and load the specified class then instaniate it.
 java.lang.Object newInstance(java.lang.String className, java.lang.String codebase)
          Attempts to find and load the specified class then instaniate it.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getToolkit

public static org.huihoo.jfox.ejb.server.SafeToolkit getToolkit(java.lang.String systemLocation)
Returns an instance of a SafeToolkit dedicated to the specified system location.

Parameters:
systemLocation -
Returns:
SafeToolkit

forName

public java.lang.Class forName(java.lang.String className)
                        throws java.lang.Exception
Attempts to find and load the specified class.

Parameters:
className - the name of the class to be loaded.
Throws:
OpenEJBExcption - if the class cannot be found.@throws java.lang.Exception
java.lang.Exception

forName

public java.lang.Class forName(java.lang.String className,
                               java.lang.String codebase)
                        throws java.lang.Exception
Attempts to find and load the specified class, using the specified codebase. If the codebase is null, the bootstrap classloader is used.

Parameters:
className - the name of the class to be loaded.
codebase - the codebase to load the class from.
Throws:
OpenEJBExcption - if the class cannot be found.@throws java.lang.Exception
java.lang.Exception

newInstance

public java.lang.Object newInstance(java.lang.String className)
                             throws java.lang.Exception
Attempts to find and load the specified class then instaniate it.

Parameters:
className - the name of the class to be instantiated.
Throws:
OpenEJBException - if the class cannot be found or is not accessible .@throws java.lang.Exception
java.lang.Exception

newInstance

public java.lang.Object newInstance(java.lang.String className,
                                    java.lang.String codebase)
                             throws java.lang.Exception
Attempts to find and load the specified class then instaniate it.

Parameters:
className - the name of the class to be instantiated.
codebase -
Throws:
OpenEJBException - if the class cannot be found or is not accessible .@throws java.lang.Exception
java.lang.Exception

newInstance

public static java.lang.Object newInstance(java.lang.Class clazz)
                                    throws java.lang.Exception
Attempts to instaniate the specified class.

Parameters:
clazz -
Throws:
OpenEJBException - if the class is not accessible .@throws java.lang.Exception
java.lang.Exception

loadClass

public static java.lang.Class loadClass(java.lang.String className,
                                        java.lang.String codebase)
                                 throws java.lang.Exception
Loads the class using the class loader for the specific codebase. If the codebase is null, the bootstrap classloader is used.

Parameters:
className -
codebase -
Returns:
Throws:
java.lang.Exception
java.lang.ClassNotFoundException
OpenEJBException