webservices/wsframework/inc/senapplicationcontext.h
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     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:        Each application that connects WS-stack through client-server
       
    15 *                interface has an application context of it's own, which can
       
    16 *                hold a list for active connections and service sessions, 
       
    17 *                acting as a common place holder and bridge between the
       
    18 *                smaller (contexts) that those contain. Class allows 
       
    19 *                application-wide information to be shared efficiently
       
    20 *                at proper layer.
       
    21 *
       
    22 */
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 
       
    31 #ifndef SEN_APPLICATION_CONTEXT_H
       
    32 #define SEN_APPLICATION_CONTEXT_H
       
    33 
       
    34 
       
    35 // INCLUDES
       
    36 #include <e32base.h>
       
    37 #include <e32std.h>
       
    38 #include "e32cmn.h"
       
    39 
       
    40 //#include "SenContext.h"
       
    41 #include "senpointermap.h"
       
    42 
       
    43 #include "senclientcontext.h"
       
    44 
       
    45 // FORWARD DECLARATIONS
       
    46 class CSenServerContext;
       
    47 //class CSenClientContext;
       
    48 
       
    49 // TYPE DEFS
       
    50 typedef RSenPointerMap<TInt, CSenClientContext> RClientCtxMap; 
       
    51 
       
    52 // CLASS DECLARATION
       
    53 class CSenApplicationContext : public CBase // CSenContext
       
    54     {
       
    55     friend class CSenServerContext;
       
    56         
       
    57     public:
       
    58         // Destructor:
       
    59         IMPORT_C virtual ~CSenApplicationContext();
       
    60         
       
    61         // New methods:
       
    62         
       
    63         virtual CSenServerContext& ServerContext() const;
       
    64         
       
    65         virtual TSecureId SecureId() const;
       
    66         virtual CSenClientContext& OpenClientContextL(TInt aClientId);
       
    67         virtual TInt CloseClientContext(const CSenClientContext& aCtx);
       
    68         
       
    69     protected:
       
    70         IMPORT_C  CSenApplicationContext(TSecureId aSecureId, CSenServerContext& aCtx);
       
    71                                      
       
    72         IMPORT_C void BaseConstructL();
       
    73 
       
    74     private: 
       
    75         /**
       
    76         * Standard 2-phased constructor
       
    77         * @return pointer to new context.
       
    78         */ 
       
    79         IMPORT_C static  CSenApplicationContext* NewL(TSecureId aSecureId, CSenServerContext& aCtx);
       
    80         
       
    81         /**
       
    82         * Standard 2-phased constructor 
       
    83         * @return pointer to new context,
       
    84         * which is left on cleanupstack.
       
    85         */ 
       
    86         IMPORT_C static  CSenApplicationContext* NewLC(TSecureId aSecureId, CSenServerContext& aCtx);
       
    87         
       
    88     private: // data
       
    89         TSecureId iSecureId;
       
    90         CSenServerContext& iServerContext; 
       
    91         RClientCtxMap iClients;       
       
    92     };
       
    93 
       
    94 #endif // SEN_APPLICATION_CONTEXT_H
       
    95 
       
    96 // End of File