void bundleListener(const BundleEvent& be)
{
  auto b = be.GetBundle();
  auto type = be.GetType();
  if (type == BundleEvent::BUNDLE_STARTING || type == BundleEvent::BUNDLE_STARTED)
  {
    b.Stop();
  }
  else if (type == BundleEvent::BUNDLE_STOPPING || type == BundleEvent::BUNDLE_STOPPED)
  {
    b.Start();
  }
}
Exemplo n.º 2
0
void WebSession::onBundleStopping(const void* pSender, BundleEvent& ev)
{
	if (ev.bundle() == _pContext->thisBundle())
	{
		clear();
	}
}
void ExtensionPointService::onBundleStopped(const void* pSender, BundleEvent& event)
{
	handleExtensions(event.bundle(), &ExtensionPointService::removeExtension, DIR_REVERSE);

	FastMutex::ScopedLock lock(_mutex);

	BundleMap::const_iterator it = _bundleMap.find(event.bundle());
	while (it != _bundleMap.end() && it->first == event.bundle())
	{
		XPMap::iterator itxp = _xpMap.find(it->second);
		if (itxp != _xpMap.end())
		{
			_logger.information(std::string("Extension point ")
				+ itxp->first
				+ " unregistered because the bundle that defined it ("
				+ event.bundle()->symbolicName()
				+ ") was stopped.");

			_xpMap.erase(itxp);
		}
		++it;
	}
}
void ExtensionPointService::onBundleStarted(const void* pSender, BundleEvent& event)
{
	handleExtensions(event.bundle(), &ExtensionPointService::handleExtension, DIR_FORWARD);
}
Exemplo n.º 5
0
BundleEvent::BundleEvent(const BundleEvent& event) :
  m_Bundle(event.GetBundle()), m_What(event.What())
{

}