org.codehaus.activemq.util
Class FactoryFinder

java.lang.Object
  extended byorg.codehaus.activemq.util.FactoryFinder

public class FactoryFinder
extends Object

A helper class to discover protocols dynamically to ensure that the system is extensible and has minimum runtime dependencies

Version:
$Revision: 1.1 $

Constructor Summary
FactoryFinder(String path)
           
 
Method Summary
 Class findClass(String key)
          Loads the class for the given key
protected  Class loadClass(String name)
           
 Object newInstance(String key)
          Creates a new instance of the given key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryFinder

public FactoryFinder(String path)
Method Detail

newInstance

public Object newInstance(String key)
                   throws IllegalAccessException,
                          InstantiationException,
                          IOException,
                          ClassNotFoundException
Creates a new instance of the given key

Parameters:
key - is the key to add to the path to find a text file containing the factory name
Returns:
a newly created instance
Throws:
IllegalAccessException
InstantiationException
IOException
ClassNotFoundException

findClass

public Class findClass(String key)
                throws IOException,
                       ClassNotFoundException
Loads the class for the given key

Parameters:
key - is the key to add to the path to find a text file containing the factory name
Returns:
the class for the given key
Throws:
IOException
ClassNotFoundException

loadClass

protected Class loadClass(String name)
                   throws ClassNotFoundException
Throws:
ClassNotFoundException


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.