Interface PluginManagerRemote
- All Known Subinterfaces:
PluginManagerLocal
- Manages the plug-ins registered to an instance of the kernel
- Register / unregister plug-in libraries and plug-ins
- Gets information about registered plug-ins
- Implemented as startup singleton session bean.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionexecuteMethod(PluginMethod method, Map<String, Object> constants) Execute a PluginMethod on the server.executeMethod(String statement, Map<String, Object> constants) Execute a ParameterInterpreter statement on the servergetActivePluginsByTags(String... tags) Filter the list of all active plugins using a tag.Searches for plug-ins of type authenticationgetJDNINameForPlugin(String mappedName) Returns JNDI name of known and already registered plug-in.Gets a PluginMethod by key.getPluginMethodsByType(String type) Get all methods of a certain typegetPluginMethodsOfPlugin(String pluginMappedName) Get all methods defined by a certain plugingetPluginMethodsOfPluginByType(String pluginMappedName, String type) Get all methods defined by a certain plugin of a certain type.getRegisteredMethod(PluginMethod configuredMethod) Gets a registered method<T> TlookupPlugin(String mappedName, String sessionId, Class<T> T) Returns an instance of a plugin class for a current sessionid.<T> TlookupPlugin(String mappedName, String sessionId, String instance, Class<T> T) Returns an instance of a plug-in class for a current sessionid.booleanpluginExist(String mappedName) voidregisterPlugin(String pluginLibUID, String mappedName, String uid, List<PluginConfig> configs, List<PluginMethod> pluginMethods, String tags) Called by a plugin library for each class that has a @PubServerPlugin annotation to register it as a plugin.booleanregisterPluginLib(PluginLibraryControl libraryControl) Called by a plug-in library (deployed plugin application) to register the library after its deployment or restart Checks the JPA for an existing registry entry and updates or creates it (first deployment).voidremovePluginInstance(String mappedName, String sessionId) voidremovePluginInstance(String mappedName, String sessionId, String instance) voidunregisterPlugin(String pluginLibUID, String name) Called by a plugin library to unregister a plugin.voidunregisterPluginLib(String pluginLibUID) Called by a plugin library (deployed plugin application) to unregister the library before its undeployment or shutdown Checks the JPA for an existing registry entry and set it to 'inactive'.
-
Method Details
-
registerPluginLib
Called by a plug-in library (deployed plugin application) to register the library after its deployment or restart Checks the JPA for an existing registry entry and updates or creates it (first deployment).- Parameters:
libraryControl-- Returns:
- boolean: successfully registered or not.
-
unregisterPluginLib
Called by a plugin library (deployed plugin application) to unregister the library before its undeployment or shutdown Checks the JPA for an existing registry entry and set it to 'inactive'.- Parameters:
pluginLibUID- Unique identifier provided to the manufacturer for the registered library
-
registerPlugin
void registerPlugin(String pluginLibUID, String mappedName, String uid, List<PluginConfig> configs, List<PluginMethod> pluginMethods, String tags) Called by a plugin library for each class that has a @PubServerPlugin annotation to register it as a plugin. Checks the plugins stack (already registered plugins) for an entry and creates a new @see PluginObjSession object if it not exist. This object holds than the instances of an plugin for each running session. /**- Parameters:
pluginLibUID- Unique identifier provided to the manufacturer for the registered librarymappedName- Mapped name of the plugin classuid- Global JNDI Name of the plugin classconfigs- config filespluginMethods- with PubServerMethod annotated methodstags- tags used for this plugins
-
unregisterPlugin
Called by a plugin library to unregister a plugin.
Removes the @see PluginObjSession from the stack of plugins.- Parameters:
pluginLibUID- Unique identifier provided to the manufacturer for the registered libraryname- Mapped name of the plugin class
-
lookupPlugin
Returns an instance of a plugin class for a current sessionid.It checks the plugins stack if there is already an instance for the current session. If not it creates one (context lookup) and adds it to the @see PluginObjSession object of the plugin.
- Parameters:
mappedName- Mapped name of the plugin classsessionId- Current sessionidT- Expected class type (interface) of the plugin- Returns:
- Instance of the plugin.
-
lookupPlugin
Returns an instance of a plug-in class for a current sessionid.It checks the plug-ins stack if there is already an instance for the current session. If not it creates one (context lookup) and adds it to the @see PluginObjSession object of the plugin.
- Parameters:
mappedName- Mapped name of the plug-in classsessionId- Current sessionidinstance-T- Expected class type (interface) of the plug-in- Returns:
- Instance of the plug-in.
-
pluginExist
- Parameters:
mappedName- Mapped name of the plug-in class- Returns:
- True if a plug-in exists
-
getActiveConnectors
List<ConnectorPlugin> getActiveConnectors()- Returns:
- List of active connectors.
-
getJDNINameForPlugin
Returns JNDI name of known and already registered plug-in.- Parameters:
mappedName-- Returns:
- JNDI global name of plug-in
-
removePluginInstance
- Parameters:
mappedName-sessionId-
-
removePluginInstance
- Parameters:
mappedName-sessionId-instance-
-
getPluginMethodsByType
Get all methods of a certain type- Parameters:
type-- Returns:
- list of methods
-
getPluginMethodsOfPlugin
Get all methods defined by a certain plugin- Parameters:
pluginMappedName-- Returns:
- list of methods
-
getPluginMethodsOfPluginByType
Get all methods defined by a certain plugin of a certain type.- Parameters:
pluginMappedName-type-- Returns:
- list of methods
-
getRegisteredMethod
Gets a registered method
Gets a registered method for a configuration passed as argument.
In some cases we need an instance of the registered PluginMethod rather than the method configuration read from repository, because the registered method contains runtime information (such as Parameter annotations) not available in the configuration.
This method can also be used to check, if a configured method actually exists, i.e. was properly deployed and registered by the kernel.
The method will be looked up by it's key, this isPluginMappedName.methodName:methodType.
Note, that the method signature (number and types of parameters) is not taken into account, this is because the configuration does not necessarily contain definitions for all parameters (therefore generally it;s a bad idea to overload methods, which are supposed to be called as PluginMethods).
If no matching method can be found, aNotDeployedExceptionis thrown.- Parameters:
configuredMethod-- Returns:
- registered method for the configuration passed as argument
- Throws:
PubServerException- if such a method does not exist
-
executeMethod
Execute a PluginMethod on the server.- Parameters:
method-constants-- Returns:
- Throws:
PubServerException
-
executeMethod
Execute a ParameterInterpreter statement on the server- Parameters:
statement-constants-- Returns:
- Throws:
PubServerException
-
getAuthenticationPluginList
List<AuthenticationLocal> getAuthenticationPluginList()Searches for plug-ins of type authentication- Returns:
- list of authentication plugins
-
getPluginMethodByKey
Gets a PluginMethod by key.
Gets a PluginMethod by the method key.
The method key consists ofPlugin mapped name + "." + method name + ":" + method typeNote, that this key is not guaranteed to be unique, also the key may change when redeploying or restarting the server.
- Parameters:
key-- Returns:
-
getActivePluginsByTags
Filter the list of all active plugins using a tag.- Returns:
- list of active plugins libraries with parameter tag
-