|
1 /* |
|
2 * Copyright (c) 2008 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "atextsrv.h" |
|
20 #include "atextclientsrv.h" |
|
21 #include "atextsecpolicy.h" |
|
22 #include "atextsession.h" |
|
23 #include "debug.h" |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 CATExtSrv::CATExtSrv( TInt aPriority ) : |
|
30 CPolicyServer( aPriority, KSrvPolicy ) |
|
31 { |
|
32 } |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 // --------------------------------------------------------------------------- |
|
37 // |
|
38 CATExtSrv::~CATExtSrv() |
|
39 { |
|
40 iSessions.Close(); |
|
41 TRACE_FUNC |
|
42 } |
|
43 |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 // --------------------------------------------------------------------------- |
|
47 // |
|
48 CATExtSrv* CATExtSrv::NewLC() |
|
49 { |
|
50 CATExtSrv* self = new (ELeave) CATExtSrv( EPriorityNormal ); |
|
51 CleanupStack::PushL( self ); |
|
52 self->ConstructL(); |
|
53 self->StartL( KATExtSrvName ); |
|
54 RThread().SetPriority( EPriorityNormal ); |
|
55 return self; |
|
56 } |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 void CATExtSrv::ClientClosed( CATExtSession& aSession ) |
|
63 { |
|
64 TRACE_FUNC_ENTRY |
|
65 TInt index = iSessions.Find( &aSession ); |
|
66 if ( index >= 0 ) |
|
67 { |
|
68 iSessions.Remove( index ); |
|
69 } |
|
70 TRACE_FUNC_EXIT |
|
71 } |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 CSession2* CATExtSrv::NewSessionL( const TVersion& aVersion, |
|
78 const RMessage2& /*aMessage*/ ) const |
|
79 { |
|
80 TRACE_FUNC_ENTRY |
|
81 CATExtSrv& thisServer = const_cast<CATExtSrv&>( *this ); |
|
82 CATExtSession* session = CATExtSession::NewL( thisServer, aVersion ); |
|
83 CleanupStack::PushL( session ); |
|
84 thisServer.iSessions.AppendL( session ); |
|
85 CleanupStack::Pop( session ); |
|
86 TRACE_FUNC_EXIT |
|
87 return session; |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void CATExtSrv::ConstructL() |
|
95 { |
|
96 TRACE_FUNC_ENTRY |
|
97 TRACE_FUNC_EXIT |
|
98 } |