kieker.webgui.persistence.impl.utility
Class PluginFinder

java.lang.Object
  extended by kieker.webgui.persistence.impl.utility.PluginFinder

@Service
public final class PluginFinder
extends Object

This is a service which can be used to search for plugins and repositories within a given jar file. The classes are loaded using the reflection API.

Author:
Nils Christian Ehmke

Constructor Summary
PluginFinder()
          Default constructor.
 
Method Summary
 Collection<Class<?>> getAllFiltersWithinJar(URL jarURL, ClassLoader classLoader, ClassContainer classContainer)
          This method delivers all non abstract classes which are available in the given jar, have the Plugin annotation, and are compatible with AbstractFilterPlugin.
 Collection<Class<?>> getAllReadersWithinJar(URL jarURL, ClassLoader classLoader, ClassContainer classContainer)
          This method delivers all non abstract classes which are available in the given jar, have the Plugin annotation, and are compatible with AbstractReaderPlugin.
 Collection<Class<?>> getAllRepositoriesWithinJar(URL jarURL, ClassLoader classLoader, ClassContainer classContainer)
          This method delivers all non abstract classes which are available in the given jar, have the Repository annotation, and are compatible with AbstractRepository.
 Collection<Class<?>> getAllVisualizationsWithinJar(URL jarURL, ClassLoader classLoader, ClassContainer classContainer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginFinder

public PluginFinder()
Default constructor. Do not use this constructor. This bean is Spring managed.

Method Detail

getAllRepositoriesWithinJar

public Collection<Class<?>> getAllRepositoriesWithinJar(URL jarURL,
                                                        ClassLoader classLoader,
                                                        ClassContainer classContainer)
                                                 throws IOException
This method delivers all non abstract classes which are available in the given jar, have the Repository annotation, and are compatible with AbstractRepository.

Parameters:
jarURL - The URL for the jar.
classLoader - The class loader which should be used to load the classes.
classContainer - The container for the necessary reflection classes.
Returns:
A list containing all available repository-classes.
Throws:
IOException - If something went wrong during the opening of the jar file.

getAllReadersWithinJar

public Collection<Class<?>> getAllReadersWithinJar(URL jarURL,
                                                   ClassLoader classLoader,
                                                   ClassContainer classContainer)
                                            throws IOException
This method delivers all non abstract classes which are available in the given jar, have the Plugin annotation, and are compatible with AbstractReaderPlugin.

Parameters:
jarURL - The URL for the jar.
classLoader - The class loader which should be used to load the classes.
classContainer - The container for the necessary reflection classes.
Returns:
A list containing all available plugin-classes.
Throws:
IOException - If something went wrong during the opening of the jar file.

getAllFiltersWithinJar

public Collection<Class<?>> getAllFiltersWithinJar(URL jarURL,
                                                   ClassLoader classLoader,
                                                   ClassContainer classContainer)
                                            throws IOException
This method delivers all non abstract classes which are available in the given jar, have the Plugin annotation, and are compatible with AbstractFilterPlugin.

Parameters:
jarURL - The URL for the jar.
classLoader - The class loader which should be used to load the classes.
classContainer - The container for the necessary reflection classes.
Returns:
A list containing all available plugin-classes.
Throws:
IOException - If something went wrong during the opening of the jar file.

getAllVisualizationsWithinJar

public Collection<Class<?>> getAllVisualizationsWithinJar(URL jarURL,
                                                          ClassLoader classLoader,
                                                          ClassContainer classContainer)
                                                   throws IOException
Throws:
IOException


Copyright © 2015. All rights reserved.