sysstatemgmt/systemstarter/sysmonsrc/monitor.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __SYSMONMONITOR_H__
       
    17 #define __SYSMONMONITOR_H__
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <e32base.h>
       
    21 #include <startup.hrh>
       
    22 
       
    23 #include "logoncallback.h"
       
    24 #include "logonbackofftimer.h"
       
    25 
       
    26 class CSysMonServer;
       
    27 class CStartupProperties;
       
    28 class CLogonBackoffTimer;
       
    29 
       
    30 /** 
       
    31 This class is responsible for monitoring a single process.
       
    32 @file
       
    33 @internalComponent
       
    34 @released
       
    35 */
       
    36 class CMonitor:public CActive, public MLogonCallback
       
    37 	{
       
    38 public:
       
    39 	static CMonitor* NewL(CSysMonServer& aServer, const TProcessId& aId, CStartupProperties* aStartupProperties, TBool aExecuteRecoveryMethodOnFailure);
       
    40 	void Start();
       
    41 	TProcessId ProcessId() const;
       
    42 	~CMonitor();
       
    43 
       
    44 public:
       
    45 	// From MLogonCallback
       
    46 	TInt DoProcessLogon();
       
    47 	void ActivateSelf();
       
    48 	
       
    49 protected:
       
    50 	static TInt Callback(TAny* aParent);
       
    51 	void RestartProcessL();
       
    52 	void RunL();
       
    53 	void DoCancel();
       
    54 	TInt RunError(TInt aError);
       
    55 	void CancelMonitor();
       
    56 
       
    57 protected:
       
    58 	CMonitor(CSysMonServer& aServer, const TProcessId& aId);	
       
    59 	void ConstructL(CStartupProperties* aStartupProperties, TBool aExecuteRecoveryMethodOnFailure);
       
    60 
       
    61 public : 
       
    62     static const TInt iOffset;
       
    63 	
       
    64 private:
       
    65 	CSysMonServer& iSysMonServer;		
       
    66 	TProcessId iProcessId;	
       
    67 	RProcess iProcess;
       
    68 	TTime iLoadTime;
       
    69 	CStartupProperties* iStartupProperties;	
       
    70 	TSglQueLink iSglQueLink;
       
    71 	CLogonBackoffTimer* iLogonBackoffTimer;
       
    72 	};
       
    73 
       
    74 #endif