Package com.priint.pubserver.plugin
Class PluginUtils
- java.lang.Object
-
- com.priint.pubserver.plugin.PluginUtils
-
public class PluginUtils extends java.lang.ObjectUtil 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.PropertiesgetManifest(java.lang.Class<?> clazz)Gets the jar's manifest as properties object.static <T> TgetPlugin(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> TgetPlugin(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 PluginMethodgetPluginMethod(java.lang.String pluginMappedName, java.lang.String methodName)Returns a plugin Method Objectstatic <T> TreloadPluginInstance(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> TreloadPluginInstance(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.
-
-
-
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 classsessionId- user session for this plug-in instanceT- 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 classinstance- named instance of the plug-insessionId- user session for this plug-in instanceT- 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 classinstance- named instance of the plug-insessionId- user session for this plug-in instanceT- 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 classsessionId- user session for this plug-in instanceT- 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 pluginmethodName- 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)
-
-