javamanager/javacaptain/systemams/src/legacyserver.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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:  CLegacyServer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "logger.h"
       
    20 
       
    21 #include "legacyserversession.h"
       
    22 #include "legacyserver.h"
       
    23 
       
    24 CLegacyServer::CLegacyServer(const int aServerId,
       
    25                              MLegacyServerHandler* aHandler)
       
    26         :CServer2(EPriorityNormal),
       
    27         mServerId(aServerId),
       
    28         mHandler(aHandler)
       
    29 {
       
    30     JELOG2(EJavaSystemAMS);
       
    31 }
       
    32 
       
    33 CLegacyServer::~CLegacyServer()
       
    34 {
       
    35     JELOG2(EJavaSystemAMS);
       
    36 }
       
    37 
       
    38 CSession2* CLegacyServer::NewSessionL(const TVersion&, const RMessage2& /*aMessage*/) const
       
    39 {
       
    40     return new(ELeave) CLegacyServerSession(*this);
       
    41 }
       
    42 
       
    43 _LIT(KPublicServerName,     "!SystemAMSTrader.Public");
       
    44 _LIT(KAdminServerName,  "!SystemAMS.SecurityAdmin");
       
    45 
       
    46 void CLegacyServer::StartL()
       
    47 {
       
    48 
       
    49     switch (mServerId)
       
    50     {
       
    51     case SERVER_ID_PUBLIC_C:
       
    52         CServer2::StartL(KPublicServerName);
       
    53         break;
       
    54 
       
    55     case SERVER_ID_SECURITY_ADMIN_C:
       
    56         CServer2::StartL(KAdminServerName);
       
    57         break;
       
    58     }
       
    59 }
       
    60 
       
    61 void CLegacyServer::HandleMessageL(const RMessage2& aMessage) const
       
    62 {
       
    63     JELOG2(EJavaSystemAMS);
       
    64     mHandler->HandleMessageL(mServerId, aMessage);
       
    65 }
       
    66