|
1 /* |
|
2 * Copyright (c) 2010 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: This application is to monitor Harvester and Search Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWDMONITOR_H |
|
20 #define CWDMONITOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "MWDTimerHandler.h" |
|
24 |
|
25 //Forward declaration |
|
26 class CWDTimer; |
|
27 |
|
28 class CWDMonitor : public CBase , public MWDTimerHandler |
|
29 { |
|
30 public: |
|
31 /* |
|
32 * Construction |
|
33 * @return instance of CWDMonitor |
|
34 */ |
|
35 static CWDMonitor* NewL(); |
|
36 /* |
|
37 * Construction |
|
38 * @return instance of CWDMonitor |
|
39 */ |
|
40 static CWDMonitor* NewLC(); |
|
41 /* |
|
42 * Destructor |
|
43 */ |
|
44 virtual ~CWDMonitor(); |
|
45 public: |
|
46 |
|
47 /* |
|
48 * @description Starts the timer for monitoring the servers. |
|
49 */ |
|
50 void StartMonitor(); |
|
51 |
|
52 // From MWDTimerHandler |
|
53 void HandleWDTimerL(); |
|
54 |
|
55 private: |
|
56 /* |
|
57 * @description Starts the specified server. |
|
58 * @param TDesC& aServerName Name of the server to start |
|
59 * @param TUid aServerUid uid of the server to start |
|
60 * @param TDesC& aSemaphoreName Name of the semaphore |
|
61 * @return KErrNone on succesful operation. |
|
62 */ |
|
63 TInt StartServer( const TDesC& aServerName , TUid aServerUid , |
|
64 const TDesC& aSemaphoreName); |
|
65 |
|
66 /* |
|
67 * @description creates the specified server process. |
|
68 * @param TDesC& aServerName Name of the server to start |
|
69 * @param TUid aServerUid uid of the server to start |
|
70 * @return KErrNone on succesful operation. |
|
71 */ |
|
72 TInt CreateServerProcess( const TDesC& aServerName , TUid aServerUid ); |
|
73 /* |
|
74 * Constructor |
|
75 */ |
|
76 CWDMonitor(); |
|
77 /* |
|
78 * Second phase constructor |
|
79 */ |
|
80 void ConstructL(); |
|
81 |
|
82 private: |
|
83 |
|
84 // Timer which is used to delay server monitoring |
|
85 CWDTimer* iWDTimer; |
|
86 }; |
|
87 |
|
88 #endif /* CWDMONITOR_H */ |