java.lang.Object
eu.rarogsoftware.rarog.platform.core.plugins.osgi.OsgiPlugin
All Implemented Interfaces:
Plugin, ResourceHoldingPlugin, EventListener, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener

public class OsgiPlugin extends Object implements ResourceHoldingPlugin, org.osgi.framework.SynchronousBundleListener
  • Constructor Details

    • OsgiPlugin

      public OsgiPlugin(PluginManifest manifest, org.osgi.framework.Bundle bundle)
  • Method Details

    • getManifest

      public PluginManifest getManifest()
      Specified by:
      getManifest in interface Plugin
      Returns:
      plugin manifest
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface Plugin
      Returns:
      true if plugin is enabled but not yet activated, false otherwise
    • getState

      public Plugin.PluginState getState()
      Specified by:
      getState in interface Plugin
      Returns:
      current plugin state
    • enable

      public void enable() throws PluginException
      Throws:
      PluginException
    • disable

      public void disable() throws PluginException
      Throws:
      PluginException
    • addPluginStateListener

      public void addPluginStateListener(PluginStateListener listener)
      Description copied from interface: Plugin
      Registers plugin state listener. Listener will be invoked on any change in plugin state
      Specified by:
      addPluginStateListener in interface Plugin
      Parameters:
      listener - listener to register
    • removePluginStateListener

      public void removePluginStateListener(PluginStateListener listener)
      Description copied from interface: Plugin
      Unregisters plugin state listener
      Specified by:
      removePluginStateListener in interface Plugin
      Parameters:
      listener - listener to unregister
    • getBundle

      public org.osgi.framework.Bundle getBundle()
    • getPluginActivator

      public PluginActivator getPluginActivator() throws PluginException
      Throws:
      PluginException
    • freePluginActivator

      public void freePluginActivator()
    • bundleChanged

      public void bundleChanged(org.osgi.framework.BundleEvent event)
      Specified by:
      bundleChanged in interface org.osgi.framework.BundleListener
    • markActive

      public void markActive()
    • markNotActive

      public void markNotActive()
    • getResource

      public org.springframework.core.io.Resource getResource(String path)
      Description copied from interface: ResourceHoldingPlugin
      Retrieve single resource from plugin. Method do not support wildcard characters.
      Specified by:
      getResource in interface ResourceHoldingPlugin
      Parameters:
      path - path to resource
      Returns:
      Resource or null if resource is not accessible or not found.
    • findResources

      public Collection<org.springframework.core.io.Resource> findResources(String path)
      Description copied from interface: ResourceHoldingPlugin
      Retrieve all resources from plugin that match provided path. Method do support ant wildcard characters like '**'.
      Specified by:
      findResources in interface ResourceHoldingPlugin
      Parameters:
      path - path to resources
      Returns:
      collection of Resource or null if resources are not accessible or path is not correct.
      See Also:
      • AntPathMatcher