com.github.smokestack.ejb.internal
Class ClassFinder

java.lang.Object
  extended by com.github.smokestack.ejb.internal.ClassFinder

public class ClassFinder
extends Object

This utility class was based originally on Daniel Le Berre's RTSI class. This class can be called in different modes, but the principal use is to determine what subclasses/implementations of a given class/interface exist in the current runtime environment.

Author:
Daniel Le Berre, Elliott Wade

Constructor Summary
ClassFinder()
           
ClassFinder(boolean debug)
           
 
Method Summary
 Vector<Class<?>> findSubclasses(Class<?> clazz)
           
 Vector<Class<?>> findSubclasses(String fqcn)
           
 Map<URL,String> getClasspathLocations()
          Determine every URL location defined by the current classpath, and it's associated package name.
 List<Throwable> getErrors()
           
 URL getLocationOf(Class<?> cls)
          The result of the last search is cached in this object, along with the URL that corresponds to each class returned.
 void refreshLocations()
          Rescan the classpath, cacheing all possible file locations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFinder

public ClassFinder()

ClassFinder

public ClassFinder(boolean debug)
Method Detail

refreshLocations

public final void refreshLocations()
Rescan the classpath, cacheing all possible file locations.


findSubclasses

public final Vector<Class<?>> findSubclasses(String fqcn)
Parameters:
fqcn - name of superclass/interface on which to search

getErrors

public final List<Throwable> getErrors()

getLocationOf

public final URL getLocationOf(Class<?> cls)
The result of the last search is cached in this object, along with the URL that corresponds to each class returned. This method may be called to query the cache for the location at which the given class was found. null will be returned if the given class was not found during the last search, or if the result cache has been cleared.


getClasspathLocations

public final Map<URL,String> getClasspathLocations()
Determine every URL location defined by the current classpath, and it's associated package name.


findSubclasses

public Vector<Class<?>> findSubclasses(Class<?> clazz)


Copyright © 2009-2010 Smokestack. All Rights Reserved.