Location:
ECom.h
Link against: ecom.lib
class REComSession : public RSessionBase;
The REComSession singleton class provides an API to identify (resolution), instantiate, and destroy interface class implementations
requested by ECOM clients. It manages the session connection to the ECOM Server itself so that typically only one connection
is made to the ECOM Server per thread. It provides an un-initialise function where it releases memory and handles of unused
plug-ins, see the FinalClose()
function. It also ensures that all necessary clean-up is performed in the event of a Leave by any of the ListImplementationsL()
or CreateImplementationL()
methods.
Note: Although a public default constructor is provided in this class it is strongly recommended this object is never created
by users of this API on the stack or heap by value. To access the non-static methods of this API use the static OpenL()
method to obtain a pointer or a reference to the single reference counted session in use. Close()
must be called when finished with.
RHandleBase
- A handle to an object
RSessionBase
- Client-side handle to a session with a server
REComSession
- The REComSession singleton class provides an API to identify (resolution), instantiate, and destroy interface class implementations
requested by ECOM clients
Defined in REComSession
:
CancelNotifyOnChange()
, Close()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, CreateImplementationL()
, DestroyedImplementation()
, FinalClose()
, ListImplementationsL()
, ListImplementationsL()
, ListImplementationsL()
, NotifyOnChange()
, OpenL()
, REComSession()
Inherited from RHandleBase
:
Attributes()
,
Duplicate()
,
FullName()
,
Handle()
,
HandleInfo()
,
Name()
,
SetHandle()
,
SetHandleNC()
,
iHandle
Inherited from RSessionBase
:
CreateSession()
,
EAutoAttach
,
EExplicitAttach
,
Open()
,
Send()
,
SendReceive()
,
SetReturnedHandle()
,
ShareAuto()
,
ShareProtected()
,
TAttachMode
static IMPORT_C REComSession &OpenL();
This method returns a reference to the singleton client/server session object maintained by the ECOM client library, referenced counted. If it does not exist it is initialised and then returned. Clients should store the handle returned by refernce or by pointer. Storage by value is highly discouraged.
It is only necessary to use the Open()
/Close() API directly if you need access to the notification methods. Access to the static API does not require these to be
used. Please remeber each call to Open()
must have an equivalent Close()
.
REComSession is connected and ready to issue ECOM requests.
|
|
IMPORT_C void Close();
REComSession must have been opened.
Closes the open handle on the ECOM framework. Reference count is decremented and the ECOM client/server session is closed.
REComSession reference count is decremented, server session closed
IMPORT_C void NotifyOnChange(TRequestStatus &aStatus);
REComSession must have been opened.
Registers for notification messages when the underlying ECOM registration data changes. The client must not call this api again until their request is Completed as this could result in a 'stray signal'. This api should be placed first in the RunL of an Active Object otherwise changes could be lost. RunError should be implemented to cater for any Leaves. For example, it could retry after a second if the ECom server is busy rebuilding its indexes. CancelNotifyOnChange should be called to cancel this request and should NOT be part of the RunL.
The caller is registered for receipt of notifications if the server's registry data changes.
|
IMPORT_C void CancelNotifyOnChange(TRequestStatus &aStatus);
REComSession must have been opened.
De-registers for notification messages.
The caller's registeration for reciept of notifications of registry data changes has been cancelled.
|
static IMPORT_C void ListImplementationsL(TUid aInterfaceUid, RImplInfoPtrArray &aImplInfoArray);
Retrieves a list of all the implementations which satisfy the specified interface. The aImplInfoArray on exit contains the plug-in implementations who's plug-in DLLs have sufficient capabilities to be loaded by the calling client process.
REComSession has not changed, and aImplInfoArray contains the list of Implementation information for the interface.
|
|
static IMPORT_C void ListImplementationsL(TUid aInterfaceUid, const TEComResolverParams &aResolutionParameters, RImplInfoPtrArray
&aImplInfoArray);
Retrieves a list of all the implementations which satisfy the specified interface with selection restriction to the specified parameters. The aImplInfoArray on exit contains the plug-in implementations who's plug-in DLLs have sufficient capabilities to be loaded by the calling client process.
REComSession has not changed, and aImplInfoArray contains the list of Implementation information for the interface.
|
|
static IMPORT_C void ListImplementationsL(TUid aInterfaceUid, const TEComResolverParams &aResolutionParameters, TUid aResolverUid,
RImplInfoPtrArray &aImplInfoArray);
Retrieves a list of all the implementations which satisfy the specified interface with selection restriction to the specified
parameters. The aImplInfoArray on exit contains the plug-in implementations who's plug-in DLLs have sufficient capabilities
to be loaded by the calling client process. Overload with a client provided CResolver
.
REComSession has not changed, and aImplInfoArray contains the list of Implementation information for the interface.
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aImplementationUid, TUid &aDtorIDKey);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aImplementationUid, TInt32 aKeyOffset);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aImplementationUid, TUid &aDtorIDKey, TAny *aConstructionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aImplementationUid, TInt32 aKeyOffset, TAny *aConstructionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TUid &aDtorIDKey, const TEComResolverParams &aResolutionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TInt32 aKeyOffset, const TEComResolverParams &aResolutionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TUid &aDtorIDKey, TAny *aConstructionParameters, const TEComResolverParams
&aResolutionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TInt32 aKeyOffset, TAny *aConstructionParameters, const TEComResolverParams
&aResolutionParameters);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TUid &aDtorIDKey, const TEComResolverParams &aResolutionParameters,
TUid aResolverUid);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TInt32 aKeyOffset, const TEComResolverParams &aResolutionParameters,
TUid aResolverUid);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TUid &aDtorIDKey, TAny *aConstructionParameters, const TEComResolverParams
&aResolutionParameters, TUid aResolverUid);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C TAny *CreateImplementationL(TUid aInterfaceUid, TInt32 aKeyOffset, TAny *aConstructionParameters, const TEComResolverParams
&aResolutionParameters, TUid aResolverUid);
Instantiates an interface implementation to satisfy the specified interface.
The requested interface implementation is identified, and the instantiation method pointer is returned.
|
|
|
static IMPORT_C void DestroyedImplementation(TUid aDtorIDKey);
Signals the destruction of an interface implementation to ECOM. LoadManager is responsible for destroying the implementation
The destruction of the Interface Implementation referred to by aDtorIDKey
|
static IMPORT_C void FinalClose();
This method is used in processes that have utilised the ECOM framework, it does nothing if the ECOM framework has not been initialised. Its main purpose is to release memory and close handles held on unused plug-in implementations and their associated DLLs. If is found (through reference counting) that the ECOM framework is no longer in use in the calling thread the session to the ECOM's server is also closed.
This method is called by direct users of the ECOM framework wherever possible (e.g. library, server or test code). It is safe to call it at any time outside of plug-in code as the user's scenario dictates. This maybe during a test case or just before process termination.
Note: It must never be called from within a plug-in implementations class destructor, especially following a DestroyImplementation()
as there is a risk that the plug-in's supporting DLL may immediately be unloaded by the Kernel due to the closure of RLibrary
handles. It can result in a KERN-EXEC if the destructor call stack is still inside the DLL that is unloaded.
Note: Processes that utilise the ECOM framework that do not use this call are at risk of a UHEAP_MARKEND generated panic in debug builds.