Class OsgiPlugin
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.rarogsoftware.rarog.platform.api.plugins.Plugin
Plugin.PluginState
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPluginStateListener
(PluginStateListener listener) Registers plugin state listener.void
bundleChanged
(org.osgi.framework.BundleEvent event) void
disable()
void
enable()
Collection<org.springframework.core.io.Resource>
findResources
(String path) Retrieve all resources from plugin that match provided path.void
org.osgi.framework.Bundle
org.springframework.core.io.Resource
getResource
(String path) Retrieve single resource from plugin.getState()
boolean
void
void
void
removePluginStateListener
(PluginStateListener listener) Unregisters plugin state listenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.rarogsoftware.rarog.platform.api.plugins.Plugin
canBeEnabled, getKey, isActive, isInUse
-
Constructor Details
-
OsgiPlugin
-
-
Method Details
-
getManifest
- Specified by:
getManifest
in interfacePlugin
- Returns:
- plugin manifest
-
isEnabled
public boolean isEnabled() -
getState
-
enable
- Throws:
PluginException
-
disable
- Throws:
PluginException
-
addPluginStateListener
Description copied from interface:Plugin
Registers plugin state listener. Listener will be invoked on any change in plugin state- Specified by:
addPluginStateListener
in interfacePlugin
- Parameters:
listener
- listener to register
-
removePluginStateListener
Description copied from interface:Plugin
Unregisters plugin state listener- Specified by:
removePluginStateListener
in interfacePlugin
- Parameters:
listener
- listener to unregister
-
getBundle
public org.osgi.framework.Bundle getBundle() -
getPluginActivator
- Throws:
PluginException
-
freePluginActivator
public void freePluginActivator() -
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event) - Specified by:
bundleChanged
in interfaceorg.osgi.framework.BundleListener
-
markActive
public void markActive() -
markNotActive
public void markNotActive() -
getResource
Description copied from interface:ResourceHoldingPlugin
Retrieve single resource from plugin. Method do not support wildcard characters.- Specified by:
getResource
in interfaceResourceHoldingPlugin
- Parameters:
path
- path to resource- Returns:
Resource
or null if resource is not accessible or not found.
-
findResources
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 interfaceResourceHoldingPlugin
- Parameters:
path
- path to resources- Returns:
- collection of
Resource
or null if resources are not accessible or path is not correct. - See Also:
-
AntPathMatcher
-