#include <unistd.h>
#include <pthread.h>
#include <signal.h>
+#include <limits.h>
static const char* NO_SENDER_NAME = "unknown";
return status;
}
+int Layermanager::getPluginReportIntervalInMs()
+{
+ int retVal = INT_MAX;
+ HealthMonitorList monitors;
+ m_pPluginManager->getHealthMonitorList(monitors);
+
+ if (0 == monitors.size())
+ {
+ retVal = -1;
+ }
+ else
+ {
+ HealthMonitorListIterator iter = monitors.begin();
+ HealthMonitorListIterator end = monitors.end();
+ for (; iter != end; ++iter)
+ {
+ IHealthMonitor* monitor = *iter;
+ int monitorInterval = monitor->getPluginReportIntervalInMs();
+ retVal = (monitorInterval < retVal ? monitorInterval : retVal);
+ }
+ }
+ return retVal;
+}
+
bool Layermanager::startAllRenderers(const int width, const int height,
const char *displayName)
{
bool allStarted = false;
+ int maxIterationDurationInMS = getPluginReportIntervalInMs();
+
RendererListIterator iter = m_pRendererList->begin();
RendererListIterator iterEnd = m_pRendererList->end();
for (; iter != iterEnd; ++iter)
IRenderer* renderer = *iter;
if (renderer)
{
- allStarted = renderer->start(width, height, displayName);
+ allStarted = renderer->start(width, height, displayName, maxIterationDurationInMS);
}
if (renderer == NULL || allStarted == false)
{
{
bool allStarted = true;
+ int maxIterationDurationInMS = getPluginReportIntervalInMs();
+
CommunicatorListIterator communicatorIter = m_pCommunicatorList->begin();
CommunicatorListIterator communicatorIterEnd = m_pCommunicatorList->end();
ICommunicator *communicator = *communicatorIter;
if (communicator)
{
- allStarted &= communicator->start();
+ allStarted &= communicator->start(maxIterationDurationInMS);
}
else
{
{
IPlugin* monitoredPlugin = *iter;
returnValue = monitoredPlugin->pluginGetHealth();
+ LOG_INFO("Layermanager", "Plugin " << monitoredPlugin->pluginGetName() << " health: " << (returnValue == HealthRunning ? "Running" : "Dead"));
++iter;
}