|
1 /* |
|
2 * Copyright (c) 2002 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: See class description below. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CPENGPLGSESS_H__ |
|
20 #define __CPENGPLGSESS_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32def.h> |
|
24 #include "MPEngplgSrv.h" |
|
25 |
|
26 // CONSTANTS |
|
27 _LIT( KSessionName, "PlgSrvSession" ); |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CPEngPluginStatus; |
|
31 |
|
32 // CLASS DEFINITION |
|
33 /* |
|
34 ----------------------------------------------------------------------------- |
|
35 |
|
36 DESCRIPTION |
|
37 |
|
38 This is session class for cache server. Session receives service requests |
|
39 from client. Session is responsible to handle received requests. |
|
40 |
|
41 ----------------------------------------------------------------------------- |
|
42 */ |
|
43 class CPEngPlgSess : public CSession2 |
|
44 { |
|
45 public: // Constructors and destructors |
|
46 |
|
47 static CPEngPlgSess* NewL( MPEngPlgSrv& aServer ); // Static constructor |
|
48 virtual ~CPEngPlgSess(); // Destructor (virtual) |
|
49 |
|
50 protected: // Constructors and destructors |
|
51 |
|
52 /** |
|
53 * Default constructor, protected to allow derivation |
|
54 * |
|
55 * @param aServer reference to the server instance |
|
56 */ |
|
57 CPEngPlgSess( MPEngPlgSrv& aServer ); |
|
58 |
|
59 private: // New methods |
|
60 |
|
61 /** |
|
62 * Handles the message |
|
63 * |
|
64 * @param aMessage is received message. |
|
65 * @return TBool ETrue if message should be completed |
|
66 * in ServiceL |
|
67 */ |
|
68 TBool DispatchMessageL( const RMessage2 &aMessage ); |
|
69 |
|
70 /* |
|
71 * Client is panicked using this method. |
|
72 */ |
|
73 void PanicClient( const RMessage2& aMessage, const TInt aPanic ) const; |
|
74 |
|
75 public: // Methods derived from CSession2 |
|
76 |
|
77 /** |
|
78 * Handles the servicing of client requests to the server. |
|
79 * |
|
80 * @param aMessage is received message. |
|
81 */ |
|
82 void ServiceL( const RMessage2 &aMessage ); |
|
83 |
|
84 /** |
|
85 * Handles service error that could happen in ServiceL. |
|
86 * |
|
87 * @param aMessage is received message. |
|
88 * @param aError is the error value. |
|
89 */ |
|
90 void ServiceError( const RMessage2& aMessage, TInt aError ); |
|
91 |
|
92 private: // Methods not implemented |
|
93 |
|
94 CPEngPlgSess( const CPEngPlgSess& ); // Copy constructor |
|
95 CPEngPlgSess& operator=( const CPEngPlgSess& ); // Assigment operator |
|
96 |
|
97 private: // Data |
|
98 |
|
99 /// not owned, pointer to server class |
|
100 MPEngPlgSrv& iPlgServer; |
|
101 }; |
|
102 |
|
103 #endif // __CPENGPLGSESS_H__ |