Esempio n. 1
0
void WIDomainPlatformRestOfPowerChanged::execute(void)
{
    writeDomainWorkItemStartingInfoMessage();

    try
    {
        getParticipantPtr()->domainPlatformRestOfPowerChanged();
    }
    catch (std::exception& ex)
    {
        writeDomainWorkItemErrorMessage(ex, "Participant::domainPlatformRestOfPowerChanged");
    }

    auto policyManager = getPolicyManager();
    UIntN policyListCount = policyManager->getPolicyListCount();

    for (UIntN i = 0; i < policyListCount; i++)
    {
        try
        {
            Policy* policy = policyManager->getPolicyPtr(i);
            policy->executeDomainPlatformRestOfPowerChanged(getParticipantIndex());
        }
        catch (policy_index_invalid ex)
        {
            // do nothing.  No item in the policy list at this index.
        }
        catch (std::exception& ex)
        {
            writeDomainWorkItemErrorMessagePolicy(ex, "Policy::executeDomainPlatformRestOfPowerChanged", i);
        }
    }
}
void WIDomainPerformanceControlCapabilityChanged::execute(void)
{
	writeDomainWorkItemStartingInfoMessage();

	try
	{
		getParticipantPtr()->domainPerformanceControlCapabilityChanged();
	}
	catch (std::exception& ex)
	{
		writeDomainWorkItemErrorMessage(ex, "Participant::domainPerformanceControlCapabilityChanged");
	}

	auto policyManager = getPolicyManager();
	auto policyIndexes = policyManager->getPolicyIndexes();

	for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
	{
		try
		{
			Policy* policy = policyManager->getPolicyPtr(*i);
			policy->executeDomainPerformanceControlCapabilityChanged(getParticipantIndex());
		}
		catch (policy_index_invalid& ex)
		{
			// do nothing.  No item in the policy list at this index.
		}
		catch (std::exception& ex)
		{
			writeDomainWorkItemErrorMessagePolicy(ex, "Policy::executeDomainPerformanceControlCapabilityChanged", *i);
		}
	}
}
Esempio n. 3
0
void WIDomainDestroy::execute(void)
{
	writeDomainWorkItemStartingInfoMessage();

	if (getParticipantPtr()->isDomainValid(getDomainIndex()) == false)
	{
		writeDomainWorkItemErrorMessage("Received request to remove a domain that is invalid.");
	}
	else
	{
		auto policyManager = getPolicyManager();
		auto policyIndexes = policyManager->getPolicyIndexes();

		// Let each policy know that the domain is going away

		for (auto i = policyIndexes.begin(); i != policyIndexes.end(); ++i)
		{
			try
			{
				Policy* policy = policyManager->getPolicyPtr(*i);
				policy->unbindDomain(getParticipantIndex(), getDomainIndex());
			}
			catch (policy_index_invalid& ex)
			{
				// do nothing.  No item in the policy list at this index.
			}
			catch (std::exception& ex)
			{
				writeDomainWorkItemErrorMessagePolicy(ex, "Policy::unbindDomain", *i);
			}
		}

		// Let the participant know to remove the domain

		try
		{
			getParticipantPtr()->destroyDomain(getDomainIndex());
		}
		catch (std::exception& ex)
		{
			writeDomainWorkItemErrorMessage(ex, "Participant::destroyDomain");
		}
	}
}
Esempio n. 4
0
void WIDptfParticipantActivityLoggingEnabled::execute(void)
{
    writeDomainWorkItemStartingInfoMessage();

    try
    {
        getParticipantPtr()->activityLoggingEnabled(getDomainIndex(), m_capabilityBitMask);
    }
    catch (std::exception& ex)
    {
        writeDomainWorkItemErrorMessage(ex, "Participant::activityLoggingEnabled");
    }
}
Esempio n. 5
0
void WIDomainCreate::execute(void)
{
    writeDomainWorkItemStartingInfoMessage();

    Bool domainCreated = false;

    try
    {
        getParticipantPtr()->createDomain(getDomainIndex(), m_domainDataPtr, m_domainEnabled);
        domainCreated = true;
    }
    catch (std::exception& ex)
    {
        writeDomainWorkItemErrorMessage(ex, "Participant::createDomain");
    }

    *m_domainCreated = domainCreated;

    if (domainCreated == true)
    {
        //
        // Iterate through the list of policies and let them know about the new domain
        //

        auto policyManager = getPolicyManager();
        UIntN policyListCount = policyManager->getPolicyListCount();

        for (UIntN i = 0; i < policyListCount; i++)
        {
            try
            {
                Policy* policy = policyManager->getPolicyPtr(i);
                policy->bindDomain(getParticipantIndex(), getDomainIndex());
            }
            catch (policy_index_invalid ex)
            {
                // do nothing.  No item in the policy list at this index.
            }
            catch (std::exception& ex)
            {
                writeDomainWorkItemErrorMessagePolicy(ex, "Policy::bindDomain", i);
            }
        }
    }
}