23
|
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 SERVERMONITOR_H
|
|
19 |
#define SERVERMONITOR_H
|
|
20 |
|
|
21 |
#include <e32base.h>
|
|
22 |
|
|
23 |
class CServerMonitor : public CActive
|
|
24 |
{
|
|
25 |
public:
|
|
26 |
|
|
27 |
enum TServerState
|
|
28 |
{
|
|
29 |
EIdle,
|
|
30 |
EWaitingRendezvous,
|
|
31 |
ERunning
|
|
32 |
};
|
|
33 |
|
|
34 |
static CServerMonitor* NewL( TDesC& aServerName , TUid aServerUid );
|
|
35 |
virtual ~CServerMonitor();
|
|
36 |
|
|
37 |
// from base class CActive
|
|
38 |
void RunL();
|
|
39 |
TInt RunError( TInt aError );
|
|
40 |
void DoCancel();
|
|
41 |
|
|
42 |
void ShutdownServer();
|
|
43 |
|
|
44 |
private:
|
|
45 |
|
|
46 |
CServerMonitor();
|
|
47 |
|
|
48 |
void ConstructL( TDesC& aServerName , TUid aServerUid );
|
|
49 |
|
|
50 |
void StartL();
|
|
51 |
|
|
52 |
void StartServerProcessL();
|
|
53 |
|
|
54 |
void CreateServerProcess();
|
|
55 |
|
|
56 |
private: // data
|
|
57 |
|
|
58 |
TServerState iState;
|
|
59 |
|
|
60 |
RProcess iProcess;
|
|
61 |
|
|
62 |
HBufC* iServerName;
|
|
63 |
|
|
64 |
TUid iServerUid;
|
|
65 |
|
|
66 |
};
|
|
67 |
|
|
68 |
|
|
69 |
#endif //SERVERMONITOR_H
|