|
1 /* |
|
2 * Copyright (c) 2002-2007 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 is the active scheduler of the SAT Server. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32svr.h> // RDebug |
|
22 #include "CSatSScheduler.h" |
|
23 #include "CSatSServer.h" |
|
24 #include "SatLog.h" |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ========================================== |
|
27 |
|
28 // The class constructor. |
|
29 EXPORT_C CSatSScheduler::CSatSScheduler() |
|
30 { |
|
31 LOG( SIMPLE, "SATENGINE: CSatSScheduler::SetServer calling - exiting" ) |
|
32 } |
|
33 |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CSatSScheduler::SetServer |
|
36 // Gives a pointer of the current CSatSServer instance to the scheduler. |
|
37 // (other items were commented in a header). |
|
38 // ----------------------------------------------------------------------------- |
|
39 // |
|
40 EXPORT_C void CSatSScheduler::SetServer( CSatSServer* aServer ) |
|
41 { |
|
42 LOG( SIMPLE, "SATENGINE: CSatSScheduler::SetServer calling" ) |
|
43 iServer = aServer; |
|
44 LOG( SIMPLE, "SATENGINE: CSatSScheduler::SetServer exiting" ) |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CSatSScheduler::Error |
|
49 // Overridden to handle leaves in request functions and unexpected situations. |
|
50 // (other items were commented in a header). |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 void CSatSScheduler::Error( TInt aError ) const |
|
54 { |
|
55 LOG( SIMPLE, "SATENGINE: CSatSScheduler::Error calling" ) |
|
56 LOG2( SIMPLE, "SATENGINE: CSatSScheduler::Error aError=%d", aError ) |
|
57 |
|
58 if ( iServer ) |
|
59 { |
|
60 if ( iServer->IsActive() ) |
|
61 { |
|
62 LOG( SIMPLE, "SATENGINE: CSatSScheduler::Error iServer active" ) |
|
63 __DEBUGGER() |
|
64 } |
|
65 else |
|
66 { |
|
67 // Relay the error code to the client and restart the server. |
|
68 LOG( SIMPLE, "SATENGINE: CSatSScheduler::Error iServer not active" ) |
|
69 iServer->CompleteMessage( aError ); |
|
70 iServer->ReStart(); |
|
71 } |
|
72 } |
|
73 |
|
74 LOG( SIMPLE, "SATENGINE: CSatSScheduler::Error exiting" ) |
|
75 } |
|
76 |
|
77 // End of File |