Package de.codecentric.reedelk.platform
Class Platform
- java.lang.Object
-
- de.codecentric.reedelk.platform.Platform
-
- All Implemented Interfaces:
HotSwapListener,EventListener
public class Platform extends Object implements EventListener, HotSwapListener
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleContextcontextprotected ModulesManagermodulesManager
-
Constructor Summary
Constructors Constructor Description Platform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomponentRegistered(String componentName)voidcomponentUnregistering(String componentName)voidhotSwap(long moduleId, String resourcesRootDirectory)voidmoduleInstalled(long moduleId)voidmoduleStarted(long moduleId)There are two scenarios when this event callback is being called: when a module is INSTALLED and when a module is UPDATED.voidmoduleStopped(long moduleId)When the OSGi container process is stopped, 'moduleStopping' is not called therefore the module is still registered in the ModuleManager.voidmoduleStopping(long moduleId)voidmoduleUninstalled(long moduleId)voidstart(org.osgi.framework.BundleContext context)voidstop(org.osgi.framework.BundleContext context)
-
-
-
Field Detail
-
context
protected org.osgi.framework.BundleContext context
-
modulesManager
protected ModulesManager modulesManager
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext context)
-
stop
public void stop(org.osgi.framework.BundleContext context)
-
moduleInstalled
public void moduleInstalled(long moduleId)
- Specified by:
moduleInstalledin interfaceEventListener
-
moduleStarted
public void moduleStarted(long moduleId)
There are two scenarios when this event callback is being called: when a module is INSTALLED and when a module is UPDATED. Install: - moduleInstalled: state=INSTALLED - moduleStarted: state=STARTED Update (e.g. because component source code was changed - no hot-swap -): - moduleStopping: state=RESOLVED - componentUnregistering: state=UNRESOLVED - moduleStopped: state=UNRESOLVED (no-op) - componentRegistered: state=STARTED (auto-start when all components are resolved) - moduleStarted: state=STARTED (no-op)- Specified by:
moduleStartedin interfaceEventListener
-
moduleStopping
public void moduleStopping(long moduleId)
- Specified by:
moduleStoppingin interfaceEventListener
-
moduleStopped
public void moduleStopped(long moduleId)
When the OSGi container process is stopped, 'moduleStopping' is not called therefore the module is still registered in the ModuleManager. 'moduleStopped' is called when the OSGi container shuts down (skipping the call to moduleStopping). Note that when a module is stopped there is no more context (Bundle Context) associated with it.- Specified by:
moduleStoppedin interfaceEventListener
-
moduleUninstalled
public void moduleUninstalled(long moduleId)
- Specified by:
moduleUninstalledin interfaceEventListener
-
componentRegistered
public void componentRegistered(String componentName)
- Specified by:
componentRegisteredin interfaceEventListener
-
componentUnregistering
public void componentUnregistering(String componentName)
- Specified by:
componentUnregisteringin interfaceEventListener
-
hotSwap
public void hotSwap(long moduleId, String resourcesRootDirectory)- Specified by:
hotSwapin interfaceHotSwapListener
-
-