ximpfw/core/srcutils/ximpsrvsession.h
changeset 0 e6b17d312c8b
equal deleted inserted replaced
-1:000000000000 0:e6b17d312c8b
       
     1 /*
       
     2 * Copyright (c) 2006 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:  Abstract server session interface
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef MXIMPSRVSESSION_H
       
    19 #define MXIMPSRVSESSION_H
       
    20 
       
    21 #include <e32std.h>
       
    22 
       
    23 class MXIMPSrvMessage;
       
    24 
       
    25 
       
    26 /**
       
    27  * Abstract server session interface
       
    28  */
       
    29 class MXIMPSrvSession
       
    30     {
       
    31 public:
       
    32 
       
    33     /**
       
    34      * Public destructor.
       
    35      * Objects can be deleted through this interface.
       
    36      */
       
    37     virtual ~MXIMPSrvSession() { };
       
    38 
       
    39 
       
    40     /**
       
    41      * Message handling method.
       
    42      * Session adapters call this to mediate message handling
       
    43      * to concrete session objects.
       
    44      *
       
    45      * Rules for message handling:
       
    46      *
       
    47      * - If message is handled synchronously, handler must complete
       
    48      * the message when finished with it. Handler may not cause leave
       
    49      * exeptions after completing.
       
    50      *
       
    51      * - If message handling fails, it should be handled with a leave.
       
    52      * In this case Session::ServiceError() methods take care
       
    53      * of completing the message with leave code.
       
    54      *
       
    55      * - If handler wishes to complete the message asynchronously,
       
    56      * it must take message ownership to itself by using
       
    57      * MXIMPSrvMessage::PlaceOwnershipHere(). In this case handler
       
    58      * is responsible both to completing and deleting the message object.
       
    59      * After taking message ownership, message handler isn't anymore
       
    60      * allowed to cause leave exeptions during the same message
       
    61      * handling path.
       
    62      *
       
    63      * @param aMessage The message to handle.
       
    64      */
       
    65     virtual void TryHandleMessageL( MXIMPSrvMessage& aMessage ) = 0;
       
    66     };
       
    67 
       
    68 
       
    69 #endif      //  MXIMPSRVSESSION_H
       
    70 
       
    71