140 delete iStorageProxy; |
141 delete iStorageProxy; |
141 delete iExitTimer; |
142 delete iExitTimer; |
142 } |
143 } |
143 |
144 |
144 // --------------------------------------------------------- |
145 // --------------------------------------------------------- |
145 // |
146 // |
146 // --------------------------------------------------------- |
147 // --------------------------------------------------------- |
147 // |
148 // |
148 CCaStorageProxy* CCaSrv::GetStorageProxy() |
149 CCaStorageProxy* CCaSrv::GetStorageProxy() |
149 { |
150 { |
150 return iStorageProxy; |
151 return iStorageProxy; |
151 } |
152 } |
152 |
153 |
153 // --------------------------------------------------------- |
154 // --------------------------------------------------------- |
154 // |
155 // |
155 // --------------------------------------------------------- |
156 // --------------------------------------------------------- |
156 // |
157 // |
157 CCaSrv::CCaSrv() : |
158 CCaSrv::CCaSrv() : |
158 CServer2( EPriorityNormal, CServer2::TServerType( EIpcSession_Sharable ) ) |
159 CServer2( EPriorityNormal, CServer2::TServerType( EIpcSession_Sharable ) ) |
159 { |
160 { |
160 } |
161 } |
161 |
162 |
162 // --------------------------------------------------------- |
163 // --------------------------------------------------------- |
163 // |
164 // |
164 // --------------------------------------------------------- |
165 // --------------------------------------------------------- |
165 // |
166 // |
166 void CCaSrv::ConstructL() |
167 void CCaSrv::ConstructL() |
167 { |
168 { |
168 iSessionCount = 0; |
169 iSessionCount = 0; |
169 iExitTimer = CTimeout::NewL( CActive::EPriorityStandard, TCallBack( |
170 iExitTimer = CTimeout::NewL( CActive::EPriorityStandard, TCallBack( |
170 StopScheduler, NULL ) ); |
171 StopScheduler, NULL ) ); |
171 iStorageProxy = CCaStorageProxy::NewL(); |
172 iStorageProxy = CCaStorageProxy::NewL(); |
172 iSrvEngUtils = CCaSrvEngUtils::NewL(); |
173 iSrvEngUtils = CCaSrvEngUtils::NewL(); |
173 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils ); |
174 TRAPD( err, iSrvManager = CCaSrvManager::NewL( |
174 } |
175 *iStorageProxy, iSrvEngUtils ) ); |
175 |
176 if( KSqlErrNotDb <= err && err <= KSqlErrGeneral ) |
176 // --------------------------------------------------------- |
177 { |
177 // |
178 //problem in loading one of plugins, probably data base is corrupted |
|
179 //lets load it from ROM and try again |
|
180 iStorageProxy->LoadDataBaseFromRomL(); |
|
181 iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils ); |
|
182 } |
|
183 } |
|
184 |
|
185 // --------------------------------------------------------- |
|
186 // |
178 // --------------------------------------------------------- |
187 // --------------------------------------------------------- |
179 // |
188 // |
180 CSession2* CCaSrv::NewSessionL( const TVersion& aVersion, |
189 CSession2* CCaSrv::NewSessionL( const TVersion& aVersion, |
181 const RMessage2& /*aMessage*/) const |
190 const RMessage2& /*aMessage*/) const |
182 { |
191 { |
190 iExitTimer->Cancel(); // We have a client, cancel exit (if pending). |
199 iExitTimer->Cancel(); // We have a client, cancel exit (if pending). |
191 return session; |
200 return session; |
192 } |
201 } |
193 |
202 |
194 // --------------------------------------------------------- |
203 // --------------------------------------------------------- |
195 // |
204 // |
196 // --------------------------------------------------------- |
205 // --------------------------------------------------------- |
197 // |
206 // |
198 void CCaSrv::IncreaseSessionCount() |
207 void CCaSrv::IncreaseSessionCount() |
199 { |
208 { |
200 iSessionCount++; |
209 iSessionCount++; |
201 } |
210 } |
202 |
211 |
203 // --------------------------------------------------------- |
212 // --------------------------------------------------------- |
204 // |
213 // |
205 // --------------------------------------------------------- |
214 // --------------------------------------------------------- |
206 // |
215 // |
207 void CCaSrv::DecreaseSessionCount() |
216 void CCaSrv::DecreaseSessionCount() |
208 { |
217 { |
209 iSessionCount--; |
218 iSessionCount--; |