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 Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object executeMethod​(PluginMethod method, java.util.Map<java.lang.String,​java.lang.Object> constants)
      Execute a PluginMethod on the server.
      java.lang.Object executeMethod​(java.lang.String statement, java.util.Map<java.lang.String,​java.lang.Object> constants)
      Execute a ParameterInterpreter statement on the server
      java.util.List<ConnectorPlugin> getActiveConnectors()  
      java.util.List<Plugin> getActivePluginsByTags​(java.lang.String... tags)
      Filter the list of all active plugins using a tag.
      java.util.List<AuthenticationLocal> getAuthenticationPluginList()
      Searches for plug-ins of type authentication
      java.lang.String getJDNINameForPlugin​(java.lang.String mappedName)
      Returns JNDI name of known and already registered plug-in.
      PluginMethod getPluginMethodByKey​(java.lang.String key)
      Gets a PluginMethod by key.
      java.util.List<PluginMethod> getPluginMethodsByType​(java.lang.String type)
      Get all methods of a certain type
      java.util.List<PluginMethod> getPluginMethodsOfPlugin​(java.lang.String pluginMappedName)
      Get all methods defined by a certain plugin
      java.util.List<PluginMethod> getPluginMethodsOfPluginByType​(java.lang.String pluginMappedName, java.lang.String type)
      Get all methods defined by a certain plugin of a certain type.
      PluginMethod getRegisteredMethod​(PluginMethod configuredMethod)
      Gets a registered method
      <T> T lookupPlugin​(java.lang.String mappedName, java.lang.String sessionId, java.lang.Class<T> T)
      Returns an instance of a plugin class for a current sessionid.
      <T> T lookupPlugin​(java.lang.String mappedName, java.lang.String sessionId, java.lang.String instance, java.lang.Class<T> T)
      Returns an instance of a plug-in class for a current sessionid.
      boolean pluginExist​(java.lang.String mappedName)  
      void registerPlugin​(java.lang.String pluginLibUID, java.lang.String mappedName, java.lang.String uid, java.util.List<PluginConfig> configs, java.util.List<PluginMethod> pluginMethods, java.lang.String tags)
      Called by a plugin library for each class that has a @PubServerPlugin annotation to register it as a plugin.
      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).
      void removePluginInstance​(java.lang.String mappedName, java.lang.String sessionId)  
      void removePluginInstance​(java.lang.String mappedName, java.lang.String sessionId, java.lang.String instance)  
      void unregisterPlugin​(java.lang.String pluginLibUID, java.lang.String name)
      Called by a plugin library to unregister a plugin.
      void unregisterPluginLib​(java.lang.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 Detail

      • 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​(java.lang.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​(java.lang.String pluginLibUID,
                            java.lang.String mappedName,
                            java.lang.String uid,
                            java.util.List<PluginConfig> configs,
                            java.util.List<PluginMethod> pluginMethods,
                            java.lang.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​(java.lang.String pluginLibUID,
                              java.lang.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​(java.lang.String mappedName,
                           java.lang.String sessionId,
                           java.lang.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​(java.lang.String mappedName,
                           java.lang.String sessionId,
                           java.lang.String instance,
                           java.lang.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​(java.lang.String mappedName)
        Parameters:
        mappedName - Mapped name of the plug-in class
        Returns:
        True if a plug-in exists
      • getActiveConnectors

        java.util.List<ConnectorPlugin> getActiveConnectors()
        Returns:
        List of active connectors.
      • getJDNINameForPlugin

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

        void removePluginInstance​(java.lang.String mappedName,
                                  java.lang.String sessionId)
        Parameters:
        mappedName -
        sessionId -
      • removePluginInstance

        void removePluginInstance​(java.lang.String mappedName,
                                  java.lang.String sessionId,
                                  java.lang.String instance)
        Parameters:
        mappedName -
        sessionId -
        instance -
      • getPluginMethodsByType

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

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

        java.util.List<PluginMethod> getPluginMethodsOfPluginByType​(java.lang.String pluginMappedName,
                                                                    java.lang.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

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

        java.lang.Object executeMethod​(java.lang.String statement,
                                       java.util.Map<java.lang.String,​java.lang.Object> constants)
                                throws PubServerException
        Execute a ParameterInterpreter statement on the server
        Parameters:
        statement -
        constants -
        Returns:
        Throws:
        PubServerException
      • getAuthenticationPluginList

        java.util.List<AuthenticationLocal> getAuthenticationPluginList()
        Searches for plug-ins of type authentication
        Returns:
        list of authentication plugins
      • getPluginMethodByKey

        PluginMethod getPluginMethodByKey​(java.lang.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

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