Class PluginUtils


  • public class PluginUtils
    extends java.lang.Object
    Util class to obtain plugin instance
    • Constructor Summary

      Constructors 
      Constructor Description
      PluginUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Properties getManifest​(java.lang.Class<?> clazz)
      Gets the jar's manifest as properties object.
      static <T> T getPlugin​(java.lang.String mappedName, java.lang.String sessionId, java.lang.Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      static <T> T getPlugin​(java.lang.String mappedName, java.lang.String sessionId, java.lang.String instance, java.lang.Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      static PluginMethod getPluginMethod​(java.lang.String pluginMappedName, java.lang.String methodName)
      Returns a plugin Method Object
      static <T> T reloadPluginInstance​(java.lang.String mappedName, java.lang.String sessionId, java.lang.Class<T> T)
      Gets a plug-in of given type from the plug-in manager.
      static <T> T reloadPluginInstance​(java.lang.String mappedName, java.lang.String sessionId, java.lang.String instance, java.lang.Class<T> T)
      Reloads and returns a plug-in of given type from the plug-in manager.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PluginUtils

        public PluginUtils()
    • Method Detail

      • getPlugin

        public static final <T> T getPlugin​(java.lang.String mappedName,
                                            java.lang.String sessionId,
                                            java.lang.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​(java.lang.String mappedName,
                                            java.lang.String sessionId,
                                            java.lang.String instance,
                                            java.lang.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​(java.lang.String mappedName,
                                                       java.lang.String sessionId,
                                                       java.lang.String instance,
                                                       java.lang.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​(java.lang.String mappedName,
                                                       java.lang.String sessionId,
                                                       java.lang.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​(java.lang.String pluginMappedName,
                                                         java.lang.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 java.util.Properties getManifest​(java.lang.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)