com.componio.jlicensure.shared
Class ObjectFactory

java.lang.Object
  extended by com.componio.jlicensure.shared.ObjectFactory

public class ObjectFactory
extends java.lang.Object

Creates generic PropertiesSettable objects by class name. This class uses an SjarClassLoader if it is available, otherwise the default class loader is used.


Constructor Summary
ObjectFactory()
           
 
Method Summary
static java.lang.Object createObject(java.lang.String className)
          Creates the object of the given name and returns the object.
static PropertiesSettable createObject(java.lang.String className, java.util.Properties props)
          Creates the object of the given name, sets the given properties object and returns the object.
static java.lang.ClassLoader getObjectClassLoader()
          Get the class loader used for loading objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFactory

public ObjectFactory()
Method Detail

getObjectClassLoader

public static java.lang.ClassLoader getObjectClassLoader()
Get the class loader used for loading objects

Returns:
the class loader used for object loading

createObject

public static java.lang.Object createObject(java.lang.String className)
                                     throws java.lang.ClassNotFoundException,
                                            java.lang.InstantiationException,
                                            java.lang.IllegalAccessException
Creates the object of the given name and returns the object.

Parameters:
className - the class name of a class implementing the PropertiesSettable interface
Returns:
the new object
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

createObject

public static PropertiesSettable createObject(java.lang.String className,
                                              java.util.Properties props)
                                       throws java.lang.ClassNotFoundException,
                                              java.lang.InstantiationException,
                                              java.lang.IllegalAccessException
Creates the object of the given name, sets the given properties object and returns the object.

Parameters:
className - the class name of a class implementing the PropertiesSettable interface
props - the properties to set
Returns:
the new object
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException