mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/asset/AssetServiceProxy.java
private void waitForAssetDeactivation(final OnAssetDeactivateListener dListener,
            final Semaphore deactivateSemaphore, final int activeCount)
    {
        boolean acquiredSemaphore = false;

        // Wait for 10 seconds, until the dListener notifies that a Asset has failed to deactivate, or
        // all assets have been successfully deactivated.
        try
        {
            final int TIMEOUT = 10;
            acquiredSemaphore = deactivateSemaphore.tryAcquire(activeCount, TIMEOUT, TimeUnit.SECONDS);
        }
        catch (final InterruptedException e)
        {
            m_Logging.log(LogService.LOG_WARNING, e, "Interrupted while waiting for Assets to deactivate.");
        }

        // checks to see if semaphore was acquired or not.
        if (!acquiredSemaphore)
        {
            m_Logging.log(LogService.LOG_WARNING, "Timeout waiting for all Assets to DEACTIVATE");
        }

        // checks listener to see if it was successful
        if (dListener.wasSuccessful())
        {
            m_Logging.log(LogService.LOG_INFO, "All Assets successfully DEACTIVATED");
        }
        else
        {
            m_Logging.log(LogService.LOG_WARNING, "At least one Asset failed to deactivate.");
        }
    }
/**
     * Checks to see if all assets directed to deactivate are now deactivated. If they are then a message is logged 
     * indicating success.
     * 
     * @param dListener
     *      The on asset deactivate listener to listen for the deactivation of assets.
     * @param deactivateSemaphore
     *      The semaphore used for synchronization. Timeout while trying to acquire the semaphore
     *      indicates a problem with the deactivation of Assets and results in a warning in the fault log.
     * @param activeCount
     *      Number of active assets that were to be deactivated
     */
Checks to see if all assets directed to deactivate are now deactivated. If they are then a message is logged
indicating success.

@param dListener
The on asset deactivate listener to listen for the deactivation of assets.
@param deactivateSemaphore
The semaphore used for synchronization. Timeout while trying to acquire the semaphore
indicates a problem with the deactivation of Assets and results in a warning in the fault log.
@param activeCount
Number of active assets that were to be deactivated
Checks to see if all assets directed to deactivate are now deactivated . If they are then a message is logged indicating success . @param dListener The on asset deactivate listener to listen for the deactivation of assets . @param deactivateSemaphore The semaphore used for synchronization . Timeout while trying to acquire the semaphore indicates a problem with the deactivation of Assets and results in a warning in the fault log . @param activeCount Number of active assets that were to be deactivated
private void waitForAssetDeactivation(final OnAssetDeactivateListener dListener,
            final Semaphore deactivateSemaphore, final int activeCount)
    {
        boolean acquiredSemaphore = false;
        try
        {
            final int TIMEOUT = 10;
            acquiredSemaphore = deactivateSemaphore.tryAcquire(activeCount, TIMEOUT, TimeUnit.SECONDS);
        }
        catch (final InterruptedException e)
        {
            m_Logging.log(LogService.LOG_WARNING, e, "Interrupted while waiting for Assets to deactivate.");
        }
        if (!acquiredSemaphore)
        {
            m_Logging.log(LogService.LOG_WARNING, "Timeout waiting for all Assets to DEACTIVATE");
        }
        if (dListener.wasSuccessful())
        {
            m_Logging.log(LogService.LOG_INFO, "All Assets successfully DEACTIVATED");
        }
        else
        {
            m_Logging.log(LogService.LOG_WARNING, "At least one Asset failed to deactivate.");
        }
    }
private void waitForAssetDeactivation ( final OnAssetDeactivateListener dListener , final Semaphore deactivateSemaphore , final int activeCount ) { boolean acquiredSemaphore = false ; try { final int TIMEOUT = 10 ; acquiredSemaphore = deactivateSemaphore . tryAcquire ( activeCount , TIMEOUT , TimeUnit . SECONDS ) ; } catch ( final InterruptedException e ) { m_Logging . log ( LogService . LOG_WARNING , e , "Interrupted while waiting for Assets to deactivate." ) ; } if ( ! acquiredSemaphore ) { m_Logging . log ( LogService . LOG_WARNING , "Timeout waiting for all Assets to DEACTIVATE" ) ; } if ( dListener . wasSuccessful ( ) ) { m_Logging . log ( LogService . LOG_INFO , "All Assets successfully DEACTIVATED" ) ; } else { m_Logging . log ( LogService . LOG_WARNING , "At least one Asset failed to deactivate." ) ; } }
Checks to see if all assets directed to deactivate are now deactivated.
Checks to see if all assets directed to deactivate are now deactivated .
// Wait for 10 seconds, until the dListener notifies that a Asset has failed to deactivate, or // all assets have been successfully deactivated. // checks to see if semaphore was acquired or not. // checks listener to see if it was successful