Class PluginUtils

java.lang.Object
com.priint.pubserver.plugin.PluginUtils

public class PluginUtils extends Object
Util class to obtain plugin instance
  • Constructor Details

    • PluginUtils

      public PluginUtils()
  • Method Details

    • getPlugin

      public static final <T> T getPlugin(String mappedName, String sessionId, Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      Parameters:
      mappedName - Mapped name of the plug-in class
      sessionId - user session for this plug-in instance
      T - class type of the plug-in
      Returns:
      the class instance or null if not found
    • getPlugin

      public static final <T> T getPlugin(String mappedName, String sessionId, String instance, Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      Parameters:
      mappedName - Mapped name of the plug-in class
      instance - named instance of the plug-in
      sessionId - user session for this plug-in instance
      T - class type of the plug-in
      Returns:
      the class instance or null if not found
    • reloadPluginInstance

      public static final <T> T reloadPluginInstance(String mappedName, String sessionId, String instance, Class<T> T)
      Reloads and returns a plug-in of given type from the plug-in manager.
      Parameters:
      mappedName - Mapped name of the plug-in class
      instance - named instance of the plug-in
      sessionId - user session for this plug-in instance
      T - class type of the plug-in
      Returns:
      the class instance or null if not found
    • reloadPluginInstance

      public static final <T> T reloadPluginInstance(String mappedName, String sessionId, Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      Parameters:
      mappedName - Mapped name of the plug-in class
      sessionId - user session for this plug-in instance
      T - class type of the plug-in
      Returns:
      the class instance or null if not found
    • getPluginMethod

      public static final PluginMethod getPluginMethod(String pluginMappedName, String methodName)
      Returns a plugin Method Object
      Parameters:
      pluginMappedName - Mapped name of the plugin
      methodName - name of the method
      Returns:
      PluginMethod Object
    • getManifest

      public static Properties getManifest(Class<?> clazz)
      Gets the jar's manifest as properties object. The jar is identified by any class that resides in the jar.
      Parameters:
      clazz - reference to a class defined inside the jar
      Returns:
      a properties object (not null) (empty if manifest was not found)