|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef SEN_PROVIDER_H |
|
26 #define SEN_PROVIDER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <ecom/ecom.h> |
|
30 #include <e32std.h> // for RCriticalSection |
|
31 |
|
32 #include <MSenServiceDescription.h> |
|
33 #include "senwsdescription.h" |
|
34 #include <SenFacet.h> |
|
35 |
|
36 #include "senidentifier.h" // internal Utils\inc |
|
37 #include "msenprovider.h" // internal Framework\inc |
|
38 |
|
39 // FORWARD DECLARE |
|
40 class CSenLocalRequest; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 /** |
|
45 * Class for delivering SOAP request to Serene and response back. |
|
46 * Sub-classing actual Service Providers have to implement MSenProvider |
|
47 * interface. |
|
48 * |
|
49 */ |
|
50 class CSenProvider : public CBase, public MSenProvider |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 */ |
|
56 static CSenProvider* NewL(const TDesC8& aMatch); |
|
57 |
|
58 static CSenProvider* NewL(); |
|
59 |
|
60 /** |
|
61 * Function: ~CSenProvider |
|
62 * |
|
63 * Description: Destroy the object |
|
64 */ |
|
65 virtual ~CSenProvider(); |
|
66 |
|
67 // From MSenHostlet: |
|
68 /** |
|
69 * Default implementation returns the ECOM cue as endpoint of this local provider. |
|
70 * @return ECOM cue of this plug-in implementation |
|
71 */ |
|
72 inline virtual TPtrC8 Endpoint() const; |
|
73 |
|
74 /** |
|
75 * Method provides the default implementation of adding facets in the SD after |
|
76 * checking the default values of the provider properties (exposed, shareable, |
|
77 * complete client message etc). Each overriden default facet value is added |
|
78 * to the service description (SD). |
|
79 * |
|
80 * @param aSD is the service description into which all the facets of this |
|
81 * hostlet (local service provider) will be added. |
|
82 * |
|
83 * Method provides means of "auto-configuration" for service session creation. |
|
84 * The sessions themself can read properties of the provider from the altered |
|
85 * XML service description. This way, provider deployment does not need to be |
|
86 * followed by explicit Service Management API calls (configuration) to add |
|
87 * these facet. |
|
88 */ |
|
89 inline virtual void DescribeServiceL(CSenWSDescription& aSD); |
|
90 |
|
91 /** |
|
92 * This default, inline version returns EFalse. Any service exposed to outside world should |
|
93 * override to return ETrue instead. That would cause inline method |
|
94 * InitServiceSession to add corresponding facet to the session. |
|
95 * @see MSenProvider interface |
|
96 */ |
|
97 inline virtual TBool Exposed() const; |
|
98 |
|
99 |
|
100 /** |
|
101 * This default, inline version version returns EFalse. Sharable, sub-classing providers need |
|
102 * to override this to return ETrue instead, if they allow multiple service consumers to have |
|
103 * queued access to the ServiceL() of the same provider instance. |
|
104 * @see MSenProvider interface |
|
105 */ |
|
106 inline virtual TBool Sharable() const; |
|
107 |
|
108 /** |
|
109 * This default, inline version version returns EFalse. Providers, which wish to receive |
|
110 * complete messages (with header information) need to override this to return ETrue instead. |
|
111 * @see MSenProvider interface |
|
112 */ |
|
113 inline virtual TBool CompleteClientMessages() const; |
|
114 |
|
115 |
|
116 /** |
|
117 * This default, inline version version returns EFalse. Providers, which have slow construction |
|
118 * mechanism should make this return ETrue, to make WSF Core Service Manager to pre-load them |
|
119 * after that (Symbian server) process is created and sensessions.xml database is being loaded. |
|
120 * @see MSenProvider interface |
|
121 */ |
|
122 inline virtual TBool LoadOnStartup() const; |
|
123 |
|
124 /** |
|
125 * This default, inline version version returns ETrue. Providers, which wish to permit |
|
126 * un-thread-safe access to their ServiceL need to make this return EFalse instead. |
|
127 * @see MSenProvider interface |
|
128 */ |
|
129 inline virtual TBool Threadsafe() const; |
|
130 |
|
131 /** |
|
132 * This default, inline version version returns EFalse. Providers, which allow themselves |
|
133 * to be re-cycled (reused) need to make this return EFalse. |
|
134 * @see MSenProvider interface |
|
135 */ |
|
136 inline virtual TBool Reinitializable() const; |
|
137 |
|
138 /** |
|
139 * This default, inline version version returns EFalse. Providers, which want themselves |
|
140 * to be left on background as long as main thread (Core Service Manager) is alive, need |
|
141 * to make this return ETrue instead. |
|
142 * @see MSenProvider interface |
|
143 */ |
|
144 inline virtual TBool StayOnBackground() const; |
|
145 |
|
146 /** |
|
147 * Default implementation does nothing, and |
|
148 * returns KErrNotSupported. |
|
149 * Subclasses should override this method in |
|
150 * order to re-initialize any state variables |
|
151 * that are not related to exact construction |
|
152 * phase; for example, some provider might |
|
153 * reset any state data it has, but still it |
|
154 * might decide to keep negotiated client |
|
155 * (connection) to some server open, making |
|
156 * just corresponding "re-init" to that service |
|
157 * being internally consumed by that provider. |
|
158 * |
|
159 * Typically, this method is a pair to Reinitializable() |
|
160 * function, meaning that when one develops such provider |
|
161 * which supports reinitialization, that re-init should be |
|
162 * implemented behind this ReinitL() method. |
|
163 * |
|
164 * @see MSenProvider |
|
165 */ |
|
166 inline virtual TInt ReinitL(); |
|
167 |
|
168 /** |
|
169 * Default implementation does nothing. Subclasses should override this. |
|
170 */ |
|
171 //inline virtual void ThreadInitL(const TDesC& /* aThreadId */) { ; } |
|
172 |
|
173 /** |
|
174 * Default implementation does nothing. Subclasses should override this. |
|
175 */ |
|
176 //inline virtual void ThreadDestroy(const TDesC& /* aThreadId */) { ; } |
|
177 |
|
178 private: |
|
179 /** iDtor_ID_Key Instance identifier key. When instance of an |
|
180 * implementation is created by ECOM framework, the |
|
181 * framework will assign UID for it. The UID is used in |
|
182 * destructor to notify framework that this instance is |
|
183 * being destroyed and resources can be released. |
|
184 */ |
|
185 TUid iDtor_ID_Key; |
|
186 |
|
187 HBufC8* iCue; |
|
188 |
|
189 TAny* _reserved; |
|
190 TAny* _reserved2; |
|
191 }; |
|
192 |
|
193 #include "senprovider.inl" |
|
194 |
|
195 #endif |
|
196 |
|
197 // End of File |