Class PluginManagerImpl

java.lang.Object
com.ibm.java.diagnostics.utils.plugins.impl.PluginManagerImpl
All Implemented Interfaces:
PluginManager

public class PluginManagerImpl extends Object implements PluginManager
Singleton manager for working with plugins.
  • Field Details

    • logger

      protected static final Logger logger
    • cache

      protected final Container cache
      the cache of scanned files for plugins
    • pluginSearchPath

      protected final ArrayList<File> pluginSearchPath
      specify classloader paths by URI as this can be used by the File class and converted into a URL
  • Method Details

    • getPluginManager

      public static PluginManager getPluginManager()
    • refreshSearchPath

      public void refreshSearchPath()
      Refresh the search path. This will take it's setting in order from 1. System property : com.ibm.java.diagnostics.plugins 2. Environment variable : com.ibm.java.diagnostics.plugins
      Specified by:
      refreshSearchPath in interface PluginManager
    • scanForClassFiles

      public void scanForClassFiles() throws CommandException
      Scan the supplied plugin path to find classes set by the plugin search path and then examine the classes to see if any of the correct interfaces and annotations are supported. This method does not support MVS on z/OS, the path needs to point to HFS locations
      Specified by:
      scanForClassFiles in interface PluginManager
      Throws:
      CommandException
    • getEntry

      public <T extends Entry> T getEntry(File file)
      Get an entry from the cache, using generics to describe the type expected.
      Type Parameters:
      T -
      Parameters:
      file -
      Returns:
    • getCache

      public Container getCache()
      Specified by:
      getCache in interface PluginManager
    • addListener

      public boolean addListener(ClassListener listener)
      Description copied from interface: PluginManager
      Add a listener to the manager. If the listener already exists as determined by a call to equals() then the existing instance is replace by the new one. This allows clients to install a single type of handler but update the configuration or it's methods of operation without retaining a handle to original listener.
      Specified by:
      addListener in interface PluginManager
      Parameters:
      listener - listener to add
      Returns:
      result from the standard Set.add() method
    • removeListener

      public boolean removeListener(ClassListener listener)
      Specified by:
      removeListener in interface PluginManager
    • getListeners

      public Set<ClassListener> getListeners()
      Specified by:
      getListeners in interface PluginManager
    • getClasspath

      public URL[] getClasspath()
      Specified by:
      getClasspath in interface PluginManager