Example #1
0
void DptfManager::shutDown(void)
{
    m_dptfShuttingDown = true;
    m_dptfEnabled = false;

    unregisterDptfFrameworkEvents();

    disableAndEmptyAllQueues();
    destroyAllPolicies();
    destroyAllParticipants();
    deleteDptfStatus();
    deleteWorkItemQueueManager();
    deletePolicyManager();
    deleteParticipantManager();
    deleteEsifServices();
    deleteIndexContainer();
    destroyUniqueIdGenerator();
    destroyFrameworkEventInfo();
}
Example #2
0
void WIPolicyReload::execute(void)
{
    writeWorkItemStartingInfoMessage();

    // Iterate through the list of policies and unbind all participant and domains from them
    
    DptfManagerInterface* dptfManager = getDptfManager();
    auto policyManager = getPolicyManager();
    auto participantIndexList = getParticipantManager()->getParticipantIndexes();

    // Unbind every participant and domain from every policy
    for (auto participantIndex = participantIndexList.begin(); participantIndex != participantIndexList.end(); ++participantIndex)
    {
        dptfManager->unbindDomainsFromPolicies(*participantIndex);
        dptfManager->unbindParticipantFromPolicies(*participantIndex);
    }

    // No try-catch here because destroyAllPolicies' calling tree catches all exceptions.
    policyManager->destroyAllPolicies();

    try
    {
        policyManager->reloadAllPolicies(dptfManager->getDptfPolicyDirectoryPath());
    }
    catch (dptf_exception ex)
    {
        writeWorkItemErrorMessage(ex, "policyManager::reloadAllPolicies");
    }

    // Bind every participant and domain to every policy
    for (auto participantIndex = participantIndexList.begin(); participantIndex != participantIndexList.end(); ++participantIndex)
    {
        dptfManager->bindParticipantToPolicies(*participantIndex);
        dptfManager->bindDomainsToPolicies(*participantIndex);
    }
}