watchdog/inc/watchdog.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     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:  Monitoring application for servers restarting & IAD
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MDSWATCHDOG_H
       
    19 #define MDSWATCHDOG_H
       
    20 
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "wdshutdownobserver.h"
       
    24 #include "wdselfshutdownobserver.h"
       
    25 
       
    26 class CWatchdog : public CActive, public MWDShutdownObserver, public MWDSelfShutdownObserver
       
    27     {
       
    28     public:
       
    29     
       
    30         enum TWatchdogState
       
    31             {
       
    32             EIdle,
       
    33             EWaitingRendezvous,
       
    34             ERunning,
       
    35             EShuttingDown,
       
    36             ERestarting
       
    37         };
       
    38 
       
    39         static CWatchdog* NewL();
       
    40 	    virtual ~CWatchdog();
       
    41 
       
    42         // from base class CActive
       
    43 	    void RunL();
       
    44         TInt RunError( TInt aError );
       
    45 	    void DoCancel();
       
    46 
       
    47 	    // From MShutdownObserver
       
    48         void ShutdownNotification();
       
    49         void RestartNotification();
       
    50         
       
    51         // From MWDSelfShutdownObserver
       
    52         void SelfShutdownNotification();
       
    53 
       
    54     private:
       
    55 
       
    56         CWatchdog();
       
    57         
       
    58         void ConstructL();
       
    59         
       
    60         void Start();
       
    61 
       
    62     private: // data
       
    63 
       
    64         TWatchdogState iState;
       
    65 
       
    66         CWDShutdownObserver* iShutdownObserver;        
       
    67         
       
    68         CWDSelfShutdownObserver* iSelfShutdownObserver;
       
    69         
       
    70         RProcess iProcess;
       
    71   
       
    72     };
       
    73 
       
    74 
       
    75 #endif