1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/lowlevellibsandfws/pluginfw/Framework/frame/EComServerSession.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,166 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// Definition of the CEComServerSession class
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @internalComponent
1.23 + @file
1.24 +*/
1.25 +
1.26 +#ifndef __ECOMSERVERSESSION_H__
1.27 +#define __ECOMSERVERSESSION_H__
1.28 +
1.29 +#include <s32mem.h>
1.30 +#include "EComServer.h"
1.31 +
1.32 +#include "clientrequest.h"
1.33 +
1.34 +// __________________________________________________________________________
1.35 +//
1.36 +/**
1.37 + @internalComponent
1.38 + @since 7.0
1.39 + Provides the server side session which
1.40 + handles the messages from REComSession, unpacking the input
1.41 + message parameters, calling the server and packaging the
1.42 + the returned data as output message parameters.
1.43 + Warning : The implementation of the ListImplementations
1.44 + method for returning an arbitrary sized data set
1.45 + uses a 2 phase collection method that
1.46 + will not work IF the session is shared and two
1.47 + client calls on this method are interleaved.
1.48 + It leads to incorrect results for one of them,
1.49 + with potentially fatal results. so...
1.50 + DO NOT SHARE SERVER SIDE SESSIONS BETWEEN CLIENTS
1.51 + */
1.52 +
1.53 +class CEComServerSession : public CSession2
1.54 + {
1.55 +public:
1.56 +
1.57 + CEComServerSession();
1.58 +
1.59 +
1.60 + void CreateL();
1.61 +/**
1.62 + @fn void CompleteNotifications(TInt aCompletionCode)
1.63 + Intended Usage : Completes all the outstanding notification requests with the
1.64 + supplied error code.
1.65 + @since 7.0
1.66 + @param aCompletionCode The code with which to complete the notifications.
1.67 + @pre REComServerSession is fully constructed.
1.68 + @post The notifications contained on the iNotificationRequests array
1.69 + have been completed with aCompletionCode, and the array has
1.70 + been cleared.
1.71 + */
1.72 +
1.73 + void CompleteNotifications(TInt aCompletionCode);
1.74 +
1.75 +private:
1.76 +
1.77 + inline CEComServer& Server();
1.78 +
1.79 +
1.80 + ~CEComServerSession();
1.81 +
1.82 +
1.83 + void ServiceL(const RMessage2& aMessage);
1.84 +
1.85 + void ServiceL(const TClientRequest& aMessage);
1.86 +
1.87 +
1.88 + inline TBool ReceivePending() const;
1.89 +
1.90 +
1.91 + void DoListImplementationsL(const TClientRequest& aMessage);
1.92 +
1.93 +
1.94 + TBool DoCollectListL(const TClientRequest& aMessage);
1.95 +
1.96 + void DoListExtendedInterfacesL(const TClientRequest& aMessage);
1.97 +
1.98 + void DoGetResolvedImplementationL(const TClientRequest& aMessage);
1.99 + void UnpackMatchStrAndExtendedInterfacesFromClientL(const TClientRequest& aMessage,
1.100 + RExtendedInterfacesArray& aExtendedInterfaces,
1.101 + RBuf8& aMatchStr);
1.102 +
1.103 + void DoSetGetParametersL(const TClientRequest& aMessage);
1.104 +/**
1.105 + @fn CleanupInternalList()
1.106 + Intended Usage : Releases the list of CImplementationInformation pointers
1.107 + that are stored within the iList variable after a successful
1.108 + call to the DoListImplementations service.
1.109 + @since 7.0
1.110 + @pre REComServerSession is fully constructed.
1.111 + @post The resources held by iList are released, and iList is NULL.
1.112 + */
1.113 +
1.114 + void CleanupInternalList();
1.115 +
1.116 +private:
1.117 + /**
1.118 + The externalised data from a ListImplementations service call
1.119 + held for return, pending the collection service call.
1.120 + */
1.121 +
1.122 + CBufFlat* iMemoryStore;
1.123 +
1.124 + /** The last ListImplementations service request */
1.125 +
1.126 + TInt iListContext;
1.127 +
1.128 + /**
1.129 + A successful ListImplementations service request
1.130 + generates a list of CImplementationInformation pointers
1.131 + that are stored within this list.
1.132 + */
1.133 +
1.134 + RImplInfoArray* iList;
1.135 +
1.136 + /** The array of client notification requests outstanding */
1.137 +
1.138 + struct SEComNotification
1.139 + {
1.140 + /** Notification status object */
1.141 + TInt iRequestStatusHandle;
1.142 + /** Client identity */
1.143 + TClientRequest iMessage;
1.144 + };
1.145 +
1.146 + RArray<SEComNotification> iNotificationRequests;
1.147 +
1.148 + /** A friend class for testing purposes */
1.149 + friend class TEComServer_StateAccessor;
1.150 + /** A friend class for testing purposes */
1.151 + friend class TEComServerSession_StateAccessor;
1.152 + };
1.153 +
1.154 +/**
1.155 +@fn PanicClient(const RMessage& aMessage,TInt aPanicCode)
1.156 +Intended Usage : A global function to complete aMessage with the supplied panic code.
1.157 +@since 7.0
1.158 +@param aPanicCode The error code with which to complete the message.
1.159 +@pre None.
1.160 +@post aMessage has been completed.
1.161 +@internalComponent
1.162 +*/
1.163 +extern void PanicClient(const TClientRequest& aMessage,TInt aPanicCode);
1.164 +
1.165 +#include "EComServerSession.inl"
1.166 +
1.167 +#endif // __ECOMSERVERSESSION_H__
1.168 +
1.169 +