Class OSGiBasedTicketerPlugin

  • All Implemented Interfaces:
    Plugin

    public class OSGiBasedTicketerPlugin
    extends Object
    implements Plugin
    Ticketer plugin that reference an implementation pulled from the OSGi Service Registry. The first plugin to be registered is used until it is unregistered.
    Author:
    jwhite
    • Constructor Detail

      • OSGiBasedTicketerPlugin

        public OSGiBasedTicketerPlugin()
    • Method Detail

      • registerTicketerPlugin

        public void registerTicketerPlugin​(Plugin plugin,
                                           Map<String,​String> attributes)
        Registers the Plugin use. Only the first registered plugin will be used. This method is called by the OSGi Service Registry when a service implementing the Plugin interface is registered.
        Parameters:
        plugin - the plugin
        attributes - service-level attributes for the plugin
      • unregisterTicketerPlugin

        public boolean unregisterTicketerPlugin​(Plugin plugin,
                                                Map<String,​String> attributes)
                                         throws Exception
        Unregisters a previously registered Plugin use. This method is called by the OSGi Service Registry when a service implementing the Plugin interface is unregistered.
        Parameters:
        plugin - the plugin
        attributes - service-level attributes for the plugin
        Returns:
        true if the plugin was previously in use, false otherwise
        Throws:
        Exception
      • getTicketerPlugin

        public Plugin getTicketerPlugin()
                                 throws PluginException
        Retrieves the plugin that is currently registered. If no plugin is currently registered, this full will throw a PluginException instead of returning null.
        Returns:
        the currently registered plugin
        Throws:
        PluginException - when no plugin is currently registered