crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/CIProblemDetectorManager.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Text;
       
    19 using System.IO;
       
    20 using System.Collections.Generic;
       
    21 using SymbianUtils.Threading;
       
    22 using SymbianUtils;
       
    23 using SymbianUtils.PluginManager;
       
    24 using CrashItemLib.Crash.Container;
       
    25 using CrashItemLib.Crash.Messages;
       
    26 
       
    27 namespace CrashItemLib.Engine.ProblemDetectors
       
    28 {
       
    29     internal class CIProblemDetectorManager : MultiThreadedProcessor<CIProblemDetector>
       
    30     {
       
    31         #region Constructors
       
    32         public CIProblemDetectorManager( CIEngine aEngine )
       
    33             : base( KDetectors )
       
    34 		{
       
    35             iEngine = aEngine;
       
    36         }
       
    37 
       
    38         static CIProblemDetectorManager()
       
    39         {
       
    40             KDetectors.LoadFromCallingAssembly();
       
    41         }
       
    42 		#endregion
       
    43 
       
    44         #region API
       
    45         #endregion
       
    46 
       
    47         #region From MultiThreadedProcessor<CIProblemDetector>
       
    48         public override void Start( TSynchronicity aSynchronicity )
       
    49         {
       
    50             // Make sure we always start with a fully populated list of detectors
       
    51             base.PopulateQueue( KDetectors );
       
    52             base.Start( aSynchronicity );
       
    53         }
       
    54 
       
    55         protected override bool Process( CIProblemDetector aItem )
       
    56         {
       
    57             iEngine.Trace( "[CIProblemDetectorManager] Process() - START - detector: \'{0}\'", aItem.GetType().Name );
       
    58             //
       
    59             foreach ( CIContainer container in iEngine )
       
    60             {
       
    61                 aItem.Check( container );
       
    62             }
       
    63             //
       
    64             iEngine.Trace( "[CIProblemDetectorManager] Process() - END - detector: \'{0}\'", aItem.GetType().Name );
       
    65             return true;
       
    66         }
       
    67         #endregion
       
    68 
       
    69         #region Data members
       
    70         private readonly CIEngine iEngine;
       
    71         private static PluginManager<CIProblemDetector> KDetectors = new PluginManager<CIProblemDetector>();
       
    72 		#endregion
       
    73     }
       
    74 }