org.yasl.jars
Interface DynamicJarLoader

All Known Implementing Classes:
DynamicJarLoaderImpl

public interface DynamicJarLoader

Version:
1.0
Author:
Jeff Chapman

Method Summary
 void cancelJarLoadingProcess()
           
 List dynamicallyFindJarClasses(String jarFilePath)
          Populates a list with YASLJarResource objects from the class files contained in the jar file or files referenced by the jarFilePath argument.
 List dynamicallyFindJarResources(String jarDirPath)
          Populates a list with YASLJarResource objects from the non-class files contained in the jar file or files referenced by the jarFilePath argument.
 List dynamicallyFindJarResources(String jarDirPath, Set extenders)
          Populates a list with YASLJarResource objects from the non-class files contained in the jar file or files referenced by the jarFilePath argument.
 Map dynamicallyLoadJarClasses(String jarFilePath)
          Loads any class files contained in the jar file or files referenced by the jarFilePath argument.
 void setStatusMonitor(DynamicJarLoaderStatus statusMonitor)
           
 

Method Detail

cancelJarLoadingProcess

public void cancelJarLoadingProcess()

setStatusMonitor

public void setStatusMonitor(DynamicJarLoaderStatus statusMonitor)

dynamicallyLoadJarClasses

public Map dynamicallyLoadJarClasses(String jarFilePath)
                              throws MalformedURLException,
                                     IOException,
                                     ClassNotFoundException
Loads any class files contained in the jar file or files referenced by the jarFilePath argument. If the jarFilePath is a directory, the directory will be searched for jar files and all the jar files found will be processed for class files.

The classes loaded will be used to populate the classFilesMap with class names mapped to class instances.

Parameters:
jarFilePath - String
Returns:
Map of class names to class instances
Throws:
MalformedURLException
IOException
ClassNotFoundException

dynamicallyFindJarClasses

public List dynamicallyFindJarClasses(String jarFilePath)
                               throws MalformedURLException,
                                      IOException
Populates a list with YASLJarResource objects from the class files contained in the jar file or files referenced by the jarFilePath argument. If the jarFilePath is a directory, the directory will be searched for jar files and all the jar files found will be processed for non-class files.

Parameters:
jarFilePath - String
Returns:
List
Throws:
MalformedURLException
IOException

dynamicallyFindJarResources

public List dynamicallyFindJarResources(String jarDirPath)
                                 throws MalformedURLException,
                                        IOException
Populates a list with YASLJarResource objects from the non-class files contained in the jar file or files referenced by the jarFilePath argument. If the jarFilePath is a directory, the directory will be searched for jar files and all the jar files found will be processed for non-class files.

Parameters:
jarDirPath - String
Returns:
List
Throws:
MalformedURLException
IOException

dynamicallyFindJarResources

public List dynamicallyFindJarResources(String jarDirPath,
                                        Set extenders)
                                 throws MalformedURLException,
                                        IOException
Populates a list with YASLJarResource objects from the non-class files contained in the jar file or files referenced by the jarFilePath argument. If the jarFilePath is a directory, the directory will be searched for jar files and all the jar files found will be processed for non-class files.

Users can limit the types of resources returned by adding their file extenders to the extenders set. For example, to only return a list of xml files, add "xml" to the extenders set.

If users pass in an empty set, all non-class file resources will be returned.

Parameters:
jarDirPath - String
extenders - Set of file extenders
Returns:
List of YASLJarResource objects
Throws:
MalformedURLException
IOException