Package com.priint.pubserver.plugin
Class PluginUtils
java.lang.Object
com.priint.pubserver.plugin.PluginUtils
Util class to obtain plugin instance
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiesgetManifest(Class<?> clazz) Gets the jar's manifest as properties object.static final <T> TGets a plug-in of given type from the plug-in manager.static final <T> TGets a plug-in of given type from the plug-in manager.static final PluginMethodgetPluginMethod(String pluginMappedName, String methodName) Returns a plugin Method Objectstatic final <T> TreloadPluginInstance(String mappedName, String sessionId, Class<T> T) Gets a plug-in of given type from the plug-in manager.static final <T> TreloadPluginInstance(String mappedName, String sessionId, String instance, Class<T> T) Reloads and returns a plug-in of given type from the plug-in manager.
-
Constructor Details
-
PluginUtils
public PluginUtils()
-
-
Method Details
-
getPlugin
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(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 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(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 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
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
Returns a plugin Method Object- Parameters:
pluginMappedName- Mapped name of the pluginmethodName- name of the method- Returns:
- PluginMethod Object
-
getManifest
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)
-