Carousel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Pages
Signals | Public Member Functions | Properties | List of all members
IComponentManager Class Referenceabstract

The IComponentManager holds information about the components that can be used by the application. More...

#include <IComponentManager.h>

Inherits QObject.

Inherited by ComponentManager.

Signals

void aboutToShutDown ()
 
void componentAboutToShutDown (IComponent *component)
 
void componentShutDown (IComponent *component)
 
void componentStarted (IComponent *component)
 
void startedUp ()
 

Public Member Functions

virtual bool addComponent (IComponent *component)=0
 
virtual DependenciesSolvingResult check ()=0
 
virtual const ObservableList
< IComponent * > & 
components () const =0
 
virtual const
IComponentDependencies
dependencies () const =0
 
virtual bool isChecked () const =0
 
virtual QStringList missingComponents () const =0
 
virtual QList< IComponent * > orphanComponents () const =0
 
virtual IServiceLocatorserviceLocator () const =0
 
virtual void shutdown ()=0
 
virtual DependenciesSolvingResult shutdownAllComponents ()=0
 
virtual DependenciesSolvingResult shutdownComponent (IComponent *component)=0
 
virtual DependenciesSolvingResult shutdownComponents (const QList< IComponent * > &components)=0
 
virtual QList< IComponent * > startedComponents () const =0
 
virtual DependenciesSolvingResult startup ()=0
 
virtual DependenciesSolvingResult startupAllComponents ()=0
 
virtual DependenciesSolvingResult startupComponent (IComponent *component)=0
 
virtual DependenciesSolvingResult startupComponents (QList< IComponent * > components)=0
 
virtual QList< IComponent * > stoppedComponents () const =0
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Properties

QList< IComponent * > orphanComponents
 
QList< IComponent * > startedComponents
 
QList< IComponent * > stoppedComponents
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 

Detailed Description

The IComponentManager holds information about the components that can be used by the application.

Each component (described in a IComponent and ComponentDefinition classes, stores the name, description and availability of the component) that was statically registered or dynamically discovered by providers will be added to the ComponentManager after boot loading sequence in CarouselBootloader::configureComponentManager() method. Components also can be added and started during run-time.

Then, after checking and resolving dependencies, all enabled components will be started with IServiceLocator reference as initialziation data. It enables components to get access to shared servces of your application.

Also manager uses IComponentDependencies for components sorting and finding components dependencies.

Note
it takes ownership for added components, and also takes for the IComponentDependencies.

Member Function Documentation

virtual bool IComponentManager::addComponent ( IComponent component)
pure virtual

Adds a new component. Component with same name should not already exists in the manager.

A newly is appended to the stoppedComponents() list and to the dependencies(). This method sets isChecked() to false.

Parameters
componentIf manager already has component with same name as component - the last one will not be added to the manager. The same for the null pointer - it will be ignored.

Returns true if component was succesfully added. If it is a null point or already existed one - returns false. Note, that IComponentManager does not take ownership for component, which was not successfully added.

See Also
IComponentDependencies::addComponent()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::check ( )
pure virtual

Uses DependencySolver for checking of added components according to their dependencies.

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.

It caches resulting value for prefomance, but addComponent() is resets it.

See Also
isChecked()

Implemented in ComponentManager.

virtual const ObservableList<IComponent *>& IComponentManager::components ( ) const
pure virtual

Returns a list of all added components. It is a shortcut to the IComponentDependencies::components().

See Also
IComponentDependencies::dependencies().

Implemented in ComponentManager.

virtual const IComponentDependencies& IComponentManager::dependencies ( ) const
pure virtual

Returns a component dependencies.

Implemented in ComponentManager.

virtual bool IComponentManager::isChecked ( ) const
pure virtual

Uses DependencySolver for checking of added components according to their dependencies.

Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.

See Also
check()

Implemented in ComponentManager.

virtual IServiceLocator* IComponentManager::serviceLocator ( ) const
pure virtual

Gets an initialization data that will be passed to the started components.

See Also
startupComponent()

Implemented in ComponentManager.

virtual QStringList IComponentManager::missingComponents ( ) const
pure virtual

