Interface PluginManagerRemote

All Known Subinterfaces:
PluginManagerLocal

public interface PluginManagerRemote
Plug-in Manager Remote Interface

  • 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 Details

    • registerPluginLib

      boolean registerPluginLib(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).
      Parameters:
      libraryControl -
      Returns:
      boolean: successfully registered or not.
    • unregisterPluginLib

      void unregisterPluginLib(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'.
      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 library
      mappedName - Mapped name of the plugin class
      uid - Global JNDI Name of the plugin class
      configs - config files
      pluginMethods - with PubServerMethod annotated methods
      tags - tags used for this plugins
    • unregisterPlugin

      void unregisterPlugin(String pluginLibUID, String name)
      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 library
      name - Mapped name of the plugin class
    • lookupPlugin

      <T> T lookupPlugin(String mappedName, String sessionId, Class<T> T)
      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 class
      sessionId - Current sessionid
      T - Expected class type (interface) of the plugin
      Returns:
      Instance of the plugin.
    • lookupPlugin

      <T> T lookupPlugin(String mappedName, String sessionId, String instance, Class<T> T)
      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 class
      sessionId - Current sessionid
      instance -
      T - Expected class type (interface) of the plug-in
      Returns:
      Instance of the plug-in.
    • pluginExist

      boolean pluginExist(String mappedName)
      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

      String getJDNINameForPlugin(String mappedName)
      Returns JNDI name of known and already registered plug-in.
      Parameters:
      mappedName -
      Returns:
      JNDI global name of plug-in
    • removePluginInstance

      void removePluginInstance(String mappedName, String sessionId)
      Parameters:
      mappedName -
      sessionId -
    • removePluginInstance

      void removePluginInstance(String mappedName, String sessionId, String instance)
      Parameters:
      mappedName -
      sessionId -
      instance -
    • getPluginMethodsByType

      List<PluginMethod> getPluginMethodsByType(String type)
      Get all methods of a certain type
      Parameters:
      type -
      Returns:
      list of methods
    • getPluginMethodsOfPlugin

      List<PluginMethod> getPluginMethodsOfPlugin(String pluginMappedName)
      Get all methods defined by a certain plugin
      Parameters:
      pluginMappedName -
      Returns:
      list of methods
    • getPluginMethodsOfPluginByType

      List<PluginMethod> getPluginMethodsOfPluginByType(String pluginMappedName, String type)
      Get all methods defined by a certain plugin of a certain type.
      Parameters:
      pluginMappedName -
      type -
      Returns:
      list of methods
    • getRegisteredMethod

      PluginMethod getRegisteredMethod(PluginMethod configuredMethod) throws PubServerException

      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 is PluginMappedName.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, a NotDeployedException is thrown.

      Parameters:
      configuredMethod -
      Returns:
      registered method for the configuration passed as argument
      Throws:
      PubServerException - if such a method does not exist
    • executeMethod

      Object executeMethod(PluginMethod method, Map<String,Object> constants) throws PubServerException
      Execute a PluginMethod on the server.
      Parameters:
      method -
      constants -
      Returns:
      Throws:
      PubServerException
    • executeMethod

      Object executeMethod(String statement, Map<String,Object> constants) throws PubServerException
      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

      PluginMethod getPluginMethodByKey(String key)

      Gets a PluginMethod by key.

      Gets a PluginMethod by the method key.
      The method key consists of Plugin mapped name + "." + method name + ":" + method type

      Note, that this key is not guaranteed to be unique, also the key may change when redeploying or restarting the server.

      Parameters:
      key -
      Returns:
    • getActivePluginsByTags

      List<Plugin> getActivePluginsByTags(String... tags)
      Filter the list of all active plugins using a tag.
      Returns:
      list of active plugins libraries with parameter tag