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 TypeMethodDescriptionvoidaddPluginStateListener(PluginStateListener listener) Registers plugin state listener.voidbundleChanged(org.osgi.framework.BundleEvent event) voiddisable()voidenable()Collection<org.springframework.core.io.Resource>findResources(String path) Retrieve all resources from plugin that match provided path.voidorg.osgi.framework.Bundleorg.springframework.core.io.ResourcegetResource(String path) Retrieve single resource from plugin.getState()booleanvoidvoidvoidremovePluginStateListener(PluginStateListener listener) Unregisters plugin state listenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.rarogsoftware.rarog.platform.api.plugins.Plugin
canBeEnabled, getKey, isActive, isInUse
-
Constructor Details
-
OsgiPlugin
-
-
Method Details
-
getManifest
- Specified by:
getManifestin interfacePlugin- Returns:
- plugin manifest
-
isEnabled
public boolean isEnabled() -
getState
-
enable
- Throws:
PluginException
-
disable
- Throws:
PluginException
-
addPluginStateListener
Description copied from interface:PluginRegisters plugin state listener. Listener will be invoked on any change in plugin state- Specified by:
addPluginStateListenerin interfacePlugin- Parameters:
listener- listener to register
-
removePluginStateListener
Description copied from interface:PluginUnregisters plugin state listener- Specified by:
removePluginStateListenerin 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:
bundleChangedin interfaceorg.osgi.framework.BundleListener
-
markActive
public void markActive() -
markNotActive
public void markNotActive() -
getResource
Description copied from interface:ResourceHoldingPluginRetrieve single resource from plugin. Method do not support wildcard characters.- Specified by:
getResourcein interfaceResourceHoldingPlugin- Parameters:
path- path to resource- Returns:
Resourceor null if resource is not accessible or not found.
-
findResources
Description copied from interface:ResourceHoldingPluginRetrieve all resources from plugin that match provided path. Method do support ant wildcard characters like '**'.- Specified by:
findResourcesin interfaceResourceHoldingPlugin- Parameters:
path- path to resources- Returns:
- collection of
Resourceor null if resources are not accessible or path is not correct. - See Also:
-
AntPathMatcher
-