Returns a list of missing parent names those children were added to the manager.

This list is populated after check() or startup/shutdown components and resets after the addComponent() call.

See Also
orphanComponents()

Implemented in ComponentManager.

virtual QList<IComponent *> IComponentManager::orphanComponents ( ) const
pure virtual

Returns a list of components those parents were not added to the manager while components were started.

This list is populated after check() or startup/shutdown components and resets after the addComponent() call.

See Also
missingComponents()

Implemented in ComponentManager.

virtual QList<IComponent *> IComponentManager::stoppedComponents ( ) const
pure virtual

Returns a list of already stopped or non-started yet components.

Implemented in ComponentManager.

virtual QList<IComponent *> IComponentManager::startedComponents ( ) const
pure virtual

Returns a list of started components.

Implemented in ComponentManager.

virtual void IComponentManager::shutdown ( )
pure virtual

Shuts down all the components. Call this method when your application is going to quit.

See Also
startup()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::shutdownComponent ( IComponent component)
pure virtual

Shuts down the specified component and all its implicit children, obtained by IComponentDependencies::completeListWithParent() in such order, that children will be shut down first.

Shut component is moved from the startedComponents() to the stoppedComponents() list.

Ignores null pointer or unexisting component.

Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::shutdownAllComponents ( )
pure virtual

This method is added for convinient. It is a shortkey to the shutdownComponents(components()).

Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.

See Also
shutdownComponents()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::shutdownComponents ( const QList< IComponent * > &  components)
pure virtual

Shuts down specified components in such order, that children will be shut down before their parents.

Shut components are moved from the startedComponents() to the stoppedComponents() list.

Returns a DependenciesSolvingResult with components that were realy shut down. Components that already were shut down will not appear to the result list.

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::startup ( )
pure virtual

Begins working and starts components which were added on the start of application. Starts only enabled components.

Components with disabled parent components will not be started.

Initialization data will be passed to the started components (if any).

See Also
shutdown()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::startupComponent ( IComponent component)
pure virtual

Implicitly calls check() and starts (if resolving) up the specified components and all its parents, obtained by IComponentDependencies::completeListWithChild() in such order, that parents will be started first. All started components became enabled.

Components will not start if parent component could not start.

Initialization data will be passed to the started components (if any). Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.

All started components will be moved from the stoppedComponents() to the startedComponents() list.

Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.

Note
component should be added to the manager before starting.
See Also
addComponent(), check()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::startupAllComponents ( )
pure virtual

This method is added for convinient. It is a shortkey to the startupComponents(components()).

Initialization data will be passed to the started components (if any).

Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.

See Also
addComponent(), check(), startupComponents()

Implemented in ComponentManager.

virtual DependenciesSolvingResult IComponentManager::startupComponents ( QList< IComponent * >  components)
pure virtual

Implicitly calls check() and starts (if resolving) up the specified components and all its parents, obtained by IComponentDependencies::completeListWithChild() in such order, that parents will be started first. All started components became enabled.

Components will not start if parent component could not start.

Initialization data will be passed to the started components (if any). Returns a dependencies solving result, that contains a list of distinct components and a list of components, those dependencies were not found.

Components, those parents were not added to manager, will be appended to the orphanComponents() list and names of their missing parents will be appended to the missingComponents() list. All started components will be moved from the stoppedComponents() to the startedComponents() list.

Returns a DependenciesSolvingResult with components that were realy started. Components that already were started will not appear to the result list.

Note
components should be added to the manager before starting.
See Also
addComponent(), check(), startupAllComponents()

Implemented in ComponentManager.

void IComponentManager::aboutToShutDown ( )
signal

This signal is emmited before manager will be shut down.

void IComponentManager::startedUp ( )
signal

This signal is emmited after manager startup() call.

void IComponentManager::componentAboutToShutDown ( IComponent component)
signal

This signal is emmited before component will be shut down by the IComponentManager.

void IComponentManager::componentShutDown ( IComponent component)
signal

This signal is emmited when component is shut down by the IComponentManager.

void IComponentManager::componentStarted ( IComponent component)
signal

This signal is emmited when component is started up by the IComponentManager.