void WIDomainPowerControlCapabilityChanged::execute(void)
{
    WriteDomainWorkItemStartingDebugMessage();

    try
    {
        getParticipantPtr()->domainPowerControlCapabilityChanged();
    }
    catch (std::exception ex)
    {
        WriteDomainWorkItemErrorMessage_Function("Participant::domainPowerControlCapabilityChanged");
    }

    PolicyManager* policyManager = getPolicyManager();
    UIntN policyListCount = policyManager->getPolicyListCount();

    for (UIntN i = 0; i < policyListCount; i++)
    {
        try
        {
            Policy* policy = policyManager->getPolicyPtr(i);
            policy->executeDomainPowerControlCapabilityChanged(getParticipantIndex());
        }
        catch (policy_index_invalid ex)
        {
            // do nothing.  No item in the policy list at this index.
        }
        catch (std::exception ex)
        {
            WriteDomainWorkItemErrorMessage_Function_Policy("Policy::executeDomainPowerControlCapabilityChanged", i);
        }
    }
}
Example #2
0
void WIDomainCreate::execute(void)
{
    WriteDomainWorkItemStartingInfoMessage();

    Bool domainCreated = false;

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

    *m_domainCreated = domainCreated;

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

        PolicyManager* 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)
            {
                WriteDomainWorkItemErrorMessage_Function_Policy("Policy::bindDomain", i);
            }
        }
    }
}